you can change the volume according to the volume of resources, see below code
NSString* resourcePath = url;
NSData *_objectData = [NSData dataWithContentsOfURL:[NSURL URLWithString:resourcePath]];
AVAudioPlayer *audioPlayer = [[AVAudioPlayer alloc] initWithData:_objectData error:&error];
audioPlayer.numberOfLoops = 0;
audioPlayer.volume = 5.0f;
[audioPlayer prepareToPlay];
source
share