Re: [linux-audio-dev] Converting float to int

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] Converting float to int
From: Daniel V. (dvenkita_AT_ecel.uwa.edu.au)
Date: Mon Oct 29 2001 - 19:36:01 EET


On Monday 29 October 2001 23:32, Paul Davis wrote:
> >Hi all. I know this has been answered before but I can't find the post :(
> >Anyway, the problem is I have a buffer of audio represented as floats
> > [-1,+1] that I want to convert to signed shorts for writing to my card.
> > I recall there is an efficient way of doing this, and an inefficient way.
> > Can someone remind me with a snippet of code?
>
> i think you're remembering the short<->int conversion, which sucks big
> time on intel h/w. there are hacks for that. i don't think there are
> any issues or quick workarounds for short<->float, but i could be
> wrong.

Yep, that's what I meant; thankfully Steve's code has allayed all concerns.

Cheers,

Daniel.


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Mon Oct 29 2001 - 19:24:38 EET