The Audio Toolbox framework provides interfaces for recording, playback, and stream parsing. In iOS, the framework provides additional interfaces for managing audio sessions.
Questions tagged [audiotoolbox]
366 questions
3
votes
3 answers
AudioToolBox in Swift - Sound works in Simulator but not on my IPad
I'm creating a music app where different chimes will be played at different points in a rhythm cycle. So far, my code works fine in the Simulator but I'm not getting any sound on my device. I get sounds from other apps. Is there something wrong with…

shavedape
- 71
- 1
- 5
3
votes
2 answers
how to get acknowledgement when audio is finished?
I am playing audio in my application using audioPlayer.Play()
and it is play correctly.
i can not find when audio finish. i want delegate method when audio finished.
can you please write method when audio finished?

imjaydeep
- 878
- 1
- 11
- 34
3
votes
1 answer
AVAudioRecorder doesn't write to file fast enough
I'm using the following code to record with AVAudioRecorder. I'm also accessing the recorded audio live (after 4 seconds) as well. However, the data is NULL until 6 seconds.
Is there a way to forcefully ask the recorder to write to…

moeseth
- 1,855
- 5
- 23
- 47
3
votes
0 answers
Choosing between AVAudioPlayer and AudioToolbox for many small audio clips
As is demonstrated in this answer, I have recently learned how to play audio files using both AVAudioPlayer and AudioToolbox. I have successfully played a single audio test file using both methods. However, I want to ask about which one I should…

Suragch
- 484,302
- 314
- 1,365
- 1,393
3
votes
1 answer
how do I extract data from void UnsafePointer in Swift?
I have the following code in Objective-C (which uses the Audio Toolbox framework) that I'm trying to convert to Swift:
MusicTimeStamp timeStamp;
MusicEventType eventType;
const void *eventData;
UInt32 eventDataSize;
//MusicEventIteratorGetEventInfo…

chris.bennett
- 69
- 1
- 6
3
votes
1 answer
CoreAudio AudioQueue stop issue
I'm making a CoreAudio based FLAC player, and ran into a naughty issue with AudioQueues.
I'm initializing my stuff like this (variables beginning with an underscore are instance variables):
_flacDecoder = FLAC__stream_decoder_new();
…

Tamás Zahola
- 9,271
- 4
- 34
- 46
3
votes
2 answers
Audio Queue cannot start again after AudioQueueStop
I can set up an Audio Queue for recording, and AudioQueueStart works well to start recording.
But after calling AudioQueueStop, I found that the same Audio Queue cannot be started again, instead, I need to create a new Audio Queue and Buffers for…

John
- 2,672
- 2
- 23
- 29
3
votes
2 answers
How to get System Volume iOS?
I found an example here, but it does not work on ios6.1.3 (iphone 4s).
always return 0.187500
Code:
Float32 volume;
UInt32 dataSize = sizeof(Float32);
AudioSessionInitialize (NULL, NULL, NULL, NULL);
AudioSessionGetProperty (
…

user2168735
- 395
- 4
- 14
3
votes
2 answers
Looping Audio with AudioToolbox.framework
I have would like to play audio on the startup of my app, but, first of all, the audio doesn't play! No matter how i code it. And secondly I would love to loop it if i can.
@implementation ViewController
-(void)awakeFromNib
{
SystemSoundID…

Brandon Boynton
- 115
- 1
- 9
3
votes
1 answer
Using AudioToolbox for short sound effects volume control not working on iPad/iPod touch models
Everything works fine on the iPhone Models, using the volume buttons on the phone raise and lower the games audio. On iPad and iPod touch models volume buttons don't effect the games sound effects.
Here is the code I am using to play these short…

Reuben Goulart
- 31
- 1
3
votes
2 answers
Speex encode/decode causing hissing noise (Objective-c)
When I bypass the speex encode/decode steps the raw audio output is correct. What I'd like is for the entire buffer captured from my recording callback to be encoded, decoded, and sent back to the playback loop. The few items I'm unsure of…

Waxford
- 41
- 3
3
votes
1 answer
Using AudioToolBox to save Wave file to NSFileWrapper
I've used ExtAudioFileCreateWithURL and ExtAudioFileWrite from the AudioToolBox framework to save my samples to a file. But now I need to save it to an NSFileWrapper since I'm now using NSDocument:
- (NSFileWrapper *)fileWrapperOfType:(NSString…

Dave Stephenson
- 45
- 3
2
votes
1 answer
Obj-C ios AudioToolkit not playing sound
When I hard-code the sound name into there, it works, but when I use a random generator to create the string, it doesn't. BTW: This is in Xcode 4.3 and iPhone 5.1 simulator.
int rand = round(arc4random_uniform(3));
char…

Sam Mauldin
- 21
- 1
2
votes
2 answers
Boost mp3 volume on iOS
I was looking for information on http://developer.apple.com/library/ios as well as on https://stackoverflow.com/, but could not find a simple and elegant solution.
I will describe the key problems: it takes to get MP3 file from your media library…

WINSergey
- 1,977
- 27
- 39
2
votes
2 answers
Getting raw sample data of m4a file to draw waveform
I'm using AudioToolbox to access m4a audio files with following code:
UInt32 packetsToRead = 1; //Does it makes difference?
void *buffer = malloc(maxPacketSize * packetsToRead);
for (UInt64 packetIndex = 0; packetIndex < packetCount;…

Denis Mikhaylov
- 2,035
- 21
- 24