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
2 answers

How can I stream audio and also be able to control volume on iOS?

I've developed an iOS app that plays two separate audio streams simultaneously. To do this I am using AVPlayer thus: //Use URL to set up the speech radio player. NSURL *urlStreamSpeech = [NSURL URLWithString:self.urlAddressSpeech]; playerSpeech =…
Andreas
  • 11
  • 3
1
vote
2 answers

Sounds in UILocalNotification louder than AVAudioPlayer at max volume

For purposes of this question, imagine my app plays an audio clip every 10 seconds. This audio plays/mixes with the iPod music player on the device (using ducking), using AVAudioPlayer. When the app is sent to the background, I schedule…
James Boutcher
  • 2,593
  • 1
  • 25
  • 37
1
vote
1 answer

Release AVAudioPlayer in iOS4/iOS5 giving EXC_BAD_ACCESS error

EDIT: Updated my device (and deployment target) from iOS 4.3.5 to iOS 5.1.1 and still has the same issue Having a problem releasing a class member AVAudioPlayer to play another sound after playing a sound. This only seems to be a problem on one of…
GRW
  • 605
  • 12
  • 27
1
vote
1 answer

How to play song in an iOS6 app with mp3 format from an http link?

Recently i have started working on iOS application development. These days i am working on a Music Player which must have following functionality: -Online buffering of the song from php web service. -Play, pause, stop, next song, previous song. -two…
Atul
  • 111
  • 3
  • 12
1
vote
0 answers

Using AVAudioRecorder to record m4a then putting that sound file in a .plist file

First of all, I can't even get a .plist to work as I believe it should below. I am just trying to write an NSNumber and retrieve it self.paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); …
paperview
  • 33
  • 1
  • 4
1
vote
0 answers

button for mute every SystemSound

I used AVAudioPlayer, but it's too laggy, if I use this code: NSString *soundFile = [[NSBundle mainBundle] pathForResource:@"MySound" ofType:@"caf"]; NSURL *soundFileURL = [NSURL…
Magyar Miklós
  • 4,182
  • 2
  • 24
  • 42
1
vote
2 answers

playing multiple sounds(mp3, wav etc) in an iOS app

This is my requirement. I have set of audio files(mp3, wav mostly). My app's interface will have a list of these sound names and a toggle ON/OFF switch for each of the sound item. On switching a sound ON it should start playing and vice versa. If…
mohkhan
  • 11,925
  • 2
  • 24
  • 27
1
vote
0 answers

How to make an app to play ringer with behaviors similar to iphone native phone ring

I am working on a VOIP app on iOS. I have encountered some problems when implementing "Ignore incoming ringer" feature. It has the following requirements: 1. Should stop ringer if pressed screen lock or volume button 2. Should stop ringer if mute…
satel
  • 41
  • 2
1
vote
0 answers

Xcode - AVAudioPlayer redirect output to input AVAudioRecorder

I have an app that allows a user to record a guitar solo over a playing chord pattern track. The problem is, the chord pattern track is a 12 second audio file set to loop in AVPlayer. The user will be able to record up to 2 minutes over top of…
1
vote
1 answer

getting a stream to work with AVAudioPlayer

I cannot seem to get this link: https://api.soundcloud.com/tracks/54507667/stream to work with the AVAudioPlayer. I have tested it in a Souncloud API started project and it seems to work just fine, however, when I try to implement it on my own it…
Paulius Dragunas
  • 1,702
  • 3
  • 19
  • 29
1
vote
1 answer

Apple's speakhere project, different UI

I am working on an app that is similar to apple's speakhere project for audio. the project itself has the AQLevelMeter showing a nice db meter, but I am looking to build one that shows db level but as a graph, and to keep on updating as the…
Eddie
  • 949
  • 1
  • 8
  • 15
1
vote
1 answer

why will this sound loop not stop?

I made a sound loop in my app that I want to stop when the user presses the 'ok' button on a UIAlertView that comes up. I have 2 problems though: First When I have breakpoints on and I set a breakpoint for all exceptions, an exception appears on…
cory ginsberg
  • 2,907
  • 6
  • 25
  • 37
1
vote
2 answers

How to deal with AVAudioPlayer correctly in objective-c

i'm working on little game, and i've got problem with background music. I use AVAudioPlayer to play loop music. It's look like below: NSString *path = [[NSBundle mainBundle] pathForResource:@"background" ofType:@"ogg"]; NSError…
Tomasz Szulc
  • 4,217
  • 4
  • 43
  • 79
1
vote
1 answer

AVAudioPlayer audioPlayerDidFinishPlaying called when the file is played second time

I am using AVAudioPlayer class to play audio but the problem is that when I play the audio I do not receive the callback in audioPlayerDidFinishPlaying when the file is finish playing and the file starts again even when the number of loops is set to…
Farooq Arshed
  • 1,984
  • 2
  • 17
  • 26
1
vote
1 answer

volume slider has no effect

I am creating a radio streaming app with play, pause and volume slider. I have implemented volume slider using MPVolumeView but unfortunately it is not working. Can any one please let me know the correct code so that the volume slider will work in…