Re: stuck on audio streams
Re: stuck on audio streams
- Subject: Re: stuck on audio streams
- From: William Stewart <email@hidden>
- Date: Wed, 14 Jan 2004 14:24:24 -0800
You need to set the permissions correctly
From the header file:
inPermissions - use the permission constants used by FSOpenFork().
On 14/01/2004, at 3:29 AM, Asher Vander Heiden wrote:
>
Hey all,
>
>
I've been attempting to work with the audio toolbox in order to get
>
audio files loading so I can look at the audio stream.
>
>
Here is my attempt after I have loaded a file into destFSRef:
>
>
AudioFileID outAudioFile;
>
SInt8 inPermissions;
>
inPermissions = 0;
>
>
AudioFileOpen (
>
&destFSRef,//const FSRef *inFileRef,
>
inPermissions,
>
0,//UInt32 inFlags,
>
&outAudioFile);
>
>
float outBuffer[300];
>
UInt32 ioNumBytes = 10;
This is the num bytes -> 10 bytes is 2.5 floats! (a float is 4 bytes!)
what you mean I think is, (300 * sizeof(float) - that's the space
you've allocated...
>
>
AudioFileReadBytes(
>
outAudioFile,//AudioFileID inAudioFile,
>
true,//Boolean inUseCache,
>
101,//SInt64 inStartingByte,
>
&ioNumBytes,
>
&outBuffer
>
);
>
>
NSString *str;
>
UInt32 i;
>
for (i = 0; i < 10; i++)
>
{
>
str = [NSString stringWithFormat:@"%g,",outBuffer[i]];
>
}
>
[uiAudioFileNowPlayingName setStringValue:str];
>
>
>
>
I would greatly appreciate it if someone could tell me what I am doing
>
wrong.
>
>
Thank you for your time....
>
>
_________________________________________________________________
>
Protect your inbox from harmful viruses with new ninemsn Premium.
>
Click here http://ninemsn.com.au/premium/landing.asp
>
_______________________________________________
>
coreaudio-api mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
>
Do not post admin requests to the list. They will be ignored.
>
>
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.