0

My app is a calling app and I want to play a mp3 file during the call (call in my app not the iphone voice call). AvAudioPlayer play return YES so it means sound is played but I do not hear the sound played.

the mp3 file I want to play is a simple small beep sound which I want to play to inform the caller during the call.

Any idea why I can not hear the sound or is there a way for this. thanks a lot.

Skumar
  • 39
  • 4
  • @NitinGohel ***What???*** Disabling ARC makes sound work magically? I don't even... –  May 29 '13 at 06:05
  • @H2CO3 few day ago i working play sound Demo using AvAudioPlayer i create new project with enable ARC i put code req for playing sound but it not play i do search and found http://stackoverflow.com/questions/7692866/avaudioplayer-stops-playing-immediately-with-arc so i suggest him to disable ARC – Nitin Gohel May 29 '13 at 06:10
  • @NitinGohel Then you are doing something seriously wrong (I mean, in your code). –  May 29 '13 at 06:10
  • but after i disable ARC then run project that working fine. :) – Nitin Gohel May 29 '13 at 06:11
  • it plays well when I am not in call .. so I doubt on the speaker occupied by the call. – Skumar May 29 '13 at 06:11
  • Ohh ok sorry for my misunderstanding.. i assume that you face you not here sound so i thought might be this prob from ARC – Nitin Gohel May 29 '13 at 06:13
  • @NitinGohel If disabling ARC fixed your project, then you either don't understand the retain-release model or something important was being set to nil. Either way, you now have a functioning project that is a giant ball of memory leaks. Have fun! – CodaFi May 29 '13 at 06:13
  • Check the mode of the audio player. You probably want the sound to mix with that of the audio context of the call. – CodaFi May 29 '13 at 06:15
  • thanks @CodaFi I tried setting the mode as below. now I hear the beep sound but its not playing on speaker, my call is running on speaker so I want it to be played in the same mode. [[AVAudioSession sharedInstance] setMode:AVAudioSessionModeVoiceChat error:nil]; – Skumar May 29 '13 at 11:39

0 Answers0