Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added kAudioFileFlags_EraseFile in AudioFileWriter #31

Merged
merged 2 commits into from Aug 25, 2012
Merged

added kAudioFileFlags_EraseFile in AudioFileWriter #31

merged 2 commits into from Aug 25, 2012

Conversation

ghost
Copy link

@ghost ghost commented Aug 21, 2012

the example code for writing to an audio file worked on the first attempt but on subsequent calls, ExtAudioFileCreateWithURL exited with the error -48 duplicate filename. Using kAudioFileFlags_EraseFile fixes this.

Edit / additional info for second push: fixed another small bug in the AudioFileWriter init method. When passing numChannels:1, it still produces a stereo file, this is due to the line

AudioStreamBasicDescription outputFileDesc = {44100.0, kAudioFormatMPEG4AAC, 0, 0, 1024, 0, 2, 0, 0};

where currently the 7th parameter (for num channels) is hardcoded to two. Changed this to

AudioStreamBasicDescription outputFileDesc = {44100.0, kAudioFormatMPEG4AAC, 0, 0, 1024, 0, thisNumChannels, 0, 0};

alexbw added a commit that referenced this pull request Aug 25, 2012
added kAudioFileFlags_EraseFile in AudioFileWriter
@alexbw alexbw merged commit a5a1af8 into alexbw:master Aug 25, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant