Skip to content

Commit b1fcf7b

Browse files
committed
Microphone implements FixedSource
1 parent f41bc47 commit b1fcf7b

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

src/microphone.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,21 @@ impl Source for Microphone {
202202
}
203203
}
204204

205+
#[cfg(feature = "experimental")]
206+
impl crate::FixedSource for Microphone {
207+
fn channels(&self) -> crate::ChannelCount {
208+
self.config.channel_count
209+
}
210+
211+
fn sample_rate(&self) -> crate::SampleRate {
212+
self.config.sample_rate
213+
}
214+
215+
fn total_duration(&self) -> Option<std::time::Duration> {
216+
None
217+
}
218+
}
219+
205220
impl Iterator for Microphone {
206221
type Item = Sample;
207222

0 commit comments

Comments
 (0)