Skip to content

Notes on two-way-audio streamer #72

@amigniter

Description

@amigniter

Notes on using Two-Way audio feature (bi-directional streaming) :

Raw binary stream

  • When streaming raw binary data over WebSocket, ensure the sample rate matches the module's requirements.
  • No additional configuration is needed beyond proper sample rate settings.

JSON base64 encoded stream

The module automatically handles all necessary processing, including buffering, queuing, resampling (up or down), and transcoding to match the streaming channel.

The streaming channel can use any codec supported by FreeSWITCH. During playback, the module will automatically transcode the audio to match the channel's codec. Transcoding time is measured in microseconds, ensuring extremely fast processing for smooth real-time playback. In addition to ultra-fast transcoding, the module further optimizes performance when the returned audio is in G.711 format.

  • Since G.711 is the most commonly used codec (the module accepts raw, PCMU, and PCMA), if the returned audio is in PCMU or PCMA format, the module optimizes processing by skipping both resampling and transcoding, playing it back directly.
  • You can be sure this optimization will be applied if the channel uses PCMU or PCMA and you return the audio in the same format.
  • If returning audio in PCMU or PCMA isn’t possible, the audio should be returned in RAW format.
  • If the channel uses a codec other than PCMU or PCMA and you return audio in PCMU/PCMA, there won’t be any crashes or anything like that, but the audio won’t be played back. There’s no real reason to return PCMU/PCMA in such case, so it’s best to avoid it for proper playback and simply return the RAW format instead.

Thank you for using the module! We hope this information helps you optimize your setup for smooth playback. If you have any questions or need further assistance, feel free to reach out.

Happy streaming!

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions