Skip to content

Commit f16d3f9

Browse files
authored
Fix build with cpal feature disabled (#5)
1 parent f4e597b commit f16d3f9

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/error.rs

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ pub enum KaError {
2929
#[error("failed to get default track as no tracks are present")]
3030
NoTracksArePresent,
3131
#[error("failed to get cpal device name: {0}")]
32+
#[cfg(feature = "cpal")]
3233
DeviceNameError(#[from] cpal::DeviceNameError),
3334

3435
// [`Sound`] errors

src/renderer.rs

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ pub trait Renderer: Clone + Send + 'static {
1111
fn next_frame(&mut self, sample_rate: u32) -> Frame;
1212

1313
/// This gets called when an audio buffer is done processing.
14+
#[cfg(feature = "cpal")]
1415
fn on_buffer<T>(&mut self, _buffer: &mut [T])
1516
where
1617
T: cpal::SizedSample + cpal::FromSample<f32>,
@@ -60,6 +61,7 @@ impl Renderer for DefaultRenderer {
6061
out
6162
}
6263

64+
#[cfg(feature = "cpal")]
6365
fn on_buffer<T>(&mut self, buffer: &mut [T])
6466
where
6567
T: cpal::SizedSample + cpal::FromSample<f32>,

0 commit comments

Comments
 (0)