opentok / opentok-android-sdk-samples

Sample applications illustrating best practices using OpenTok Android SDK.
https://tokbox.com/developer/sdks/android/
MIT License
211 stars 169 forks source link

Playing sound problem when the video call has started #137

Closed sergiocarabantes closed 7 years ago

sergiocarabantes commented 7 years ago

Hi, I am trying to play a sound before the session has been connected but when it is connected and when I do session.subscribe(subscriber); inside of onStreamReceivedmethod, the sound stops unexpectedly. I am initializing the subscriber like this:

Subscriber subscriber = new Subscriber.Builder(context, stream).build(); subscriber.getRenderer().setStyle(BaseVideoRenderer.STYLE_VIDEO_SCALE, BaseVideoRenderer.STYLE_VIDEO_FILL); subscriber.setSubscribeToAudio(false); session.subscribe(subscriber);

Even disabling the audio from the subscriber setSubscribeToAudio(false) still the sounds stops. When the session has been finished, the sound starts playing again.

For some reasons, we need to play the sound even when the session is connected but I don't know why this problem is happening, do you have any idea? Thanks a lot.

marinaserranomontes commented 7 years ago

Hi Sergio,

Have you taken a look to the Custom Audio Driver sample? I think you will have to take over the audio driver in order to coordinate playing sounds and communication mode.

https://github.com/opentok/opentok-android-sdk-samples/blob/master/Custom-Audio-Driver/app/src/main/java/com/tokbox/android/tutorials/custom_audio_driver/CustomAudioDevice.java

marinaserranomontes commented 7 years ago

I’m closing this issue because it has been inactive for a few weeks. This probably means that it is not reproducible or it has been fixed.

Please reopen if you still encounter this issue You can also contribute directly by providing a patch.

Thank you!