0

My App has functionality to record and play audio using AVAudioRecorder/AVAudioPlayer respectively. Whenever I download an audio file from the server, the file is opened automatically using the default player with a black screen as shown:

enter image description here

However, I actually have my own user interface to play audio files. How can I block this option programmatically?

JRG-Developer
  • 12,454
  • 8
  • 55
  • 81
KPZZSS
  • 31
  • 1
  • 3
  • Please add code showing how you download and open the audio file currently. – JRG-Developer Dec 29 '16 at 18:04
  • Are you using `AVPlayerViewController`, perhaps? This may be useful... https://stackoverflow.com/questions/28402521/avplayerviewcontroller-using-audio-only-avplayer – JRG-Developer Dec 29 '16 at 18:08
  • I meant before opening or Initiating the AVAudioPlayer, Once downloaded the audio file content from server, this screen is opening. – KPZZSS Dec 29 '16 at 18:10
  • I have not tried to open the audio file, i just downloaded in to local path with format of .wav – KPZZSS Dec 29 '16 at 18:12
  • Please add code snippet showing how you download and open the audio file. Most likely, that's where your issue is. – JRG-Developer Dec 29 '16 at 18:12
  • 1
    Audio Player Initialisation : `self.audioPlayer = [[AVAudioPlayer alloc]initWithContentsOfURL:[NSURL URLWithString:fileURL] error:&error]; [self.audioPlayer setMeteringEnabled:YES]; self.audioPlayer.delegate = self;` – KPZZSS Dec 29 '16 at 18:42
  • Download Operation : Im just storing received audio file content inside document directory. – KPZZSS Dec 29 '16 at 18:43

0 Answers0