audioqueueservices

Recording Audio on iPhone and Sending Over Network with NSOutputStream

I am writing an iPhone application that needs to record audio from the built-in microphone and then send that audio data to a server for processing. The application uses a socket connection to connect to the server and Audio Queue Services to do the recording. What I am unsure of is when to actually send the data. Audio Queue Services f...

How to start writing out an existing AudioQueue in response to an event?

Hello, I am writing a class that opens an AudioQueue and analyzes its characteristics, and then under certain conditions can begin or end writing out a file from that AudioQueue that is already instantiated. This is my code (entirely based on SpeakHere) that opens the AudioQueue without writing anything out to tmp: void AQRecorder::St...

Unexpected behavior with AudioQueueServices callback while recording audio

I'm recording a continuous stream of data using AudioQueueServices. It is my understanding that the callback will only be called when the buffer fills with data. In practice, the first callback has a full buffer, the 2nd callback is 3/4 full, the 3rd callback is full, the 4th is 3/4 full, and so on. These buffers are 8000 packets (rec...

AudioFileReadPackets to an array?

I'd like to read packets from an audio file, but I don't want to send them to a playback buffer. I just want to get an array of the packets, ideally as floats. I've prepped the audio and then want to call: OSStatus err = AudioFileReadPackets (audioFileID,FALSE,outBytes,NULL,0,numPackets,whatGoesHere?); But what goes in that last argum...

Using Audio Queue Services to play PCM data over a socket connection

I'm writing a remote desktop client for the iPhone and I'm trying to implement audio redirection. The client is connected to the server over a socket connection, and the server sends 32K chunks of PCM data at a time. I'm trying to use AQS to play the data and it plays the first two seconds (1 buffer worth). However, since the next chu...

iPhone SDK: Audio Queue control

Hi all, I am new to the audio queue services so I have taken an example from a book called iPhone Cool Projects where it describes how to stream audio. I want to extend this to being able to play a continuous playlist of links to mp3 files like an internet radio. The problem with the example code it that it does not detect when a str...

Record/Playback with AudioQueue on iPhone

Hi, I am currently using Audio Queues on the iPhone to record and playback audio. What I would like to be able to do is to record some audio, allow the user to pause the record queue, and to seek back and forward through the audio to select a position from where they can start recording from again. I have got over the seeking issue by...

AudioQueue recording as float

Hi guys, I would like to have the result from my recording as a float in the range [0.0, 1.0], alternatively [-1.0, 1.0] because of a bit of math I want to do on it. When I set my recordingformat to be in float, like this: mRecordFormat.mFormatFlags = kLinearPCMFormatFlagIsFloat; I get: Error: AudioQueueNewInput failed ('fmt?') D...

How to slow down or speed up the playback of audio when using Audio Queue Services?

Is that possible? How is this done in theory? Would I simply make a very small buffer packet size and then delay the playback artificially? I assume that's the low-brain way? How could I do it in such a way that the sound is smooth and doesn't suck? ...

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...

Pause recording callback for AudioQueue

Hi, I have a basic doubt about AudioQueues, I am using AudioQueue to record and am basically following the SpeakHere app. I found out that whenever I pause recording using the api: AudioQueuePause on AudioQueue object, the recording is not paused immediately. Is there a callback in AudioQueues which intimates the delegate that audio rec...

AudioQueueStart fails when iphone app running in background iOS4.0

I'm having difficulties starting the AudioQueue when my app is in the background with iOS4.0 The code works fine when the app is active, but fails with -12985 code when running in the background. err = AudioQueueStart( queueObject, NULL ); if( err ) { NSLog(@"AudioQueueStart failed with %d", err); ...

Example of using Audio Queue Services.

Hi, I am seeking an example of using Audio Queue Services. I would like to create a sound using a mathematical equation and then hear it. Thanks. Sagiftw ...

Record Sound in Cocoa Example Please!

Hi, I've been scouring both this site and the net in general for an example cocoa app that uses QTKit or Audio Queue and actually works. Unfortunately, I can't find anything that fits the above description. All I want to do is get a simple audio recording app so I can learn how it works! Please, I have put alot of time into this alre...

How to check whether a music is playing or paused in AudioQueue

Hi, I am using AudioQueueStart for playing music and AudioQueuePause for pausing. Is there any way in AudioQueues to check whether the music is playing or not, I want to Pause music only if it is playing. ...

pause Audio recording while displaying iAds in full view?

Hello forum, I am working on iAds and I wanted to ask if it was necessary to stop recording audio on my iphone using AudioQueueObject while the iAdView is displayed in the full view ? Thanx. ...

How to check current time and duration in AudioQueue

Hi, How to get total time duration of music in audioQueue. I am using NSTimeInterval AQPlayer::getCurrentTime() { NSTimeInterval timeInterval = 0.0; AudioQueueTimelineRef timeLine; OSStatus status = AudioQueueCreateTimeline(mQueue, &timeLine); if(status == noErr) { AudioTimeStamp timeStamp; AudioQu...

play iphone audio at constant volume

I am using AudioQueue Services to play audio in my app (AQPlayer borrowed from Speak Here) and I would like to know if it is possible to play the audio at a constant volume regardless of the iphone hardware volume. Apple's phone.app keypad is an example of this, the tones play at the same volume regardless of your hardware volume. ...

Problem with AudioQueueStart() on iPad

I am having the following problem with Audio Queue Services, and was hoping it sounded familiar to someone else. First I execute: AudioQueueAddPropertyListener(audioQueue, kAudioQueueProperty_IsRunning, MyAudioQueueIsRunningCallback, self); Then later I execute: AudioQueueStart(audioQueue, NULL); Both calls return no errors but MyAu...

NSSound-like framework that works, but doesn't require dealing with a steep learning curve

Hi, I've pretty much finished work on a white noise feature for one of my applications using NSSound to play a loop of 10 second AAC-encoded pre-recorded white noise. [sound setLoops: YES] should be all that's required, right? It works like a charm but I've noticed that there is an audible pause between the sound file finishing and ...