Re: Converting from INT to Float samples
Re: Converting from INT to Float samples
- Subject: Re: Converting from INT to Float samples
- From: email@hidden
- Date: Mon, 25 Jun 2001 11:35:42 -0700
Hi Bill,
You're right... I've been type casting as an SINT16, but I was copying the
data using BlockMoveData : So it really didn't matter what I typecast it
in, the data ended up being correct for both my Out and In IOProcs. When I
moved it to the OutRenderer in the AudioUnit, I had a for loop copying the
bytes individually (which was typecast to SINT16) which messed everything
up.
Anyways, I casted the data to Float, and used BlockMoveData to copy the
data to the Renderer too and got it working now.
Thanks!
James
Bill Stewart
<email@hidden> To: <email@hidden>, Jeff Moore <email@hidden>
Sent by: cc: CoreAudio API <email@hidden>
coreaudio-api-admin@lists Subject: Re: Converting from INT to Float samples
.apple.com
06/23/01 01:53 PM
I think the confusion is about the format of the input device's samples.
They will also be Float32 - so when you pass them straight back to the
output device they sound fine. Correct?
This is the comment that bothers me:
>
> I am trying to "Record" some data from an AudioDevice -- Which ends up
in
>
> an SINT16 formatted array. If I play back this array using AudioDevice
>
> everything sounds OK.
>
>
>
> BUT, if I try to feed this out to the AudioUnit, it sounds quite bad. I
>
> assume this is because AudioUnit requires float samples over Sint.
To have these samples in an SINT16 array you'd have to have converted them
from the input format of floats (that the HAL publishes) to ints...
The DefaultOutputUnit just passes on the AudioBuffer from the HAL device to
your app. So if you took your input samples from the in device and give
them
as is, to the buffer of the output unit, they should sound just fine.
Bill
>
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
mailto:email@hidden
tel: +1 408 974 4056
__________________________________________________________________________
Cat: "Leave me alone, I'm trying to nap... Ah, What's that clicking noise?"
__________________________________________________________________________
_______________________________________________
coreaudio-api mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/coreaudio-api