• 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
Re: afinfo
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: afinfo


  • Subject: Re: afinfo
  • From: Robert Martin <email@hidden>
  • Date: Fri, 5 Nov 2010 10:42:06 -0400

Try AudioFileOpenURL and AudioFileGetProperty (not ExtAudioFile)

On Nov 5, 2010, at 9:52 AM, email@hidden wrote:

> Hi,
>
> I tried to get the kAudioFilePropertyEstimatedDuration property,
> but I always receive an error ( NSLog(@"property error") )
> and the value of seconds is 0.
> What am I doing wrong ?
> I would be very thankful for an answer.
>
> Karsten
>
>
> -(void) duration
>
> {
> 	NSURL *inputFileURL = [NSURL fileURLWithPath:PathName];
> 	OSStatus Error = noErr;
> 	ExtAudioFileRef file;
> 	Error = ExtAudioFileOpenURL((CFURLRef)inputFileURL, &file);
> 		if(Error != 0) NSLog(@"file not loaded");
> 	NSTimeInterval seconds;
> 	//Float64 seconds; ??
> 	UInt32 propertySize = sizeof(seconds);
> 	Error = ExtAudioFileGetProperty(file, kAudioFilePropertyEstimatedDuration, &propertySize, &seconds);
> 	    if(Error != 0) NSLog(@"property error");
>
> 	NSLog(@"duration: %f", seconds);
> 	if(Error != 0) NSLog(@"error");
>        //printf("duration %f \n",seconds);
>
> 	ExtAudioFileDispose(file);
>
> }

 _______________________________________________
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: afinfo
      • From: Jean-Daniel Dupas <email@hidden>
References: 
 >Re: afinfo (From: "email@hidden" <email@hidden>)

  • Prev by Date: Re: HELP : a bit OT : internal speakers as disappears form the audio out menu
  • Next by Date: Re: afinfo
  • Previous by thread: Re: afinfo
  • Next by thread: Re: afinfo
  • Index(es):
    • Date
    • Thread