Questions tagged [avaudioplayer]

Apple’s AVFoundation framework includes AVAudioPlayer, an easy, feature rich, Objective-C based API for playing audio files.

An instance of the AVAudioPlayer class, called an audio player, provides playback of audio data from a file or memory.

Apple recommends that you use this class for audio playback unless you are playing audio captured from a network stream or require very low I/O latency. For an overview of audio technologies, see Audio & Video Starting Point and “Using Audio” in Multimedia Programming Guide.

Using an audio player you can:

  • Play sounds of any duration
  • Play sounds from files or memory buffers
  • Loop sounds
  • Play multiple sounds simultaneously, one sound per audio player, with precise synchronization
  • Control relative playback level, stereo positioning, and playback rate for each sound you are playing
  • Seek to a particular point in a sound file, which supports such application features as fast forward and rewind
  • Obtain data you can use for playback-level metering

Source: ADC - AVAudioPlayer Class Reference

2788 questions
1
vote
0 answers

XCODE IOS memory leak for AVAudioPlayer

I use ARC. Here is the method for starting the audio in my code: .h file: @property (retain,nonatomic)AVAudioPlayer *myAudio; and .m files -(void)myPlaySound:(NSString *)mySoundFile NumberOfLoops:(int)loopsCount ofType:(NSString *)fileType { …
user1771823
  • 139
  • 1
  • 13
1
vote
1 answer

Best Audio Player

I want to make app based on Audio Player. I did work with AVAudioPlayer before. Now I want to know which is latest Audio Player available for ios. No matter what kind of integration is needed. But is it best among all available audio players?…
Niru Mukund Shah
  • 4,637
  • 2
  • 20
  • 34
1
vote
1 answer

AVAudioPlayer not found in iOS 6.0

I need to add AVAudioPlayer Framework in project but don't find it.Is it deprecated in iOS 6? If yes then what i m supposed to use to play audio file mp3. Will mediaplayer framework will work to play audiofile mp3.
user1452248
  • 767
  • 2
  • 11
  • 28
1
vote
2 answers

Issue with merging audio file in ios

I am trying to merge 4 audio files and play them. following is the code - (BOOL) combineVoices { NSMutableArray * arr=[[NSMutableArray alloc] init]; [arr addObject:@"player_4_full"]; [arr addObject:@"event_1_1_1"]; [arr…
user1495306
  • 121
  • 1
  • 6
1
vote
2 answers

loading AVAudioPlayer file URLs from a Plist

I'm working with about 50 AVAudioPlayers that each load a separate audio file. The files are fixed and within the app bundle. They are triggered by events later on in the app. Currently I'm hardcoding the creation of each player instance, like…
MightyMeta
  • 599
  • 4
  • 14
1
vote
3 answers

Is AVAudioPlayer able to loop large audio files without an audible gap?

I have large looping background music files of up to 10 minutes length. The sounds are looped perfectly and if the player introduces no delay you would not notice where the loop point is. Can AVAudioPlayer play them without that the user will hear a…
openfrog
  • 40,201
  • 65
  • 225
  • 373
1
vote
1 answer

Is -prepareToPlay of AVAudioPlayer to be called in a background queue?

This preparation method returns BOOL on success and audio files are heavy to load. I suppose it is not a good idea to do this on the main thread. So is it fine to call this in the background and report to the main queue when this method returns?
openfrog
  • 40,201
  • 65
  • 225
  • 373
1
vote
0 answers

Is there an open-source alternative to AVAudioPlayer which offers a callback when audio playback really started?

I am making an app which is similar to flip book animation. It plays an audio track with AVAudioPlayer and starts animations which must start exactly at same time as audio starts. Tolerance is about +/- 100 msec. I found AVPlayer as alternative…
openfrog
  • 40,201
  • 65
  • 225
  • 373
1
vote
3 answers

iPhone: MPMusicPlayerController stops AVAudioPlayer

I'm playing a silent music with AVAudioPlayer when user locks the screen, so that my timers won't stop. However, when I play an iPod music with [MPMusicPlayerController applicationMusicPlayer], AVAudioPlayer stops,without receiving any call back. Is…
CarmeloS
  • 7,868
  • 8
  • 56
  • 103
1
vote
1 answer

Volume issue - AVAudioPlayer mixed with AudioServices System Sound

I've big problem with handling sounds in my game. I'm using AVAudioPlayer for BG music and AudioServices system sound for short sound FX. There's issue with volume. Changing volume down in game affects background music and SFX volume. If it's…
alexhajdu
  • 410
  • 5
  • 13
1
vote
1 answer

iOS AVAudioPlayer does not play while finger panning MKMapView

I have a basic beep sound that I loaded with AVAudioPlayer in my app. It can play the beep fine if my finger isn't panning my MKMapView. My beep is set to play every 2 seconds. When I start panning the map view, and don't take my finger off the…
Zhang
  • 11,549
  • 7
  • 57
  • 87
1
vote
1 answer

How to properly close an AVAudioRecorder file after a crash

I'm wondering if anyone has any ideas on how to properly close an audio file that was open and actively recording when the application experienced a crash. A simple way to test this is to start a recording using the simulator, then press stop in…
kermitology
  • 493
  • 6
  • 12
1
vote
1 answer

AVAudioPlayer sounds garbled on iPhone without headphones

I have 23 music files (10-20 seconds in length) that I want to play when the user selects them and presses the play button. It works find on my iPad and on the simulators, with or without earphones. But on the iPhone device without earphones,…
Nancy
  • 406
  • 5
  • 15
1
vote
1 answer

Playing sequence of sounds in background with AVAudioPlayer

I want to play sequence of sounds with AVAudioPlayer. All are ok in foreground, but in background I have issues. After scheduling next sound it plays in background, but initialisation of sound after next fails. How to resolve this issue? In fact, I…
sergtk
  • 10,714
  • 15
  • 75
  • 130
1
vote
0 answers

AVAudioPlayer is causing leaks under ARC

I have a class that provides a Music Player, compiled under ARC. This is the init code: - (id) init{ self = [super init]; runningVolumeNotification = FALSE; MPMusicPlayerController *musicPlayer = [MPMusicPlayerController iPodMusicPlayer]; …
flip79
  • 1,178
  • 2
  • 15
  • 28
1 2 3
99
100