Skip to content

[BUG] SDK audio defaults differ from WebSocket protocol defaults #92

@MaxMansfield

Description

@MaxMansfield

Bug Description

The SDK uses different default audio parameters than the raw RTMS WebSocket protocol. While the SDK defaults provide better quality (OPUS, 48kHz, Stereo, AUDIO_MULTI_STREAMS), this can cause confusion when users expect the WebSocket defaults.

Parameter SDK Default WebSocket Default
Codec OPUS (4) L16 (1)
Sample Rate 48kHz (3) 16kHz (1)
Channel Stereo (2) Mono (1)
Data Option AUDIO_MULTI_STREAMS (2) AUDIO_MIXED_STREAM (1)
Duration 20ms 20ms
Frame Size 960 320

Proposed Solution for v2.0

Align SDK defaults with WebSocket protocol defaults for consistency:

  • Codec: L16 (1)
  • Sample Rate: 16kHz (1)
  • Channel: Mono (1)
  • Data Option: AUDIO_MIXED_STREAM (1)
  • Frame Size: 320

Users who want the current SDK defaults (higher quality, per-speaker attribution) would need to explicitly configure them.

Workaround (v1.x)

Users can configure audio params to match WebSocket defaults:

client.setAudioParams({
    contentType: rtms.AudioContentType.RAW_AUDIO,
    codec: rtms.AudioCodec.L16,
    sampleRate: rtms.AudioSampleRate.SR_16K,
    channel: rtms.AudioChannel.MONO,
    dataOpt: rtms.AudioDataOption.AUDIO_MIXED_STREAM,
    duration: 20,
    frameSize: 320
});

Language/Runtime

Node.js and Python

SDK Version

1.0.x

Additional Context

This is documented in the SDK documentation with examples for both configurations.

Verification

  • I've searched existing issues to ensure this bug hasn't already been reported
  • I've verified this bug still exists in the latest version of the SDK
  • I've included all necessary information to reproduce this issue

Metadata

Metadata

Assignees

Labels

breaking changeIntroduces a new APIbugSomething isn't working

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions