play « AVAudioPlayer « iPhone iPad Media Q&A

Home
iPhone iPad Media Q&A
1.animation
2.audio
3.AVAudioPlayer
4.box2d
5.cocos2d
6.CoreGraphics
7.CorePlot
8.Flash
9.graphics
10.icon
11.image
12.photo
13.plot
14.sound
15.video
iPhone iPad Media Q&A » AVAudioPlayer » play 

1. What do you use to play sound in iPhone games?    stackoverflow.com

I have a performance-intensive iPhone game I would like to add sounds to. There seem to be about three main choices: (1) AVAudioPlayer, (2) Audio Queues and (3) OpenAL. I’d hate ...

2. A lot of noise while playing audio files with AVAudioPlayer (iphone)    stackoverflow.com

I get a lot of noise during playback. The noise is not there when I play it on my mac, so it has to be an error with the AVAudioPlayer. Has ...

3. Do an action when a sound has finished playing in AVAudioPlayer?    stackoverflow.com

I am using the AVAudioPlayer framework, and I have several sounds that play one at a time. When a sound is finished playing, I want the application to do something. ...

4. AVAudioPlayer resetting currently playing sound and playing it from beginning    stackoverflow.com

I'm having an issue using AVAudioPlayer where I want to reset a player if it's currently playing and have it play again. I try the following with no luck: The sound plays once ...

5. AVAudioPlayer to play short sounds on my iPhone?    stackoverflow.com

I want to use AVAudioPlayer to play short sounds... because I have more control than System Sound. I have several buttons which are hooked up to play several different short sounds. Each sound ...

6. How to use AVAudioPlayer to play M4P    stackoverflow.com

I want to use AVAudioPlayer to play M4p files from iTunes generator. I could use uiWebView to play it and it worked, but I want to put an image of my ...

7. Play AVAudioPlayer From A Sleeping iPhone    stackoverflow.com

I am creating a alarm application. I am using Audio Session in my main delegate class.

OSStatus result = AudioSessionInitialize(NULL, NULL, interruptionListenerCallback, self);
UInt32 category = kAudioSessionCategory_MediaPlayback;
result = AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(category), &category);  

AudioSessionSetActive(YES);
I am ...

8. How to debug why a sound won't play via AVAudioPlayer?    stackoverflow.com

I have a simple iPhone app with several sounds already playing. However, one in particularly won't. The code block I've hacked up is:

NSString *soundPath2 = [[NSBundle mainBundle] pathForResource:@"gameover" ofType:@"wav"];
NSURL ...

9. iPhone, is it possible to play a sound from the speakers while in a call?    stackoverflow.com

I would like to know from some iphone-Audio expert if there is a way to let a sound play through the line in of the microphone, or at least to play ...

10. Sounds randomly interrupted when starting to play    stackoverflow.com

I'm calling playSoundFromBundle from the code below to play sounds (aif files). I have a sound that does a single click and then a fading sound. Both sounds are ...

11. App freeezes when playing sound with AVAudioPlayer    stackoverflow.com

I am making an app for preschoolers with several mini-games. One of them involves finding "what is wrong" in the picture. For example if they press the kid playing in the ...

12. iPhone: How to play a sound at a particular time?    stackoverflow.com

I have written the following code:

-(void)runTimer
{
    myTicker=[NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(showActivity) userInfo:nil repeats:YES];
    myTicker = [NSTimer scheduledTimerWithTimeInterval:60.00 target:self selector:@selector(vibrate) userInfo:nil repeats:YES];
}

-(void)showActivity
{
    NSDateFormatter ...

13. How to debug a AVAudioPlayer play failure?    stackoverflow.com

I'm using an AVAudioPlayer to play a mono AIFF file from my app's Documents directory. On the simulator, [player play] returns YES and I hear the file playing. On the device the ...

14. Problem Playing Audio Iphone    stackoverflow.com

I'm just trying to get a simple mp3 player working. I'm getting an error that I don't really understand. I have an instance of AVAudioPlayer declared in my h file and ...

15. How to show Time Remaining when playing a song in my iPhone app?    stackoverflow.com

I use AVAudioPlayer to play an mp3 file to a user within my iPhone app. This all works fine and dandy. I even update a PLAY/PAUSED button depending on the state ...

16. Delay in playing sounds using AVAudioPlayer    stackoverflow.com

-(IBAction)playSound{ AVAudioPlayer *myExampleSound;

NSString *myExamplePath = [[NSBundle mainBundle] pathForResource:@"myaudiofile" ofType:@"caf"];

myExampleSound =[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:myExamplePath] error:NULL];

myExampleSound.delegate = self;

[myExampleSound play];

}
I want to play a beep sound when a button is clicked. I had used ...

