Closed matthieugrieger closed 9 years ago
does SourceFile() need to be used to specify the file to stream from?
Yes. Here is an example:
stream := gumble_ffmpeg.New(client)
stream.Source = gumble_ffmpeg.SourceFile("myfile.mp3")
stream.Play()
The audio player example project just passes the filename to the Play() function, but I think it might be outdated.
I need to fix that. Thank you for the reminder.
What is the correct way to do callbacks after the song has finished?
// ...
stream.Play()
go func() {
stream.Wait()
mycallbackfunc()
} ()
Thanks for the response! On May 9, 2015 6:16 PM, "Tim Cooper" notifications@github.com wrote:
does SourceFile() need to be used to specify the file to stream from?
Yes. Here is an example:
stream := gumble_ffmpeg.New(client) stream.Source = gumble_ffmpeg.SourceFile("myfile.mp3") stream.Play()
The audio player example project just passes the filename to the Play() function, but I think it might be outdated.
I need to fix that. Thank you for the reminder.
What is the correct way to do callbacks after the song has finished?
// ... stream.Play()go func() { stream.Wait() mycallbackfunc() } ()
— Reply to this email directly or view it on GitHub https://github.com/layeh/gumble/issues/16#issuecomment-100568701.
Awesome, I've got it working now!
Hi there,
I have some questions about how gumble_ffmpeg works now since it seems to have been reworked.
1) Since the arguments to
Play()
have been removed, doesSourceFile()
need to be used to specify the file to stream from? Whenever I use this function I get a "nil source" error even though the source file definitely exists. The audio player example project just passes the filename to thePlay()
function, but I think it might be outdated.2) What is the correct way to do callbacks after the song has finished? It used to be passed into
Play()
as well but now I'm guessing you have to useWait()
in some fashion?Thanks!