• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Playing a audio file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Playing a audio file
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: iPhone SDK discussions?
  • Next by Date: AUFilePlayer
  • Previous by thread: Re: Steps to loading a SoundFont?
  • Next by thread: Re: Playing a audio file
  • Index(es):
    • Date
    • Thread