commit
35d9201b85
|
@ -21,5 +21,5 @@ kernel32-sys = "0.2"
|
||||||
[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd"))'.dependencies]
|
[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd"))'.dependencies]
|
||||||
alsa-sys = { version = "0.1", path = "alsa-sys" }
|
alsa-sys = { version = "0.1", path = "alsa-sys" }
|
||||||
|
|
||||||
[target.'cfg(target_os = "macos")'.dependencies]
|
[target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies]
|
||||||
coreaudio-rs = "0.6"
|
coreaudio-rs = "0.7.0"
|
||||||
|
|
|
@ -157,7 +157,14 @@ impl Voice {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let au_type = coreaudio::audio_unit::IOType::DefaultOutput;
|
let au_type = if cfg!(target_os = "ios") {
|
||||||
|
// The DefaultOutput unit isn't available in iOS unfortunately. RemoteIO is a sensible replacement.
|
||||||
|
// See
|
||||||
|
// https://developer.apple.com/library/content/documentation/MusicAudio/Conceptual/AudioUnitHostingGuide_iOS/UsingSpecificAudioUnits/UsingSpecificAudioUnits.html
|
||||||
|
coreaudio::audio_unit::IOType::RemoteIO
|
||||||
|
} else {
|
||||||
|
coreaudio::audio_unit::IOType::DefaultOutput
|
||||||
|
};
|
||||||
let mut audio_unit = try!(AudioUnit::new(au_type).map_err(convert_error));
|
let mut audio_unit = try!(AudioUnit::new(au_type).map_err(convert_error));
|
||||||
|
|
||||||
// TODO: iOS uses integer and fixed-point data
|
// TODO: iOS uses integer and fixed-point data
|
||||||
|
|
|
@ -76,7 +76,7 @@ extern crate libc;
|
||||||
|
|
||||||
pub use samples_formats::{SampleFormat, Sample};
|
pub use samples_formats::{SampleFormat, Sample};
|
||||||
|
|
||||||
#[cfg(all(not(windows), not(target_os = "linux"), not(target_os = "freebsd"), not(target_os = "macos")))]
|
#[cfg(all(not(windows), not(target_os = "linux"), not(target_os = "freebsd"), not(target_os = "macos"), not(target_os = "ios")))]
|
||||||
use null as cpal_impl;
|
use null as cpal_impl;
|
||||||
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
@ -97,7 +97,7 @@ mod cpal_impl;
|
||||||
#[path="wasapi/mod.rs"]
|
#[path="wasapi/mod.rs"]
|
||||||
mod cpal_impl;
|
mod cpal_impl;
|
||||||
|
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(any(target_os = "macos", target_os = "ios"))]
|
||||||
#[path="coreaudio/mod.rs"]
|
#[path="coreaudio/mod.rs"]
|
||||||
mod cpal_impl;
|
mod cpal_impl;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue