Update changelog

This commit is contained in:
mitchmindtree 2018-01-24 21:34:18 +11:00
parent dcb7dea028
commit 45f2f1b371
2 changed files with 9 additions and 7 deletions

View File

@ -1,5 +1,7 @@
# Unreleased # Unreleased
- Implement format handling for macos `build_voice` method.
# Version 0.6.0 (2017-12-11) # Version 0.6.0 (2017-12-11)
- Changed the emscripten backend to consume less CPU. - Changed the emscripten backend to consume less CPU.

View File

@ -148,11 +148,11 @@ impl EventLoop {
_ => kAudioFormatFlagIsPacked as u32, _ => kAudioFormatFlagIsPacked as u32,
}; };
let asbd = AudioStreamBasicDescription { let asbd = AudioStreamBasicDescription {
mBitsPerChannel: bits_per_channel, mBitsPerChannel: bits_per_channel as _,
mBytesPerFrame: bytes_per_frame, mBytesPerFrame: bytes_per_frame as _,
mChannelsPerFrame: n_channels, mChannelsPerFrame: n_channels as _,
mBytesPerPacket: bytes_per_packet, mBytesPerPacket: bytes_per_packet as _,
mFramesPerPacket: frames_per_packet, mFramesPerPacket: frames_per_packet as _,
mFormatFlags: format_flags, mFormatFlags: format_flags,
mFormatID: kAudioFormatLinearPCM, mFormatID: kAudioFormatLinearPCM,
mSampleRate: sample_rate as _, mSampleRate: sample_rate as _,
@ -191,7 +191,7 @@ impl EventLoop {
// A small macro to simplify handling the callback for different sample types. // A small macro to simplify handling the callback for different sample types.
macro_rules! try_callback { macro_rules! try_callback {
($SampleFormat:ident, $SampleType:ty, $equilibrium:expr) => {{ ($SampleFormat:ident, $SampleType:ty, $equilibrium:expr) => {{
let data_len = (data_byte_size / bytes_per_channel) as usize; let data_len = (data_byte_size as usize / bytes_per_channel) as usize;
let data_slice = slice::from_raw_parts_mut(data as *mut $SampleType, data_len); let data_slice = slice::from_raw_parts_mut(data as *mut $SampleType, data_len);
let callback = match callbacks.get_mut(0) { let callback = match callbacks.get_mut(0) {
Some(cb) => cb, Some(cb) => cb,
@ -211,7 +211,7 @@ impl EventLoop {
match sample_format { match sample_format {
SampleFormat::F32 => try_callback!(F32, f32, 0.0), SampleFormat::F32 => try_callback!(F32, f32, 0.0),
SampleFormat::I16 => try_callback!(I16, i16, 0), SampleFormat::I16 => try_callback!(I16, i16, 0),
SampleFormat::U16 => try_callback!(U16, u16, ::std::u16::consts::MAX / 2), SampleFormat::U16 => try_callback!(U16, u16, ::std::u16::MAX / 2),
} }
Ok(()) Ok(())