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
- Implement format handling for macos `build_voice` method.
# Version 0.6.0 (2017-12-11)
- Changed the emscripten backend to consume less CPU.

View File

@ -148,11 +148,11 @@ impl EventLoop {
_ => kAudioFormatFlagIsPacked as u32,
};
let asbd = AudioStreamBasicDescription {
mBitsPerChannel: bits_per_channel,
mBytesPerFrame: bytes_per_frame,
mChannelsPerFrame: n_channels,
mBytesPerPacket: bytes_per_packet,
mFramesPerPacket: frames_per_packet,
mBitsPerChannel: bits_per_channel as _,
mBytesPerFrame: bytes_per_frame as _,
mChannelsPerFrame: n_channels as _,
mBytesPerPacket: bytes_per_packet as _,
mFramesPerPacket: frames_per_packet as _,
mFormatFlags: format_flags,
mFormatID: kAudioFormatLinearPCM,
mSampleRate: sample_rate as _,
@ -191,7 +191,7 @@ impl EventLoop {
// A small macro to simplify handling the callback for different sample types.
macro_rules! try_callback {
($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 callback = match callbacks.get_mut(0) {
Some(cb) => cb,
@ -211,7 +211,7 @@ impl EventLoop {
match sample_format {
SampleFormat::F32 => try_callback!(F32, f32, 0.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(())