Re: Convert to float and more
Re: Convert to float and more
- Subject: Re: Convert to float and more
- From: "Mark's Studio" <email@hidden>
- Date: Thu, 5 Jun 2003 22:57:49 +0200
On torsdag, jun 5, 2003, at 22:27 Europe/Copenhagen, Brian Willoughby
wrote:
>
I'm confused. If you want to convert the entire audio file to float
>
when
>
opened, then you can easily use the AudioConverter to do this.
>
>
Are you saying that you'll then need float-to-int on a single sample
>
basis for
>
drawing routines or such?
No just the opposite :)
The app could open any file the audiofile api could handle, and when i
wanted to play the file i just passed the data, and the
AudioStreamBasicDescription in the original format to the output.
but all the drawing use openGL and that can use float,
so if the original audiofile was 16bit i had to convert it to float for
the OpenGl drawing.
and the same for the DSP.
but now i've changed, so i convert the file to float on import, now i
can just pass the sample without any i2f conversion.
and it's much faster.
PS
is this the correct format for 8 bit?
destinationFormat.mSampleRate = 44100.0;
destinationFormat.mFormatID = kAudioFormatLinearPCM;
destinationFormat.mFormatFlags = 14;
destinationFormat.mBytesPerPacket = 2;
destinationFormat.mFramesPerPacket = 1;
destinationFormat.mBytesPerFrame = 2;
destinationFormat.mChannelsPerFrame = 2;
destinationFormat.mBitsPerChannel = 8;
What is the smallest buffer size AudioConverterConvertBuffer() can use
and still be fast?
>
>
Brian Willoughby
>
Sound Consulting
>
>
[ This is exactly my problem i need it on single sample basis.
>
[
>
[ My original idea was to open the audiofile and keep the audio in
>
[ its original format, all my drawing and DSP functions works with
>
[ float values, so i can see that the bottlenecks are the conversion
>
[ to float, plus all the extra code to handle the different sample
>
[ formats in every function.
>
[
>
[ So i think i've come to the conclusion that i want to try and
>
[ convert the audiofile to float when opened, even though the size
>
[ will be 2-4 times bigger, i hope it will be faster to skip all
>
[ the conversion compared to the increase in size.
>
>
Peter Mark
Mark's Recording Studio A/S
Lundeskovsvej 3 2900 Hellerup
Denmark
Tel: +45 35366078 Fax: +45 35366038
www.marks-studio.dk
email@hidden
_______________________________________________
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.