Skip to main content

moq_encode_audio

Function moq_encode_audio 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn moq_encode_audio( broadcast: u32, name: *const c_char, name_len: usize, input: *const moq_audio_encoder_input, output: *const moq_audio_encoder_output, bandwidth: u32, ) -> i32
Expand description

Open an audio track on a broadcast.

The encoder configuration is fixed at construction; subsequent frame writes pass only payload + timestamp via moq_encode_audio_frame.

Returns a non-zero handle on success or a negative error code.

ยงSafety

  • name must point to name_len bytes of UTF-8.
  • input / output must point to fully populated structs.
  • output->codec must point to output->codec_len bytes of UTF-8.
  • bandwidth is a handle from crate::moq_session_bandwidth, or 0 to leave the configured bitrate unclaimed.