Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method for closing the context and hence releasing the device #107

Open
duysqubix opened this issue Oct 11, 2023 · 2 comments
Open

Method for closing the context and hence releasing the device #107

duysqubix opened this issue Oct 11, 2023 · 2 comments

Comments

@duysqubix
Copy link
Contributor

The audio device never releases after calling speaker.Init()
I suggest to extract the following code from Init():

if player != nil {
	done <- struct{}{}
	player.Close()
	context.Close()
}

to a separated public method.

What do you think?

BTW, great work! This pkg is the cornerstone of a project I'm working on

Original issue: faiface/beep#56

@punkscience
Copy link

I think I have also run into this issue. I am playing a list of songs in my playlist and it only successfully plays a single song to finish. On the second and every subsequent song, I get the following issue:

failed to initialize speaker: oto: context is already created

I attempted to defer close of the speaker and also to force close the speaker but it did not fix the problem.

@MarkKremer
Copy link
Contributor

MarkKremer commented Jan 16, 2024

Continuation of the last comment in #143.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants