beep icon indicating copy to clipboard operation
beep copied to clipboard

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

Open marinat opened this issue 4 years ago • 8 comments

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 avatar Jul 25 '19 12:07 marinat

I just need to create another payer with same context

marinat avatar Jul 29 '19 13:07 marinat

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 avatar Aug 01 '19 08:08 marinat

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?

MarkKremer avatar Sep 10 '19 10:09 MarkKremer

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.

marinat avatar Sep 11 '19 09:09 marinat

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.

faiface avatar Oct 24 '19 17:10 faiface

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

marinat avatar Oct 24 '19 17:10 marinat

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

faiface avatar Oct 24 '19 17:10 faiface

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

marinat avatar Oct 24 '19 17:10 marinat