teamtalk 6.0.0

TeamTalk SDK for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use teamtalk::{
    RecordingSampleFormat, SilencePolicy, SyncedUserRecordingOptions, SyncedUserRecordingSession,
};

fn main() -> teamtalk::Result<()> {
    let client = teamtalk::Client::new()?;
    let options = SyncedUserRecordingOptions::new("recordings/users")
        .with_format(RecordingSampleFormat::PcmS16Le)
        .with_silence_policy(SilencePolicy::Always);
    let mut recorder = SyncedUserRecordingSession::start(&client, options)?;

    loop {
        if let Some((event, message)) = client.poll(50) {
            recorder.handle_event(&client, event, &message)?;
        }
        recorder.tick()?;
    }
}