This repository has been archived by the owner on Jan 18, 2023. It is now read-only.
forked from msach22/cordova-plugin-opentok
-
Notifications
You must be signed in to change notification settings - Fork 78
audioLevelUpdated not working on more the 2 subscribers #159
Comments
@Shtibel Thanks for filing the issue. Can you please share which platform this is happening for? iOS, Android, or both? |
@Shtibel Just following up on this. Can you please share the code that you're using when setting these event listeners? Are you overriding the subscriber or do you have a collection of subscribers with these event listeners set? |
Hi @msach22 |
Yes, there is an issue. I have tested this on iOS and this is what I think the problem is. When there are more the 1 subscribers, the audioLevelUpdated handler for the last connected subscriber is always called even though the audio is coming from the first connected subscriber. this.subscriber.off('audioLevelUpdated').on('audioLevelUpdated', (event) => { if (movingAvg === null || movingAvg <= event.audioLevel) { movingAvg = event.audioLevel; } else { movingAvg = 0.7 * movingAvg + 0.3 * event.audioLevel; } // 1.5 scaling to map the -30 - 0 dBm range to [0,1] let logLevel = (Math.log(movingAvg) / Math.LN10) / 1.5 + 1; logLevel = Math.min(Math.max(logLevel, 0), 1); if (logLevel > 0.1) { console.log(event) this.speaking.emit(this.streamIndex); } else { } }); When checking the logs, we see the stream details of the last connected subscriber. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
bug report
Current behavior
If there is 1 publisher and 1 subscriber the audioLevelUpdated event works, But when a new user subscribes to the session it stops working.
Steps to reproduce
Create a session publish a video and audio from a device.
Then subscribe to the session from a second device with: insertMode: 'append'.
Start the audioLevelUpdated event and listen to the publisher and console.log it, see that the event is working 60 times a second with: insertMode: 'append'.
Then subscribe to the session from a third device, see that the console.log stops working on second device and it is not working on third device with: insertMode: 'append',
Example Project
We tested it with the: opentok-ionic-samples
What is the current bug behavior?
The audioLevelUpdated event stops working, no errors just stops working.
What is the expected correct behavior?
audioLevelUpdated event must continue working even if there is more than one subscriber.
Relevant logs and/or screenshots
![imgpsh_fullsize_anim](https://user-images.githubusercontent.com/24429607/52950290-5e777780-3387-11e9-9851-b927c8a03bc4.png)
See attached screenshot of the console.log
Hi @msach22,
We have a major problem with audioLevelUpdated.
On 1 on 1 session with 1 publisher and 1 subscriber the audioLevelUpdated event is working.
But when a new user joins the session the audioLevelUpdated stops working.
As we see on this issue: 140
You fixed the problem but now when we test it it is not working.
We try to work with the 3.4.2 version and the 3.4.3 version and it is not working.
We tested it with the opentok-ionic-samples code and it is not working.
Please can you test to see what is the problem?
Thank you!
The text was updated successfully, but these errors were encountered: