title: AVAudioPlayer volume is low (How to set volume from speaker)
body: <p>I use AVAudioPlayer for playing sounds but when playing, the sound volume is very low.</p>
  
  <p>I done a search and found many codes about adding session property or session category but I'm wondering how to use it. </p>
  
  <pre><code>-(void) playVoice: (NSString *) path
  {
      if([path isEqualToString:@""] == NO)
      {
          //Initialize the AVAudioPlayer.
          NSData *soundData= [NSData dataWithContentsOfFile:path];
          NSError *error;
          audioPlayer= [[AVAudioPlayer alloc] initWithData:soundData error:&amp;error];
  
          if (error)
          {
              NSLog(@"Error in audioPlayer: %@",
                    [error localizedDescription]);
          } else {
                        audioPlayer.delegate = self;
              NSLog(@"total time=%f", self.audioPlayer.currentTime);
              self.PlayStatusSlider.maximumValue= audioPlayer.duration;
              myTimer= [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(changeAudioProgress) userInfo:nil repeats:YES];
              [audioPlayer prepareToPlay];
              [audioPlayer setVolume:1.0];
  
  
              [audioPlayer play];
          }
      }else{
          //  NSLog(@"ErrorDownloading");
      }
  }
  
  - (void) configureAVAudioSession
  {
      //get your app's audioSession singleton object
      AVAudioSession* session = [AVAudioSession sharedInstance];
  
      //error handling
      BOOL success;
      NSError* error;
  
      //set the audioSession category.
      //Needs to be Record or PlayAndRecord to use audioRouteOverride:
  
      success = [session setCategory:AVAudioSessionCategoryPlayAndRecord
                               error:&amp;error];
  
      if (!success)  NSLog(@"AVAudioSession error setting category:%@",error);
  
      //set the audioSession override
      success = [session overrideOutputAudioPort:AVAudioSessionPortOverrideSpeaker
                                           error:&amp;error];
      if (!success)  NSLog(@"AVAudioSession error overrideOutputAudioPort:%@",error);
  
      //activate the audio session
      success = [session setActive:YES error:&amp;error];
      if (!success) NSLog(@"AVAudioSession error activating: %@",error);
      else NSLog(@"audioSession active");
  }
  </code></pre>
  
  <p>but it is not working for me. Witch part is wrong? How should I use it?</p>