fix stereo for chormium browsers.

This commit is contained in:
Miroslav Šedivý 2023-01-12 20:53:36 +01:00
parent 1509521129
commit ccc1df936d
3 changed files with 6 additions and 1 deletions

View File

@ -286,6 +286,10 @@ export abstract class BaseClient extends EventEmitter<BaseEvents> {
try {
const d = await this._peer.createAnswer()
// add stereo=1 to answer sdp to enable stereo audio for chromium
d.sdp = d.sdp?.replace(/(stereo=1;)?useinbandfec=1/, 'useinbandfec=1;stereo=1')
this._peer!.setLocalDescription(d)
this._ws!.send(

View File

@ -4,6 +4,7 @@
### Bugs
- Fixed TCP mux occasional freeze by adding write buffer to it.
- Fixed stereo problem in chromium-based browsers, where it was only as mono by adding `stereo=1` to opus SDP to clients answer.
## [n.eko v2.7](https://github.com/m1k1o/neko/releases/tag/v2.7)

View File

@ -118,7 +118,7 @@ func Opus() RTPCodec {
MimeType: webrtc.MimeTypeOpus,
ClockRate: 48000,
Channels: 2,
SDPFmtpLine: "useinbandfec=1",
SDPFmtpLine: "useinbandfec=1;stereo=1",
RTCPFeedback: []webrtc.RTCPFeedback{},
},
}