Re: ExtAudioFileSetProperty() fails
Re: ExtAudioFileSetProperty() fails
- Subject: Re: ExtAudioFileSetProperty() fails
- From: "Rico Hauke" <email@hidden>
- Date: Wed, 24 Sep 2008 22:57:44 +0200
Never mind, apparently everything is working fine on Leopard, but not on iPhone OS. :-(
On Wed, Sep 24, 2008 at 10:09 PM, Rico Hauke
<email@hidden> wrote:
I opened the file with ExtAudioFileOpenURL(), so I suppose it's been opened for reading, right?
Btw. everything works fine, when I open a .wav file instead of a .mp3 file......................
On Wed, Sep 24, 2008 at 8:52 PM, Craig Hopson
<email@hidden> wrote:
This returns 1885696621, which I don't know how to interpret. :-(
In hex this is: 0x7065726D
In ASCII this is: 'perm'
Looks like you are getting file permission error. Do you have the file open for writes, or read only?
-Craig
On Sep 24, 2008, at 12:32 PM, Rico Hauke wrote:
Hi list,
I am trying to decode a mp3 file to lpcm but ExtAudioFileSetProperty() fails when trying to set the client format.
Here's the code:
status = ExtAudioFileGetProperty(file, kExtAudioFileProperty_FileDataFormat, &size, &format);
This returns kAudioServicesNoError (== 0) and format was filled with the following values:
format.mSampleRate: 44100.0
format.mFormatID: 778924083 (== 'mp3@')
format.mFormatFlags: 0
format.mBytesPerPacket: 0
format.mFramesPerPacket: 1152
format.mBytesPerFrame: 0
format.mChannelsPerFrame: 2
format.mBitsPerChannel: 0
format.mReserved: 0
Next, I set the client format:
clientFormat = format;
clientFormat.mSampleRate = 44100.0;
clientFormat.mFormatID = 'lpcm';
clientFormat.mFormatFlags = 0;
clientFormat.mBytesPerPacket = 4;
clientFormat.mFramesPerPacket = 1;
clientFormat.mBytesPerFrame = 4;
clientFormat.mChannelsPerFrame = 2;
clientFormat.mBitsPerChannel = 16;
clientFormat.mReserved = 0;
UInt32 clientSize = sizeof(clientFormat);
status = ExtAudioFileSetProperty(file, kExtAudioFileProperty_ClientDataFormat, clientSize, &clientFormat);
This returns 1885696621, which I don't know how to interpret. :-(
So what am I doing wrong?
Would this code work on that mobile platform?
Thanks,
Rico
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden