use std::thread;
use resonator::{client::resonatorclient::ResonatorClient, common::audiobuffer::AudioBuffer, server::resonator::ResonatorServer};
use resonator::common::metadata::Metadata;
#[tokio::main]
pub async fn main() {
thread::sleep(std::time::Duration::from_millis(1000));
{
tokio::task::spawn_blocking(|| {
let mut client1 = ResonatorClient::new("https://resonator-server.onrender.com".to_string(), 1, "ABC".to_string(), None, None);
client1.begin();
});
}
thread::sleep(std::time::Duration::from_millis(1000));
{
tokio::task::spawn_blocking(|| {
let mut client2 = ResonatorClient::new("https://resonator-server.onrender.com".to_string(), 2, "ABC".to_string(), None, None);
client2.begin();
let test_metadata = Metadata {
sample_rate: 22050,
buffer_size: 2048
};
let test_buffer = AudioBuffer {
samples: vec![0.0; 2048],
metadata: test_metadata
};
client2.push_buffer(test_buffer.clone());
client2.push_buffer(test_buffer.clone());
client2.push_buffer(test_buffer.clone());
client2.push_buffer(test_buffer.clone());
});
}
loop {}
}