avfoundation

iPhone (SDK 2.2): adusting playback volume while NOT actively playing music w/ AVFoundation?

So I have an app which plays many short sound clips. I need to know when the sounds are finished playing, and I need to use mp3s, so I'm using AVFoundation for the sound playback. When a sound is actively playing, and the user uses the hardware volume buttons, the playback volume changes. Problem is, the app is NOT constantly playing ...

iPhone Mic volume.

Is there any way to poll the mic input volume with AVFoundation? I have seen the CoreAudio examples like SpeakHere but I really only need the current value. Is CA my only option? ...

Setting AVAudioPlayer volume to the user's ring volume?

I'm having a problem with AVAudioPlayer's volume. I can set theAudio.volume property to 1.0, but I'd rather just play the audio at the volume the user has his iphone ringer set to. Getting rid of the volume property defaults it at 1.0. This seems trivial, but I couldn't find a reference to it anywhere. Thanks a bunch! ...

Playing sample file from simulator using avTouch sample code.

I am trying to play the sample sound file in the avTouch sample code from the Apple dev site. I can't move the app to my phone as i am in the enrollment process and don't yet have access to the phone. The code below is from the sample code. NSURL *fileURL = [[NSURL alloc] initFileURLWithPath: [[NSBundle mainBundle] pathForResource:@"sa...

What's the SIMPLEST way to play a sound clip in an iPhone app?

I want to be able to play a sound clip in an iPhone OS app. I've seen info on both NSSound as well as AVFoundation as being means for getting sound clips played on an iPhone OS device, but I'm still not clear on the subject and could use some help. No need to spell it out for me step-by-step in actual code, but if someone could give me a...

Xcode iPhone - Adding framework works a little bit

No biggie, but when I add the AVFoundation framework for the iPhone, it turns red for some reason I'm unable to figure out why. The project will not compile unless I add this framework, and if I do, Xcode will mark the framework red (apparently that means xcode cannot find the framework), but yet it will work. Here are some screenshots:...

Playing an mp3 on IPhone OS 2.2.1

When I run this sample code on a 2nd generation IPod touch with OS version 3.0, it works fine. However when I run it on a 1st generation IPod touch with OS version 2.2.1, it doesn't. I am playing an mp3 for my background music but it still plays the SFX mp3 on the 3.0 device just fine. I am wondering if something has to be done differ...

dyld: Library not loaded: AVFoundation.framework Reason: image not found

How do I fix this? dyld: Library not loaded: /System/Library/Frameworks/AVFoundation.framework/Versions/A/AVFoundation Referenced from: /Users/[...]/Library/Application Support/iPhone Simulator/User/Applications/[...]/TestGame.app/TestGame Reason: image not found ...

What's the difference between all these audio frameworks?

In the documentation I see several frameworks for audio. All of them seem to be targeted at playing and recording audio. So I wonder what the big differences are between these? Audio Toolbox, Audio Unit, AV Foundation, and Core Audio. Or did I miss a guide that gives a good overview of all these? ...

I want to use Open AL for the iPhone but it is to low level

I want to change the pitch of my audio and I know that AV Foundation is not the place to look for that, but I don't want to learn Open AL because it is to low level, does anyone know what I would use as an alternative? ...

How would I add effects to AVAudioPlayback

I want to add effects to a sound using the AVAudioPlayer framework. Such effects as echo, pitch change, speed, etc. How would I do this. ...

iPhone SDK: Using AVfoundation framework to play audio.

Hi, Im currently building a soundboard and I am using the following code to play sounds: NSString *path = [[NSBundle mainBundle] pathForResource:@"hawhaw" ofType:@"wav"]; AVAudioPlayer* theAudio=[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL]; theAudio.delegate = self; [theAudio play]; Now this pl...

Where should I kill my AVFoundation AudioPlayer

Hi, My application consists of a table view. When a cell is touched the navigation controller moves to a tab bar controller and the "root" view of the tab bar controller has a button that plays an mp3. My question is this. When a user clicks the back button to go back to the table view and there is currently audio playing, how do I sto...

AVAudioRecorder Won't Record On Device

This is my method: -(void) playOrRecord:(UIButton *)sender { if (playBool == YES) { NSError *error = nil; NSString *filePath = [[NSBundle mainBundle] pathForResource:[NSString stringWithFormat: @"%d", [sender tag]] ofType:@"caf"]; NSURL *fileUrl = [NSURL fileURLWithPath:filePath]; AVAudioPlayer *playe...

Getting AveragePower and PeakPower for a Channel in AVAudioRecorder

Hi all, I am annoyed with this piece of code. I am trying to get the averagePowerForChannel and peakPowerForChannel while recording Audio, but every time i am getting it as 0.0 Below is my code for recording audio : NSMutableDictionary *recordSetting =[[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithFloat: 22050.0], ...

How to trim AVAudioRecorder recording visually?

Hi, I have an app that records and plays audio with AVFoundation. I'm trying to work out how I would implement an audio trimmer (kind of like the one in Quicktime for Mac) and am totally stumped. Can anyone offer any help on how I would do this? Thanks! ...

AVPlayerLayer with alpha mask

Has anyone got a video playing on an AVPlayerLayer with an alpha channel? If so, how is it possible? I've tried many different solutions including using pure alpha channel video, applying blend modes to the target layer and animating every frame myself. The only workable solution is the latter and it bogs the phone down too much. ...

How to use AVAudioPlayer to play a playlist in iPhone/iPad

Please I know how to play a sound in AVAudioPlayer but I would like to know how to give it a list of on-disk files to play one after the other (play list) Anyone has any idea? ...

UIImage created from CMSampleBufferRef not displayed in UIImageView?

I'm trying to display a UIImage in real-time coming from the camera, and it seems that my UIImageView is not displaying the image properly. This is the method which a AVCaptureVideoDataOutputSampleBufferDelegate has to implement - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer...

iPhone: AVCaptureSession capture output crashing (AVCaptureVideoDataOutput)

I'm capturing video and converting it to a CGImage to do processing on it. It will work for a ~10 seconds, get memory warning and then crash (usually it says data formatters were temporarily unavailable). Can someone help me solve the problem? - (void) captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferR...