X-Git-Url: https://code.octet-stream.net/m17rt/blobdiff_plain/b3cb86656d6c820a70ceb5ea1a6d602999eb3c85..b0e7a62e7d8184888184ca9d11464611ed12a97c:/m17codec2/src/lib.rs?ds=inline diff --git a/m17codec2/src/lib.rs b/m17codec2/src/lib.rs index eb45f77..f09d2b8 100755 --- a/m17codec2/src/lib.rs +++ b/m17codec2/src/lib.rs @@ -1,9 +1,12 @@ use codec2::{Codec2, Codec2Mode}; - +use cpal::traits::DeviceTrait; +use cpal::traits::HostTrait; +use cpal::traits::StreamTrait; +use cpal::{Sample, SampleFormat, SampleRate}; +use log::debug; use m17app::adapter::StreamAdapter; use m17app::app::TxHandle; use m17core::protocol::LsfFrame; - use std::collections::VecDeque; use std::fs::File; use std::io::Write; @@ -13,13 +16,6 @@ use std::sync::{ Arc, Mutex, }; -use cpal::traits::DeviceTrait; -use cpal::traits::HostTrait; -use cpal::traits::StreamTrait; -use cpal::{Sample, SampleFormat, SampleRate}; - -use log::debug; - pub fn decode_codec2>(data: &[u8], out_path: P) -> Vec { let codec2 = Codec2::new(Codec2Mode::MODE_3200); let var_name = codec2; @@ -142,7 +138,12 @@ fn stream_thread(end: Receiver<()>, state: Arc>, output_card let stream = device .build_output_stream( &config.into(), - move |data: &mut [i16], _: &cpal::OutputCallbackInfo| { + move |data: &mut [i16], info: &cpal::OutputCallbackInfo| { + debug!( + "callback {:?} playback {:?}", + info.timestamp().callback, + info.timestamp().playback + ); output_cb(data, &state); }, |e| {