Support i32 for asio (#737)
This commit is contained in:
parent
7776c6634a
commit
90471506b1
2 changed files with 3 additions and 8 deletions
|
|
@ -209,13 +209,8 @@ pub(crate) fn convert_data_type(ty: &sys::AsioSampleType) -> Option<SampleFormat
|
|||
sys::AsioSampleType::ASIOSTInt16LSB => SampleFormat::I16,
|
||||
sys::AsioSampleType::ASIOSTFloat32MSB => SampleFormat::F32,
|
||||
sys::AsioSampleType::ASIOSTFloat32LSB => SampleFormat::F32,
|
||||
// NOTE: While ASIO does not support these formats directly, the stream callback created by
|
||||
// CPAL supports converting back and forth between the following. This is because many ASIO
|
||||
// drivers only support `Int32` formats, while CPAL does not support this format at all. We
|
||||
// allow for this implicit conversion temporarily until CPAL gets support for an `I32`
|
||||
// format.
|
||||
sys::AsioSampleType::ASIOSTInt32MSB => SampleFormat::I16,
|
||||
sys::AsioSampleType::ASIOSTInt32LSB => SampleFormat::I16,
|
||||
sys::AsioSampleType::ASIOSTInt32MSB => SampleFormat::I32,
|
||||
sys::AsioSampleType::ASIOSTInt32LSB => SampleFormat::I32,
|
||||
_ => return None,
|
||||
};
|
||||
Some(fmt)
|
||||
|
|
|
|||
|
|
@ -605,7 +605,7 @@ fn check_config(
|
|||
}
|
||||
// unsigned formats are not supported by asio
|
||||
match sample_format {
|
||||
SampleFormat::I16 | SampleFormat::F32 => (),
|
||||
SampleFormat::I16 | SampleFormat::I32 | SampleFormat::F32 => (),
|
||||
_ => return Err(BuildStreamError::StreamConfigNotSupported),
|
||||
}
|
||||
if *channels > num_asio_channels {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue