AVAudioPlayer « 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 » AVAudioPlayer 

1. Is this the right way to use AVAudioPlayer, does my code look right?    stackoverflow.com

Considering the code:

 soundFilePath = [[NSBundle mainBundle] pathForResource: @"Sound" ofType: @"wav"]; 
 fileURL = [[NSURL alloc] initFileURLWithPath: soundFilePath]; 
 avPlayerNextLevel = [[AVAudioPlayer alloc] initWithContentsOfURL: fileURL  error: nil];
 avPlayerNextLevel1.volume = volume ...

2. AVAudioPlayer hanging the entire application    stackoverflow.com

I'm using AVAudioPlayer to play sound effects in an iPhone game. This is part of my code:

AVAudioPlayer *player = [dict objectForKey:@"Player"];
if (player.playing) {
    player.currentTime = 0;
} else {
  ...

3. Problem in including AVAudioPlayer    stackoverflow.com

I am trying to use this class as AVAudioPlayer *newPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL: fileURL error: ...

4. AVAudioPlayer iPhone question    stackoverflow.com

With the AVAudioPlayer, can I stream live audio from my microphone? If so, how would I do this?

5. Why would adding delegate to AVAudioPlayer cause "_NSAutoreleaseNoPool(): Object 0x55e060 of class NSCFString autoreleased with no pool in place - ju...    stackoverflow.com

I have been using a class to play sounds using AVAudioPlayer. Since I want to release these sounds right after they are played, I added a delegate. That causes ...

6. How to copy objects, like AVAudioPlayer    stackoverflow.com

I'm rather surprised at how few objects implement NSCopying. This is the third time in two weeks where I have needed to duplicate an existing object, without having to either ...

7. AVAudioPlayer is not rentrant correct?    stackoverflow.com

It appears that AVAudioPlayer is not reentent. So in the following would soundfx play to completion, delay 1 second, then play again, rather then the 1 second delay - and ...

8. AvAudioPlayer setting delegate to nil releases the delegate object?    stackoverflow.com

@implementation MyClass

-(id) init
{
    NSString *path0 = [ [NSBundle mainBundle] pathForResource:@"myfile" ofType:@"m4a" ];
    mSound = [[AVAudioPlayer alloc]initWithContentsOfURL:[NSURL fileURLWithPath:path0] error:NULL]; 
    mSound.delegate = self; ...

9. AVAudioPlayer Output to Speaker Problem    stackoverflow.com

After searching around for how to send AVAudioPlayer output to the iPhone's speaker, I found this: http://stackoverflow.com/questions/1064846/iphone-audio-playback-force-through-internal-speaker Despite setting the category correctly to AVAudioSessionCategoryPlayAndRecord, this solution doesn't seem to be working for ...

10. iPhone - start multiple instances of AVAudioPlayer simultaneously    stackoverflow.com

I am using multiple instances of AVAudioPlayer to play multiple audio files simultaneously. I run a loop to start playing the audio files (prepareToPlay is called beforehand and the loop only ...

11. Checking earphones connected to device programmatically?    stackoverflow.com

I am using the AVAudioPlayer class to play .mp3 files in my App. Is it possible to check whether the earphones are connected to the device programmatically? In first generation iPod devices, ...

12. iPhone - why does AVAudioPlayer currentTime return a negative value?    stackoverflow.com

When does the AVAudioPlayer's currentTime method return a negative value? The audio file is playing (I am putting in a check before getting currentTime) but making a call to currentTime returns ...

13. AVAudioPlayer - Metering - Want to build a waveform (graph)    stackoverflow.com

Hey guys! I need to build a visual graph that represents voice levels (dB) in a recorded file. I tried to do it this way:

NSError *error = nil;
AVAudioPlayer *meterPlayer = [[AVAudioPlayer alloc] ...

14. AVAudioPlayer error for Iphone Development    stackoverflow.com

     I am developing an iphone application using "AVAudioPlayer" for playing a ".wav" file . For this i am adding header file "#import <AVFoundation/AVAudioPlayer.h>" . But while ...

15. fast forwarding a song using AVAudioPlayer    stackoverflow.com

I am creating an audio player application, i need to enable the user to fast forward and backward a song by holding a button(seperately for each). I've done for playing, stopping, ...

16. Unable to Implement Forward Action in AVAudioplayer    stackoverflow.com

I am using AVAudioplayer to play some audio files. I have some controls like forward and rewind. Rewind is working properly but forward is not.

- (void)rewind
{
    AVAudioPlayer *player = ...

17. AVAudioPlayer initialization error 1685348671. How to check whether file is valid?    stackoverflow.com

I am using AVAudioPlayer to play some ima4 files. The initialization of the player keeps failing with error code 1685348671 (dta) which according to the documentation means

The file is ...

18. "Cannot find executable for CFBundle/CFPlugIn" error    stackoverflow.com

Cannot find executable for CFBundle/CFPlugIn 0x432bfa0 </Library/Audio/Plug-Ins/HAL/DVCPROHDAudio.plugin> (not loaded)
Cannot find function pointer NewPlugIn for factory C5A4CE5B-0BB8-11D8-9D75-0003939615B6 in CFBundle/CFPlugIn 0x432bfa0 </Library/Audio/Plug-Ins/HAL/DVCPROHDAudio.plugin> (not loaded)
That's the error I get when I try to run ...

19. AVAudioPlayer only initializes with some files    stackoverflow.com

I'm having trouble playing some files with AVAudioPlayer. When I try to play a certain m4a, it works fine. It also works with an mp3 that I try. However it fails ...

20. AVAudioPlayer via Speakers    stackoverflow.com

I got the following code:

- (id)init {
    if (self = [super init]) {
        UInt32 sessionCategory = kAudioSessionCategory_MediaPlayback;
     ...

21. AVAudioPlayer seek performance is not good    stackoverflow.com

We are a developing an application which is supposed to play long audio files. duration of audio file can be upto 23 hours... we are trying to use this AVAuidoPlayer for this ...

22. AVaudioPlayer problem regarding song overlaping    stackoverflow.com

I have using AVAudioPlayer in my app but the problem is that when i play the song from list it will played while before stopping the song i am again goes ...

23. Avaudioplayer problem    stackoverflow.com

Actually i am using avaudioplayer. my player is working very fine (forward,revind,play,pause,volume,progress bar). Only problem is that i am not able to stop the song. so all songs are overlapped please any body tell ...

24. Second call to AVAudioPlayer -> EXC_BAD_ACCESS (code posted, what did I miss?)    stackoverflow.com

I'm using this code to play a different mp3 files with every call. The first time through works great. The second time crash, as indicated below. .h

AVAudioPlayer *player;
@property (nonatomic, retain) AVAudioPlayer *player;
.m
-(void)load:(NSURL ...

25. iPhone AVAudioPlayer failed to find codec    stackoverflow.com

I am writing an app that downloads a wav file from a server and needs to play that file. The files use the mulaw codec with 2:1 compression. These ...

26. Crashes when using AVAudioPlayer on iPhone    stackoverflow.com

I am trying to use AVAudioPlayer to play some sounds in quick succession. When I invoke the sound-playing function less frequently so that the sounds play fully before the function is ...

27. Multi-tasking with AVAudioPlayer    stackoverflow.com

I have an audio app using AVAudioPlayer build for iPhone 3.x, now I would like to harness the multi-tasking capability in iOS 4 such that it can play music at the ...

28. AVAudioPlayer isPlaying always return null    stackoverflow.com

I'm experiencing an odd problem with AVAudioPlayer class. Everytime I try to access one of it's properties they are null.

// Get the file path to the song to play.
 NSString *filePath = ...

29. iPhone, AVAudioPlayer and multiplesounds    stackoverflow.com

im new developer and making my firt iPhone app ,and i want to make button to on/off multiplesounds , example when i press button for multiple sounds after when i ...

30. handling interuption for multiple AVAudioPlayers    stackoverflow.com

Does anybody know if it is possible to handle interruption by AVPLayer delegate when I have more then one AVPlayer? I have tried few things to start again two AVPlayer after phone ...

31. Using SystemSoundID throughout my app?    stackoverflow.com

Can someone please point me in the right direction... I need to use the same sound (a button press) throughout all view controllers in my app. What is the best way ...

32. Generate DTMF tones to be played by the iPhone    stackoverflow.com

I want to develop an application for the iPhone that generates custom DTMF tones. I assume the pure tone will be played from a memory buffer and not from an uploaded ...

33. can i have mic detection value in decibel range 0.0 to 120.0    stackoverflow.com

Now I m using the class AVAudioPlayer . But still i m not getting right value in decibel. there is any way to get the value in decibel range 0.0 to 120.0 (not ...

34. AVAudioPlayer doesn't work after 248 times    stackoverflow.com

I am developing an application that involves clicking a button repeatedly, and I am giving an audio feedback for this click, a click wave file. it works fine, but I have a ...

35. AVAudioplayer should automatically switch to next song    stackoverflow.com

i have created a music application in which there are 90 songs.when i click on a particular song it plays. i need that when i click on a particular song ...

36. AVAudioPlayer time display    stackoverflow.com

I have a simple mp3 playing through AVAudioPlayer and I want to be able to display how much time is left. I know the answer includes subtracting AVAudioPlayer.duration from AVAudioPlayer.currentTime but ...

37. How do I code for different versions of iPhone OS in XCode?    stackoverflow.com

I seem to have a bug because I'm using -[AVAudioSession setActive:withFlags:error:] in an iPhone project that is for 3.0 - 4.0.2. So I guess I need to put one of those ...

38. didSelectRowAtIndexPath - access tapCount or similar    stackoverflow.com

I'd like to control an instance of AVAudioPlayer from a UITableView item in a didSelectRowAtIndexPath instance. First touch of the row item triggers 'play' of the AVAudioPlayer. Second touch of the ...

39. AudioQueuePrime posting message to kill mediaserverd (20)    stackoverflow.com

In my application i am having 25 images, each image has corresponding music. I am playing the music when clicking on the image using avaudioplayer. But when i am clicking on ...

40. AudioServices (Easy), AVAudioPlayer (Medium), OpenAL (Hard & Overkill?)    stackoverflow.com

I need to play sounds (~5 seconds each) throughout my iphone application. When they're triggered, they need to play immediately. For the moment I'm using AudioServices and (as you probably know) the ...

41. AVAudioPlayer Leak and Crash    stackoverflow.com

I want to play multiple audio files (.WAV) using IBAction and AVAudioPlayer. Unfortunatelly the sound plays but if I play the sound many times, my application crashes. Can you help me? Here's ...

42. NULL MPMediaitemPropertyAssetURL    stackoverflow.com

Using MPMediaQuery and then getting the MPMediaitemPropertyAssetURL from the song results sometimes returns null (and by sometimes I mean in this case, 1/3 of the users song library). Does anyone know what ...

43. Using MPMediaItems with AVAudioPlayer    stackoverflow.com

Is it possible to pick media items using MPMediaPickerController and then load them into an AVAudioPlayer object?

44. how can i get the name of song that is currently being played by the avaudioplayer    stackoverflow.com

i want know what song is currently played by the avaudioplayer

45. What's wrong with my sub-classed AVAudioPlayer?    stackoverflow.com

I sub-classed AVAudioPlayer like so:

#import <AVFoundation/AVFoundation.h>

@interface AudioPlayer : AVAudioPlayer {
    // irrelevant objects...
}
-(void) myMethod;
@end
I also placed myMethod in the implementation. In another class, I instantiate the sub-class ...

46. iPhone: Access voice memos programmatically    stackoverflow.com

I'm writing an app that plays some simple voices and sounds using AVAudioPlayer. However, in order to really make the app "killer", it would need to access the users' own voice ...

47. avaudioplayer playingsong    stackoverflow.com

I created instance AVAudioPlayer but the instance is working only once like if I give

if(a.playing)
{
    i=1
}
else
{
     i=2
} 
for 1st time its giving ...

48. AVAudioPlayer -> not working    stackoverflow.com

Audio Player works fine if I initiate it for 20 to 30 times but after that it shows the following error Error Domain=NSOSStatusErrorDomain Code=-43 "The operation couldn’t be completed. (OSStatus error -43.)" ...

49. iPhone AVAudioPlayer release EXC_BAD_ACCESS    stackoverflow.com

I play sound making this:

NSData *data = [NSData dataWithBytesNoCopy:buffer length:length freeWhenDone:NO];
AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithData:data error:nil];
In this buffer i have sound with aac format. Everything is ok, until I want to ...

50. AVAudioPlayer skipping when returning from Springboard    stackoverflow.com

I have audio constantly playing during my application. I am having some odd behavior when I press the button to return to Springboard then resume my applications. The Audio ...

51. (iphone) Is having many AVAudioPlayer instance fine?    stackoverflow.com

For my small game, I'd like to play effect sound for various scenario.
Mostly it will be user-interaction related. I may need to play multiple sounds at one time. I'm ...

52. NSURL path not functioning as expected despite encoding spaces for fileWithUrlPath:    stackoverflow.com

I'm implementing a simple button-sound interface for a toy project. There are multiple buttons, with individual sounds assigned to each button. I accomplish this all within the fooViewController.{h,m} with ...

53. Use MPMediaPicker selections as AVAudioPlayer inputs    stackoverflow.com

I'm programming an application for the hearing-impaired. I'm hoping to take tracks from the iTunes library, and in my app have a slider for panning. I don't want to use OpenAL ...

54. problem regarding avaudioplayer?    stackoverflow.com

I am developing an AlarmClock app, and having problem in selecting sounds, I have multiple sounds in different rows as usual as in alarm apps. I want to play the sound ...

55. Simple Rewind for AVAudioplayer    stackoverflow.com

I've got valuechanged event handler like that:

-(void)scrub:(id)sender
{
    if(self.audioPlayer.playing)
    {
        self.audioPlayer.pause;
        self.audioPlayer.currentTime=self.scrubber.value;
 ...

56. AVAudioPlayer leaks?    stackoverflow.com

I've got a problem and don't know how to handle it. Tyring to build an app with sound and animation. It gives me a level 1 and then level 2 memory ...

57. AVAudioPlayer error loading file    stackoverflow.com

I am trying to use the AVAudioPlayer to play a simple sound and I keep getting this error in the console: 2011-09-02 20:29:07.369 MusicLog[967:10103] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not ...

58. AVAudioPlayer currentTime exceeds duration    stackoverflow.com

I'm making my own audio player using AVAudioPlayer. NOTE: "p" is my instance of the player Here's how I'm reading the track progress in one of the labels:

currentTime.text = [NSString stringWithFormat:@"%d:%02d", (int)p.currentTime / ...

59. Are there better option for a smaller file size than .aiff to be used with AVAudioPlayer?    stackoverflow.com

I'm using AVAudioPlayer to play a short one or two syllables word in my app. Currently there are 250 .aiff files and each of the file is roughly 88KB to ...

60. AVAudioPlayer closed while starting the app    stackoverflow.com

When I start my app on iphone at that time my AVAudioPlayer gets closed. and I want that when I start my app in background AVAudioplayer should be on and when ...

61. AVAudioPlayer EXC_BAD_ACCESS    stackoverflow.com

I am trying to pause the AVAudioPlayer if it is currently playing. When I debug my code and check AVAudioPlayer, I see it is allocated. When I try to ...

62. More Efficient Code? (AVAudioPlayer)    stackoverflow.com

In the phone below I am readying an AVAudioPlayer for four different sounds in my app. If I do not do this, it causes the app to delay about 1.5 seconds ...

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.