Re: Increasing audio volume from Bluetooth SCO device
Re: Increasing audio volume from Bluetooth SCO device
- Subject: Re: Increasing audio volume from Bluetooth SCO device
- From: Jeff Moore <email@hidden>
- Date: Thu, 24 Jun 2010 22:24:11 -0700
kAudioDevicePropertyVolumeScalar is the way to adjust the hardware volume and it sounds like you've set it to the maximum. So, software volume is what's left. That said, you can also use dynamics processing. There are AudioUnits on the system that implement a compressor/limiter and a multi-band compressor.
--
Jeff Moore
Core Audio
Apple
On Jun 24, 2010, at 9:35 PM, Peter Sichel wrote:
> I'm using an IOBluetoothSCOAudioDevice along with CAPlayThrough to route audio from/to a Bluetooth cell phone to create a handsfree speaker phone on the Mac. While some cell phones provide ample audio via the SCO connection, the 2G iPhone I'm testing with is too quiet for comfortable listening even with the Built-in Output set to maximum, so I'm looking for a simple way to increase the audio level from an IOBluetoothSCOAudioDevice.
>
> I've tried using AudioDeviceSetProperty to adjust the kAudioDevicePropertyVolumeScalar, but the master volume (channel 0) is already initialized to its maximum level. Values below 1.0 reduce the volume, while values above 1.0 are ignored.
>
> I've tried configuring the audio drivers volume control, but again, it appears to already be set to maximum.
>
> [controlDict setObject: [NSNumber numberWithUnsignedInt: 65535] forKey:[NSString stringWithUTF8String: kIOAudioControlValueKey]];
>
> [controlDict setObject: [NSNumber numberWithUnsignedInt: 0] forKey:[NSString stringWithUTF8String: kIOAudioLevelControlMinValueKey]];
> [controlDict setObject: [NSNumber numberWithUnsignedInt: 65535] forKey:[NSString stringWithUTF8String: kIOAudioLevelControlMaxValueKey]];
> [controlDict setObject: [NSNumber numberWithUnsignedInt: ((-22 << 16) + (32768))] forKey:[NSString stringWithUTF8String: kIOAudioLevelControlMinDBKey]];
> [controlDict setObject: [NSNumber numberWithUnsignedInt: 0] forKey:[NSString stringWithUTF8String: kIOAudioLevelControlMaxDBKey]];
>
> The other solution I can think of is to modify CAPlayThrough::OutputProc to call an "Adjust Audio Level" function that would multiply each sample in each buffer.
>
> float mAudioLevel;
>
> setAudioLevel(float inLevel) { mAudioLevel = inLevel; }
>
> ...
> inline void AdjustAudioLevel (AudioBufferList * ioData)
> {
> for(UInt32 i=0; i<ioData->mNumberBuffers;i++) {
> UInt32 count = ioData->mBuffers[i].mDataByteSize;
> for(UIn32 j=0; j<count; j++) {
> ioData->mBuffers[i].mData[j] *= mAudioLevel;
> }
> }
> }
>
>
> Being new to Core Audio, I'm wondering if there is an easier solution I'm missing?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden