Playing a audio file
Playing a audio file
- Subject: Playing a audio file
- From: email@hidden
- Date: Sun, 13 Jul 2008 10:33:59 +0530 (IST)
- Importance: Normal
Hi,
I am new to iPhone app developer.
I want to play a op46.caf[audio file] which reside in Resources folder.I
tried lot but all in vain.
my code snippet :
NSBundle *bundle = [NSBundle mainBundle];
if(bundle)
{
NSString *moviePath = [bundle pathForResource:@"op467" ofType:@"vaf" ];
//CFStringRef ff=(CFStringRef)[NSString stringWithString:moviePath];
OSStatus status = noErr;
AudioFileID audioFile;
UInt32 propertySize;
NSTimeInterval seconds;
propertySize=sizeof(seconds);
CFURLRef MPfile = CFURLCreateWithFileSystemPath(NULL,
(CFStringRef)moviePath,
kCFURLPOSIXPathStyle, FALSE);
@try {
//status=AudioFileGetProperty(MPfile, 0x01 , <#UInt32 * ioDataSize#>,
<#void * outPropertyData#>)
status = AudioFileOpenURL(MPfile, 0x01, kAudioFileCAFType, &audioFile);
}
@catch (NSException * e) {
}
Is it right way to proceed for palying a audio file?
Any thing had to consider?
Any sample codes Please.......
its urgent, pls let me know.
_______________________________________________
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