core-audio

iPhone game audio and background music

Have a few questions related to adding sounds to my game, specifically intro music (for splash), background music (loop) and button event sounds. Hope you can share your knowledge on this. 1) Should I use compressed sounds or uncompressed sounds? Or perhaps a combination of the two? Are there any limitations on the iPhone hardware that ...

How do I transform an audio clip?

I want to get an audio clip from the microphone on my iPhone/iPad or iPod Touch. How do I transform it? Basically take the wavelength and modify it with sin (30) (or any angle). ...

How can I implement a volume meter for a song currently playing? (iPhone OS 3.1.3)

I'm very new to core audio and I just would like some help in coding up a little volume meter for whatever's being outputted through headphones or built-in speaker, like a dB meter. I have the following code, and have been trying to go through the apple source project "SpeakHere", but it's a nightmare trying to go through all that, witho...

Core Audio on iPhone - any way to change the microphone gain (either for speakerphone mic or headphone mic)?

After much searching the answer seems to be no, but I thought I'd ask here before giving up. For a project I'm working on that includes recording sound, the input levels sound a little quiet both when the route is external mic + speaker and when it's headphone mic + headphones. Does anyone know definitively whether it is possible to pr...

cut audio file with iPhone SDK

Hi! Is it possible to cut audio file with iPhone SDK? (file has .caf extension) I just need to cut off the silence at the beginning. (Also, maybe it's possible to write new file from the existing one with specified start and end time.) Thanks in advance! ...

AudioQueue in-memory playback example

Does anybody know of any examples using AudioQueue that play from an in-memory source? All the examples I can find play from files (using AudioFileReadPackets) but in my particular case I am generating the data myself in realtime so ideally, I want to enqueue the data myself rather than sucking it out of a file using the callback. Any ...

A way to enable a LaunchDaemon to output sound?

I have a small Foundation application that checks a website and plays a sound if it sees a certain value. This application successfully plays a sound when I run it as my user from the Terminal. I've configured this app to run as a LaunchDaemon, with the following plist: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//...

Creating simple waveforms with CoreAudio

I am new to CoreAudio, and I would like to output a simple sine wave and square wave with a given frequency and amplitude through the speakers using CA. I don't want to use sound files as I want to synthesize the sound. What do I need to do this? And can you give me an example or tutorial? Thanks. ...

Question on ExtAudioFileRead and AudioBuffer for iPhone SDK

I'm developing an iPhone app that uses the Extended Audio File Services. I try to use ExtAudioFileRead to read the audio file, and store the data in an AudioBufferList structure. AudioBufferList is defined as: struct AudioBufferList { UInt32 mNumberBuffers; AudioBuffer mBuffers[1]; }; typedef struct AudioBufferList AudioBufferLis...

OS X Audio Queues in a 64-bit Environment Issues

I've recently ported my entire application to 64-bit and everything is working fine except for my audio recorder. Even though the correct parameters (such as sample rate) are being reported when I check the resulting file's information in Quicktime, the file either has consistent gaps, is playing at a much higher speed, or is playing at...

iPhone CoreAudio hang when stopping.

I have an iPhone app that is recording audio and then broadcasting it across the network. In response to a "stop" from the far end it queues a notification to stop the recording. Alas when it gets to the AudioQueueStop call the application just hangs (ie Stop never exits). Thanks to the notification all AudioQueue manipulation is happ...

iOS: Audio Unit RemoteIO AudioBuffer manipulation (i.e. sound effects from microphone)

I've been playing around with Apple's aurioTouch demo which is sample code for their Audio Unit tutorial. This application allows simultaneous input/output from the mic. to speaker. It also renders a stereograph of the inputted sound from the mic. At a really high-level of this low-level process, the sample code defines an AudioCompone...

iPhone SpeakHere recorder issue

Hi, I'm using the AQRecorder from SpeakHere application to record WAV audio file. Everything works well on simulator but on device I'm getting the warning in console: "Error: couldn't get input channel count ('what')" And the recorder does not start recording. Thanks for help ...

Not able to call application delegate method

Hi Guys, I am developing app with finding audio frequency by using FFT. In my app, I am not able to call application delegate method in app delegate class as given in below, but I could able to call other custom methods in app delegate class. What mistake I have done? Please help me! (void)applicationDidFinishLaunching:(UIApplication...

Which iPhone API should I be using for streaming audio?

I'm looking to build a little toy app that is very similar to a voip application. One person would hold one iphone and talk to the other iphone. I don't want to use gamekit because it forces a p2p connection and does not work over 3g. I'm worrying about the server side of this later but just wanted to get started with the iPhone side of ...

Why is AudioOutputUnitStart freezing my app in iOS 4?

Hi guys, I have an audio app which uses the RemoteIO AudioUnit. It works fine on iPhone, iPad, and any flavor of the simulator on 3.2, but when it hits AudioOutputUnitStart (), it freezes. I get the message "AddRunningClient starting device on non-zero client count" in the console, which I'm not sure how to resolve. I stop the unit and ...

Recording with Remote IO

I've looked at aurioTouch but I wanted to do away with the UI and the playback function. Also looked at http://atastypixel.com/blog/using-remoteio-audio-unit/ but so far with no success. Appreciate if someone can point out any issues in my code. // configure audio session sampleRate = 44100.0; // Hertz AVAudioSession *mySession =...

Reading Core Audio as an array of floats

I'm trying to read a .caf file as an array of float values in order to perform an FFT and retrieve some pitch data. The .caf file is saved as LinearPCM using the AVRecorder class. How in the world do I go about doing this? Reading up on the structure of the .caf files I understand that their is a file header which will need to be igno...

How do you select audio input device in core audio?

I am writing a program that needs to deal with multiple audio inputs. I am currently using AudioQueues to get the input, but this is only from the default input device. Is there any way to either: Select which input device the AudioQueues use. Change the default input device. I know that I can use kAudioHardwarePropertyDevices in C...

How to get volume data from an input device in Core-Audio?

I am trying to get the volume of the audio heard by an input device using Core-Audio. So far I have used AudioDeviceAddIOProc and AudioDeviceStart with my AudioDeviceIOProc function to get the input data in the form of an AudioBufferList containing AudioBuffers. How do I get the volume of the data from the AudioBuffer? Or am I going ab...