Expand description
Voice-session and media building blocks without devices or persistence.
Native call sessions consume the protocol crate’s codecs and authenticated transport. Hosts supply account authority and operation journals. This crate does not open microphone/speaker devices or persist account credentials. Without default features, portable PCM, queue, pacing and mixing utilities remain available without the protocol or native codec dependencies.
§Feature selection
- Default
native-runtime: native session/media integration, protocol and Opus. native-opusalone: codec and portable utilities, without protocol.- No default features: portable utilities, including WebAssembly support.
Native modules are only available outside WebAssembly. The host supplies execution; no Tokio runtime is created. The high-level account-bound calling service is not part of this release. Use the daemon Calls API for complete dial/join/invite/leave operations; see the crate README for integration limits.
§Mix one source on a shared sample clock
use wechat_calls::{audio::{AudioFormat, AudioFrame}, mixer::PcmMixer};
let format = AudioFormat::new(16000, 1, 20)?;
let mut mixer = PcmMixer::new(format, 2, 3, 0)?;
mixer.add_track(7, 1)?;
mixer.push(7, AudioFrame {
generation: 1, sequence: 0, timestamp: 0,
samples: vec![1000; format.samples_per_frame()],
})?;
assert_eq!(mixer.render(0)?.samples, vec![1000; 320]);Modules§
- audio
- Owned PCM and codec interfaces shared by native and hosted implementations.
- conference_
media - Authenticated conference source decoding. Devices, sockets and persistence belong to the embedding runtime; no packet can announce its own participant.
- conference_
send - One paced conference uplink. Application interruption never resets crypto counters or the presentation clock. Missing application audio becomes silence.
- mixer
- PCM mixing on a shared presentation clock. This module owns no timer or device: the consumer supplies the due sample offset after its alignment delay.
- opus
- Optional native libopus implementation of the portable audio interfaces.
- ordering
- Drop-late ordering for authenticated ordinary95 audio primaries.
- pcm_
output - Generation-scoped PCM chunk admission and framing, independent of sockets.
- playout
- Queue and pacing policy without a timer or executor dependency.
- tone
- Synthetic pulsed PCM for an operator-approved audio check.
- track_
queue - Independent audio budgets with ordered, non-droppable track controls. The host supplies synchronization and wakeups; this queue opens no runtime.