17. Play multiple audio files using AVAudioPlayer    stackoverflow.com

I am planning on releasing 10 of my song recordings for free but bundled in an iphone app. They are not available on web or itunes or anywhere as of now. I ...

18. how to use single instance of AVAudioPlayer for playing multiple songs?    stackoverflow.com

I want to play multiple songs with single object of AVAudioplayer, I put songs in table row , when user tap on row player view is open but when user ...

19. How to play sounds in locked mode on iPhone    stackoverflow.com

Everybody knows the standard procedure to keep your app alive, after the user pressed the lock button (silent sound). If I start a sound with AVAudioPlayer (before the iphone is locked), the ...

20. Can I store AVAudioPlayer references in an NSMutableArray and play them at will?    stackoverflow.com

I have a library of 16 short sound clips I need to be able to play in quick succession. I realized that creating and preparing AVAudioPlayer objects in real time ...

21. play audio from internet using AVAudioPlayer    stackoverflow.com

Hey all,
I am implementing AVAudioPlayer to play audio and it works perfectly well while playing files locally stored in the PC.
But when i give the url of some audio file over ...

22. How to play multiple audio files using AVAudioPlayer    stackoverflow.com

In my application, I am displaying multiple images in rows and columns when i click on a image i will play corresponding sound using

someName = [someName stringByAppendingFormat:@".mp3"];
[audioPlayer stop];

NSURL *url = ...

23. iPhone AVAudioPlayer app freeze on first play    stackoverflow.com

I'm using AVAudioPlayer from iOS SDK for playing short sounds on each click in tableView rows. I have manually made @selector on button in each row that fires up method playSound:(id)receiver {}. ...

24. Problem playing audio file with AVAudioPlayer on iPhone 4 in iOS 4.1    stackoverflow.com

I am using a simple bit of code to play an audio file:

NSString *pathToMusicFile1 = [[NSBundle mainBundle] pathForResource:@"song" ofType:@"mp3"];
mySong1 = [[AVAudioPlayer alloc]initWithContentsOfURL:[NSURL fileURLWithPath:pathToMusicFile1] error:NULL]; 
NSLog(@"Song1 Loaded");
mySong1.numberOfLoops = -1;
mySong1.volume = 1.0;
[mySong1 play];
I ...

25. Play movie, audio and display contents of a folder in detailView    stackoverflow.com

I am having a tableView which lists the contents of a directory which includes jpg, pdf, zip, mp3, mp4, sql,.. files and even folders. For the next step, I am having ...

26. Problem using Apple's MixerHostAudio class to play audio files    stackoverflow.com

I'm trying to use Apple's MixerHostAudio class to mix and play audio files specified by the user. The class files can be found here: http://developer.apple.com/library/ios/#samplecode/MixerHost/Listings/Classes_MixerHostAudio_h.html To make the MixerHostAudio class play ...

27. How to start playing AVAudioPlayer while downloading?    stackoverflow.com

I have a mp3 track at a URL http://mysite.com/MP3/track1.mp3. Downloading it to a local path with NSURLConnection and NSDocumentDirectory. I would like to start playing this track as soon as possible ...

28. Best way to play different sounds one at a time on iphone?    stackoverflow.com

I have a bunch of sounds I want to play. Right now I'm using AVAudioPlayer. A new sound should start when the user clicks a button. The url ...

29. Playing a a number of different sounds using AVAudioPlayer    stackoverflow.com

I have a few single hit sounds(small sound effects) which I want to play when a button is pressed. Should I declare the player and then initialize the sound to the ...

30. how to play only one sound at a time with AVAudioplayer    stackoverflow.com

i am playing sound when user tap on the respected button. i have 10 buttons with 10 audio files. i am playing the selected sound by using the AVAudioPlayer

