Re: afinfo
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
References: | |
| >Re: afinfo (From: "email@hidden" <email@hidden>) |