From 12311ad384cd494bbab1a4ffb0b8699f28569e1b Mon Sep 17 00:00:00 2001 From: Michael L Dickens Date: Thu, 16 Feb 2012 11:57:22 -0500 Subject: small tweaks to get stream sizes "more correct" --- gr-audio/lib/osx/audio_osx_source.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'gr-audio/lib/osx/audio_osx_source.cc') diff --git a/gr-audio/lib/osx/audio_osx_source.cc b/gr-audio/lib/osx/audio_osx_source.cc index a6dd81908..6c5609d20 100644 --- a/gr-audio/lib/osx/audio_osx_source.cc +++ b/gr-audio/lib/osx/audio_osx_source.cc @@ -319,7 +319,6 @@ audio_osx_source::audio_osx_source (int sample_rate, d_deviceSampleRate = asbd_device.mSampleRate; d_n_deviceChannels = asbd_device.mChannelsPerFrame; - asbd_client.mChannelsPerFrame = d_n_deviceChannels; asbd_client.mSampleRate = asbd_device.mSampleRate; asbd_client.mFormatID = kAudioFormatLinearPCM; asbd_client.mFormatFlags = (kAudioFormatFlagIsFloat | @@ -329,9 +328,10 @@ audio_osx_source::audio_osx_source (int sample_rate, (d_n_deviceChannels == 1)) { asbd_client.mFormatFlags &= ~kLinearPCMFormatFlagIsNonInterleaved; } - asbd_client.mBitsPerChannel = 32; - asbd_client.mBytesPerFrame = asbd_client.mBitsPerChannel / 8; + asbd_client.mBytesPerFrame = sizeof (float); asbd_client.mFramesPerPacket = 1; + asbd_client.mBitsPerChannel = asbd_client.mBytesPerFrame * 8; + asbd_client.mChannelsPerFrame = d_n_deviceChannels; asbd_client.mBytesPerPacket = asbd_client.mBytesPerFrame; propertySize = sizeof(AudioStreamBasicDescription); @@ -352,11 +352,11 @@ audio_osx_source::audio_osx_source (int sample_rate, GR_PCM_ENDIANNESS | kLinearPCMFormatFlagIsPacked | kAudioFormatFlagIsNonInterleaved); - asbd_user.mBytesPerPacket = 4; + asbd_user.mBytesPerPacket = sizeof (float); asbd_user.mFramesPerPacket = 1; - asbd_user.mBytesPerFrame = 4; - asbd_user.mChannelsPerFrame = d_n_max_channels; - asbd_user.mBitsPerChannel = 32; + asbd_user.mBytesPerFrame = asbd_user.mBytesPerPacket; + asbd_user.mChannelsPerFrame = d_n_deviceChannels; + asbd_user.mBitsPerChannel = asbd_user.mBytesPerPacket * 8; if (d_deviceSampleRate == d_outputSampleRate) { // no need to do conversion if asbd_client matches user wants -- cgit