GithubHelp home page GithubHelp logo

tosone / minimp3 Goto Github PK

View Code? Open in Web Editor NEW
116.0 7.0 18.0 562 KB

Decode mp3 base on https://github.com/lieff/minimp3

License: MIT License

Go 10.93% C 88.84% Makefile 0.23%
mp3 golang decoder

minimp3's People

Contributors

tosone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

minimp3's Issues

how can I change another mp3 to play


package main

import (
"io/ioutil"
"time"
"github.com/hajimehoshi/oto"
"github.com/tosone/minimp3"
"log"
)

func players() error {
file, _ := ioutil.ReadFile("assets/mp3/test.mp3")
dec, data, _ := minimp3.DecodeFull(file)

player, _ := oto.NewPlayer(dec.SampleRate, dec.Channels, 2, 4000)
player.Write(data)

dec.Close()
player.Close()
return nil
}

func main() {
for i := 0; i < 3; i++ {
if err := players(); err != nil {
log.Fatal(err)
}
time.Sleep(time.Second * 5)
}
}

when I run above code it got a error:
panic: oto: NewContext can be called only once
how can I solve this error, and I want to chenge another mp3 to play , is seems I cant close NewContext then create a new player
my test.mp3 is 2 second

can this library be used for playing any mp3 files?

I test this library with a downloaded mp3 file, it cannot play music clearly. But it can play your test.mp3, so I want to ask, does this library can be used for playing any mp3 file?

I checked the downloaded file, its rate is 44100, channel is 2.

Wrong EOF behavior

Don't you get an EOF error when caling decoder.Read() faster or with larger buffer than the speed of decoding itself - even if you haven't actually decoded the whole file ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.