Reputation: 53560
I have got an audio file which is quite quiet.
I'm playing it using AVAudioPlayer
, but I can barely hear anything, especially without headphones.
Is there a way to increase the volume of an audio record?
Upvotes: 0
Views: 913
Reputation: 46
Maybe, you can use SpeakHere Apple Sample, as I did. To increase audio volume on this sample you need to set Player to Speaker Mode.
Add this code in AQPlayer.mm:
OSStatus error;
UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_Speaker;
error = AudioSessionSetProperty (kAudioSessionProperty_OverrideAudioRoute, sizeof (audioRouteOverride), &audioRouteOverride);
if (error) printf("couldn't set audio speaker!");
Before this code:
XThrowIfError (AudioQueueSetParameter(mQueue, kAudioQueueParam_Volume, 1.0), "set queue volume");
Maybe it's to late but, I hope it helps.
Upvotes: 0
Reputation: 36169
player.volume = 2.0;
The doco says that volume is "nominally" between 0 and 1.0,
which seems to suggest that you can overdrive it.
Good luck, and try not to accidentally deafen users.
Upvotes: 1