Skip to content

Commit

Permalink
Add feature flag "audio" for impl Playable for HasFrequency
Browse files Browse the repository at this point in the history
  • Loading branch information
barafael committed Jun 10, 2023
1 parent db47c62 commit 8318d99
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/core/pitch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ use std::time::Duration;

use once_cell::sync::Lazy;

use super::{
base::{Playable, PlaybackHandle, Res},
helpers::mel,
};
use super::helpers::mel;

#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -40,6 +37,10 @@ pub trait HasMel: HasFrequency {
}
}

#[cfg(feature = "audio")]
use super::base::{Playable, PlaybackHandle, Res};

#[cfg(feature = "audio")]
impl<T: HasFrequency> Playable for T {
fn play(&self, delay: Duration, length: Duration, fade_in: Duration) -> Res<PlaybackHandle> {
use rodio::{source::SineWave, OutputStream, Sink, Source};
Expand Down

0 comments on commit 8318d99

Please sign in to comment.