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

Interruptions if I play two files at the same time on android 6.0 #61

Open
marinat opened this issue Jul 25, 2019 · 8 comments
Open

Interruptions if I play two files at the same time on android 6.0 #61

marinat opened this issue Jul 25, 2019 · 8 comments

Comments

@marinat
Copy link

marinat commented Jul 25, 2019

If I play files one by one there are no problemsю But I need play it together.
On mac os and android 7.0 and higher all ok
Maybe I should create issue here https://github.com/hajimehoshi/oto?

code Example:

https://gist.github.com/marinat/f1f14b61b8cdb070c0d1be14f06e93bd

@marinat marinat changed the title Interruption if I play two files at the same time on android 6.0 Interruptions if I play two files at the same time on android 6.0 Jul 25, 2019
@marinat
Copy link
Author

marinat commented Jul 29, 2019

I just need to create another payer with same context

@marinat
Copy link
Author

marinat commented Aug 1, 2019

Sorry, but this not helped.
All ok if i do pure otomp3.NewDecoder(f)
If I use beep even with two players the issue still reproducing
@faiface

@marinat marinat reopened this Aug 1, 2019
@MarkKremer
Copy link
Contributor

The part that mixes the audio streams together is implemented here using a beep.Mixer. I think this is the right place for the issue.

A lot of times, interruptions are caused by the the speaker draining the streams quicker that they can supply data. I'm not sure if that is the case here. You could try changing the bufferSize of the speaker.

Some questions:

  1. Do the interruptions happen mid-stream? So [both clips playing] [both are interrupted] [both playing again] [both interrupted] [both playing again]... If not, what does happen instead?
  2. Does the clip continue playing from where it stopped after the interruption (as if someone paused it) or does it skip a bit (as if it got muted)?
  3. In the other issue you said the player wheezes. Is that still the case? Do you mean that it makes a wheezing sound?

@marinat
Copy link
Author

marinat commented Sep 11, 2019

I meant rather wheezing instead of interrupts. Only wheezing. I tried to change the bufferSize of the speaker, but this not helped. If you have the opportunity to reproduce it on android lower version 7 you can understand what I'm talking about.

@faiface
Copy link
Owner

faiface commented Oct 24, 2019

Hi, sorry for not responding earlier, I was taking a break.

Anyway, the code you provided will exit almost immediately after starting, because speaker.Play isn't blocking, it merely starts the playback of a streamer. Not sure what exactly causes your problem, but this immediately popped out to me.

@marinat
Copy link
Author

marinat commented Oct 24, 2019

I omitted details and did not show all code. So, do you have the opportunity to reproduce it on android lower version 7?

@faiface
Copy link
Owner

faiface commented Oct 24, 2019

No, unfortunately, I do not have such a phone available :/

@marinat
Copy link
Author

marinat commented Oct 24, 2019

Tomorrow I'll try to reproduce it on android emulator and will write about the results.

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