Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

AVAudioPlayer volume not working

maharshakmaharshak some where over the rainbowPosts: 295New Users @ @
I want to change that some sounds will be in different volumes, but "setVolume" dosn't make any change


NSString *soundFilePath = [[NSBundle mainBundle] pathForResource:@sound ofType:@mp3];

// Converts the sound's file path to an NSURL object
NSURL *soundURL = [[NSURL alloc] initFileURLWithPath: soundFilePath];

_player =[[AVAudioPlayer alloc] initWithContentsOfURL: soundURL error:nil];

[_player prepareToPlay];
[_player setNumberOfLoops:0];
[_player setVolume: 0.1f];
[_player setDelegate: self];

the sound are playing on full volume

Sign In or Register to comment.