Skip to content

track->onMessage() does not trigger when add WebSockets #756

Discussion options

You must be logged in to vote

The track shared ptr is local to the create_peer_connection function, therefore the track will be closed when returning. You need to store it somewhere like for the peer connection.

Also, there seems to be a confusion between bitrate and sampling rate, setBitrate expects the target encoding bitrate in Kbit/s, while getUserMedia and the opus decoder expect the audio sampling rate in Hz. The bitrate should be way lower, as 64 Kbit/s is fine for speech and 128 kbit/s is fine for music.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@GrigorySamokhin
Comment options

Answer selected by GrigorySamokhin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants