From 95022fa874aeeb8abac22506124cec79d0ffdc85 Mon Sep 17 00:00:00 2001 From: Nicolas Franco Gomez <80042895+nico-franco-gomez@users.noreply.github.com> Date: Wed, 13 Nov 2024 17:33:17 +0100 Subject: [PATCH] added i24 to examples --- examples/android.rs | 4 ++-- examples/beep.rs | 4 ++-- examples/synth_tones.rs | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/examples/android.rs b/examples/android.rs index b58731dbf..beb46acb1 100644 --- a/examples/android.rs +++ b/examples/android.rs @@ -5,7 +5,7 @@ extern crate cpal; use cpal::{ traits::{DeviceTrait, HostTrait, StreamTrait}, - SizedSample, + SizedSample, I24, }; use cpal::{FromSample, Sample}; @@ -22,7 +22,7 @@ fn main() { match config.sample_format() { cpal::SampleFormat::I8 => run::(&device, &config.into()).unwrap(), cpal::SampleFormat::I16 => run::(&device, &config.into()).unwrap(), - // cpal::SampleFormat::I24 => run::(&device, &config.into()).unwrap(), + cpal::SampleFormat::I24 => run::(&device, &config.into()).unwrap(), cpal::SampleFormat::I32 => run::(&device, &config.into()).unwrap(), // cpal::SampleFormat::I48 => run::(&device, &config.into()).unwrap(), cpal::SampleFormat::I64 => run::(&device, &config.into()).unwrap(), diff --git a/examples/beep.rs b/examples/beep.rs index 7d3b23d88..fb1ff45a3 100644 --- a/examples/beep.rs +++ b/examples/beep.rs @@ -1,7 +1,7 @@ use clap::Parser; use cpal::{ traits::{DeviceTrait, HostTrait, StreamTrait}, - FromSample, Sample, SizedSample, + FromSample, Sample, SizedSample, I24, }; #[derive(Parser, Debug)] @@ -78,7 +78,7 @@ fn main() -> anyhow::Result<()> { match config.sample_format() { cpal::SampleFormat::I8 => run::(&device, &config.into()), cpal::SampleFormat::I16 => run::(&device, &config.into()), - // cpal::SampleFormat::I24 => run::(&device, &config.into()), + cpal::SampleFormat::I24 => run::(&device, &config.into()), cpal::SampleFormat::I32 => run::(&device, &config.into()), // cpal::SampleFormat::I48 => run::(&device, &config.into()), cpal::SampleFormat::I64 => run::(&device, &config.into()), diff --git a/examples/synth_tones.rs b/examples/synth_tones.rs index c83f816d9..fedfdb808 100644 --- a/examples/synth_tones.rs +++ b/examples/synth_tones.rs @@ -8,7 +8,7 @@ extern crate cpal; use cpal::{ traits::{DeviceTrait, HostTrait, StreamTrait}, - SizedSample, + SizedSample, I24, }; use cpal::{FromSample, Sample}; @@ -98,6 +98,7 @@ where match config.sample_format() { cpal::SampleFormat::I8 => make_stream::(&device, &config.into()), cpal::SampleFormat::I16 => make_stream::(&device, &config.into()), + cpal::SampleFormat::I24 => make_stream::(&device, &config.into()), cpal::SampleFormat::I32 => make_stream::(&device, &config.into()), cpal::SampleFormat::I64 => make_stream::(&device, &config.into()), cpal::SampleFormat::U8 => make_stream::(&device, &config.into()),