I have tried with more AudioStreamBasicDescription for m4a file format. Still I am getting some issues with that.
Please anyone tell me the exact AudioStreamBasicDescription for m4a file format.
I have tried with more AudioStreamBasicDescription for m4a file format. Still I am getting some issues with that.
Please anyone tell me the exact AudioStreamBasicDescription for m4a file format.
you can use ExtAudioFileGetProperty to get the ASBD from existing m4a audio file.
For more details Click here.
You can get ASBD of a file with 2 (at least) different methods. You can use ExtAudioFileGetProperty or AudioFileGetProperty .
AudioFileGetProperty:
NSString *soundFilePath = [[NSBundle mainBundle] pathForResource:@"sample" ofType:@"m4a"];
CFURLRef soundFileURL = (__bridge CFURLRef)[NSURL fileURLWithPath:soundFilePath];
if (soundFileURL != nil) {
AudioFileID audioFile;
OSStatus theError = noErr;
theError = AudioFileOpenURL(soundFileURL,
kAudioFileReadPermission,
0,
&audioFile);
if(theError != noErr) {
printf("AudioFileOpenURL failed!");
return;
}
AudioStreamBasicDescription asbd;
UInt32 size = sizeof(asbd);
theError = AudioFileGetProperty(audioFile, kAudioFilePropertyDataFormat, &size, &asbd);
if(theError != noErr) {
printf("kAudioFilePropertyDataFormat failed!");
return;
} else {
printf("Sample Rate : %f
", asbd.mSampleRate);
/*
Float64 mSampleRate;
AudioFormatID mFormatID;
AudioFormatFlags mFormatFlags;
UInt32 mBytesPerPacket;
UInt32 mFramesPerPacket;
UInt32 mBytesPerFrame;
UInt32 mChannelsPerFrame;
UInt32 mBitsPerChannel;
UInt32 mReserved;
*/
}
}
ExtAudioFileGetProperty:
NSString *soundFilePath = [[NSBundle mainBundle] pathForResource:@"sample" ofType:@"m4a"];
CFURLRef soundFileURL = (__bridge CFURLRef)[NSURL fileURLWithPath:soundFilePath];
if (soundFileURL != nil) {
OSStatus theError = noErr;
ExtAudioFileRef fileRef;
theError = ExtAudioFileOpenURL(soundFileURL, &fileRef);
if(theError != noErr) {
printf("ExtAudioFileOpenURL failed!");
return;
}
AudioStreamBasicDescription asbd;
UInt32 size = sizeof(asbd);
theError = ExtAudioFileGetProperty(fileRef, kExtAudioFileProperty_FileDataFormat, &size, &asbd );
}
I am trying to convert caf file to m4a file using AudioUnit. I have implemented the code to convert. When I tried to run the application, I am getting following error message; couldn t set ...
I have tried with more AudioStreamBasicDescription for m4a file format. Still I am getting some issues with that. Please anyone tell me the exact AudioStreamBasicDescription for m4a file format.
I am trying to play m4a(http://a1.phobos.apple.com/us/r1000/020/Music/ad/41/da/mzm.fkekhvue.aac.p.m4a) file from iTunes affiliates using AvAudioPlayer but can not able to play it. I think there is ...
Already I have created an iPhone application to record. It will record in .caf file. But I want to record in .m4a format. Please help me to do this. Thanks.
I m looking for a (free) flash player that I can embed in my site and use to play a .m4a (.mp4 with AAC audio) file that will be obtained using a URL (i.e. it s not local to the server hosting the web ...
I m working with a simple mediaplayer based on this msdn example where the user can control volume, playback speed (SpeedRatio) and seek (Position) using 3 sliders. Everything works correctly when I ...
I currently have a FileUpload.mxml component that uploads a .m4a to an oracle database, retrieves metadata from the file and saves the metadata info in the database. to acheive this I use ...
I ve got some heavily modified code that ultimately came from the Windows Media SDK that works great for reading tags out of MP3 and WMV files. Somewhere along the line, Windows Media Player added ...