Ilya Suzdalnitski
Ilya Suzdalnitski

Reputation: 53560

iPhone: Increase volume

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

Answers (3)

Xavi
Xavi

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

Gordon Childs
Gordon Childs

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

RaYell
RaYell

Reputation: 70444

You have a volume property for that. If even at it's highest setting the volume is still too low, I think you should edit the media file in some kind of music editor (i.e. Audacity) and increase the volume there.

Upvotes: 2

Related Questions