Questions tagged [extaudiofile]
32 questions
7
votes
1 answer
ExtAudioFileRead in iOS falling with error code -50
I use ExtAudioFileRead Function to load audio file to memory. But I found there is alway an error with code -50. That means I pass the wrong parameters to the function. But I have no idea which one is the wrong parameter.
The Audio File's data…

jeff kit
- 119
- 1
- 7
6
votes
1 answer
Writing buffer of audio samples to aac file using ExtAudioFileWrite for iOS
UPDATE: I have figured this out and posted my solution as an answer to my own question (below)
I am trying to write a simple buffer of audio samples to a file using ExtAudioFileWrite in AAC format.
I have achieved this with the code below to write a…

Adam Stark
- 422
- 1
- 5
- 12
5
votes
2 answers
convert ExtAudioFileRef type to AudioFileID type in iOS
I've been using ExtAudioFile Services and I want to use an AudioFile Service which requires an AudioFileID parameter. This parameter corresponds to ExtAudioFileRef used in ExtAudioFile Services. How do I convert from ExtAudioFileRef type to…

Namratha
- 16,630
- 27
- 90
- 125
5
votes
1 answer
EXC_BAD_ACCESS from ExtAudioFileWriteAsync
I am using audio unit to record our voice. In my callback function I am getting data in AudioBufferList. I have to store this buffer in a file.
Issue is; When I try to store the buffer in a .caf file, the application is crashing. Below is the…

jfalexvijay
- 3,681
- 7
- 42
- 68
5
votes
1 answer
Getting error code ('wht?') in ExtAudioFileOpenURL in Swift when using aubio to read file
I'm using aubio to analyse an audio file, but when I try to use the function new_aubio_source like this:
let source = new_aubio_source(StringToUnsafeMutablePointerChar_t(url.absoluteString), 0, 512)
I always get these errors.
AUBIO ERROR:…

desperado
- 213
- 1
- 11
4
votes
0 answers
ios - How to use ExtAudioFileConvert sample in a new project
All I wanted was to read a caf file and write it to another file, in the hopes that perhaps I can manipulate it such as combine multiple files into one, or trimming. So I found Apples's own iPhoneExtAudioFileConvertTest Sample, which looks very…

bendigi
- 590
- 6
- 15
3
votes
1 answer
Core Audio - Write data to beginning or middle of audio file (somewhere other than the end)
So, I have an audio recording iOS app I am working on. In my app I have the need to write audio at any point in the file (in the documents directory) the user chooses, which will overwrite whatever audio is there.
Example: I record 3 min of audio,…

mnearents
- 646
- 1
- 6
- 31
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
Writing and reading an audio file with Extended Audio File
I m using ExtAudioFileWriteAsync to write an audio file while using device recording, but once I get recording finished I try to read it with ExtAudioFileRead function and samples I get are not same samples I m writing... Anyone know why this could…

M Penades
- 1,572
- 13
- 24
2
votes
1 answer
AudioFileWriteBytes fails with error code -40
I'm trying to write raw audio bytes to a file using AudioFileWriteBytes(). Here's what I'm doing:
void writeSingleChannelRingBufferDataToFileAsSInt16(AudioFileID audioFileID, AudioConverterRef audioConverter, ringBuffer *rb, SInt16 *holdingBuffer)…

alexbw
- 2,028
- 2
- 21
- 25
2
votes
3 answers
ExtAudioFileOpenURL leak
I am opening an audio file to read it and I get an abandoned malloc block from this caller each time.
In a loop I set data like this (which is marked as the memory usage in instruments as 99.7%) data = (short*)malloc(kSegmentSize*sizeof(short));
and…

some_id
- 29,466
- 62
- 182
- 304
2
votes
1 answer
Read callbacks needed by AudioFileInitializeWithCallbacks? Apple AudioFile API
I am trying to write a lowish level audio writer with the AudioFile & ExtAudioFile APIs. I am creating a new audio file with AudioFileInitializeWithCallbacks but it appears that this needs read & get size callbacks implemented. Why can't this just…

dave96
- 43
- 2
1
vote
1 answer
Writing buffers of Streamed mp3 packets to wav file using ExtAudioFileWrite ios
I am working on online radio app I managed to play the streamed mp3 packets from the Icecast server using AudioQueueServices, what I am struggling with is implementing a recording feature.
Since the streaming is in mp3 format I can not write the…

Behailu Negash
- 11
- 2
1
vote
1 answer
Get correct FileLengthFrames with CoreAudio
I'm working on converting my Python code to Objective C to run on ios devices. The code about reading audio file. In Python I'm using AudioSegment to read file , The result is 2 separated channels in array.
For example:
Left channel …

hoangpx
- 470
- 2
- 16
1
vote
1 answer
ExtAudioFileRead is too slow. How to make it faster?
I've written my own audio library. (Silly, I know but I enjoy it.) Right now, I'm using it to play stereo files from the iPod library on iOS. It works well except that sometimes the call to ExtAudioFileRead() takes longer than 23ms. Since my…

Christopher Schardt
- 391
- 3
- 13