AVAudioPlayer *myaudio=[[AVAudioPlayer alloc]initWithContentsOfURL:[NSURL fileURLWithPath:[[NSBundle mainBundle]pathForResource:[sounds ...

31. how to know which song is playing in avaudioplayer    stackoverflow.com

how to know which song is playing in avaudioplayer

32. can I play a sound while the iPhone is sleeping?    stackoverflow.com

How can I play a custom, looping sound (from my app, while my app is open) while the iPhone is sleeping? I'm using this code to play a audio file:

NSString *soundFilePath = ...

33. iPhone - Sound not playing with AudioServicesPlaySystemSound nor AVAudioPlayer    stackoverflow.com

I have a button on a UIImagePicker overly , and I want it to make some sound when clicked. To do so, I have in my project resources a sound in m4a ...

34. iPhone: AVAudioPlayer not always playing audio on device    stackoverflow.com

I have 2 views in my app, that are identical, they just load in a different array of sound files to use with their respective AVAudioPlayer. However, ON THE DEVICE ONLY, on ...

35. Playing multiple sounds at once?    stackoverflow.com

I have 6 sounds on one view. However I want it so that I can play more than one at once, So you tap sound 1 (sound 1 is playing) then sound ...

36. How to Make and Play A Procedurally Generated Chirp Sound    stackoverflow.com

My goal is to create a "Chirper" class. A chirper should be able to emit a procedurally generated chirp sound. The specific idea is that the chirp must be procedurally generated, ...

37. Playing sounds simultaneously on iOS devices    stackoverflow.com

I have 10 sounds in one view. And they all play, however only one sound can play at a time. I want it so you can tap the sounds you want ...

38. Play audio via earpiece is possible?    stackoverflow.com

Is it possible to switch sound output from built-in speaker/headphones to the earpiece? Standard Voice Memos app can do that for playing recoded audio notes.

39. (iphone) how to play sound sequentially with AVAudioPlayer?    stackoverflow.com

I'd like to play multiple sound sequentially.
The sound data will be available via NSData.
(to be more precise, I'm going to play different sound whenever scrollViewDidEndScrolling is called, and stop previous sound ...

40. (iphone) audio format to play voice sound?    stackoverflow.com

Is there a preferred audio format to play voice recording? play time is about 1-5secs. AAC is considered bad for this? I'm trying to play aac with AVAudioPlayer but having -1 error.
AVAudioplayer isn't suitable ...

41. AVAudioPlayer sound files playing out of sync when mixed - iPhone    stackoverflow.com

I am trying to play 6 seperate .mp3 sound files using instances of AVAudioPlayer. The sounds are playing at the same time but they seem to be playing out of sync or ...

42. Playing multiple sounds simultaneously with AVAudioPlayer    stackoverflow.com

Could someone help me with a function that fires multiple AVAudioPlayers at the same time? Right now I am trying to get a total of twelve AVAudioPlayers to fire at once ...

43. How can you play a sound of a specified duration using AVAudioPlayer on iOS?     stackoverflow.com

I want to play a specified duration within a sound file on IOS. I found a method in AVAudioPlayer that seeks to the begining of the playing (playAtTime:) but i cannot ...

44. iphone : play rm files on iphone programmatically    stackoverflow.com

i have a good experince with playing audio in general on iphone but i would like to have a way to play .RM files on iphone app .. i've tried the ...

45. About AMR audio file playing issue on different devices    stackoverflow.com

I've got a quite strange problem here. I'm developing an IM software and need to play audio files recorded by another client on Android. The same audio file I've got can be played ...

46. Sound does not play while using AVAudioPlayer    stackoverflow.com

Here is my code on button click

- (void)playButton:(id)sender
{
    NSLog(@"Play  Button Clicked!!!...");
    audioPlayer = [self setUpAudioPlayer:[songs objectAtIndex:i]];
}

-(AVAudioPlayer *)setUpAudioPlayer:(NSString *)filename
{
    NSLog(@"File name : ...

47. Play sound from any position on iPhone    stackoverflow.com

I have a "*.caf" file, I can play it, but I need progress of playing, and jump to any position of music track. How to implement it? enter image description ...</p></div></td></tr><tr><td><div class='articleProductElement'><h3 class='articleProductElementTitle'>48. <a href='http://stackoverflow.com/questions/7237863/problem-firing-method-after-avaudioplayer-is-finished-playing'>Problem firing method after AVAudioPlayer is finished playing</a><span class='articleProductElementHost'>    stackoverflow.com</span></h3><p class='articleProductElementParagraph'>I saw some similar questions with  different solutions, but I want to know if there's a way using something similar to what I've already come up with.

Essentially, a uiview will ...</p></div></td></tr><tr><td><div class='articleProductElement'><h3 class='articleProductElementTitle'>49. <a href='http://stackoverflow.com/questions/7319538/avaudioplayer-its-playing-old-one'>AVAudioPlayer..its playing old one</a><span class='articleProductElementHost'>    stackoverflow.com</span></h3><p class='articleProductElementParagraph'>m making an app which requires to play recorded audio files. 
For that m having a sound.h/.m file and setting.h/.m file
In sound I have a method - update player which will ...</p></div></td></tr><tr><td><div class='articleProductElement'><h3 class='articleProductElementTitle'>50. <a href='http://stackoverflow.com/questions/7456966/sending-a-value-to-an-avaudioplayer-object-to-play-a-different-sound'>Sending a Value to an AVAudioPlayer Object to Play a Different Sound</a><span class='articleProductElementHost'>    stackoverflow.com</span></h3><p class='articleProductElementParagraph'>I have an iphone app where I am playing a sound with one button using an AVAudioPlayer object. However, I would like to use a variable for the sound name and ...</p></div></td></tr><tr><td><div class='articleProductElement'><h3 class='articleProductElementTitle'>51. <a href='http://stackoverflow.com/questions/7475543/avaudioplayer-how-to-play-fast-or-slow-file'>AVAudioPlayer how to play fast or slow file</a><span class='articleProductElementHost'>    stackoverflow.com</span></h3><p class='articleProductElementParagraph'>I just need to listen to the file slowly or quickly. Any help will be greatly appreciated
 </p></div></td></tr><tr><td><div class='articleProductElement'><h3 class='articleProductElementTitle'>52. <a href='http://stackoverflow.com/questions/7501351/play-a-set-of-sounds-one-by-one-using-avaudioplayer'>play a set of sounds one by one using AVAudioPlayer</a><span class='articleProductElementHost'>    stackoverflow.com</span></h3><p class='articleProductElementParagraph'>I want to use AVAudioPlayer in my app. The logic is: firstly play a set of sounds at the same time and then play another set of sounds.But i found that ...</p></div></td></tr><tr><td><div class='articleProductElement'><h3 class='articleProductElementTitle'>53. <a href='http://stackoverflow.com/questions/7810936/how-to-play-avaudioplayer-local-to-method-in-ios'>How to play AVAudioPlayer local to method in ios5?</a><span class='articleProductElementHost'>    stackoverflow.com</span></h3><p class='articleProductElementParagraph'>I think it has to do with ARC in iOS 5, but when I declare an AVAudioPlayer in a method and play it, it won't play.  I think it gets ...</p></div></td></tr><tr><td><div class='articleProductElement'><h3 class='articleProductElementTitle'>54. <a href='http://stackoverflow.com/questions/7889251/play-audio-files-continuously-with-touch-movements-in-iphone'>Play audio files continuously with touch movements in iPhone</a><span class='articleProductElementHost'>    stackoverflow.com</span></h3><p class='articleProductElementParagraph'>I'm trying to play continuous audio clippings when touch moves across the screen of iPhone. There are specific audio clippings according to the screen regions. When touch changes its region the ...</p></div></td></tr><tr><td><div class='articleProductElement'><h3 class='articleProductElementTitle'>55. <a href='http://stackoverflow.com/questions/8061731/in-avaudioplayer-save-audio-song-while-playing-the-same-song'>In AvaudioPlayer save audio song while playing the same song</a><span class='articleProductElementHost'>    stackoverflow.com</span></h3><p class='articleProductElementParagraph'>Is there any way to save a song while playing the same song with using avaudioplayer? Please suggest some sample idea
thanks in advance
 </p></div></td></tr></table><TABLE border=0><TR><TD height=10></TD></TR></TABLE>
</td></tr></table></td></tr></table><center><TABLE border=0><TR align=left><TD><A href=java2s.com  | Contact Us | Privacy Policy

Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.