Subject: Re: [linux-audio-dev] CDDA interface - How to convert to float? Any library?
From: Erik de Castro Lopo (erikd-lad_AT_mega-nerd.com)
Date: Sun Aug 11 2002 - 02:38:42 EEST
On Sat, 10 Aug 2002 18:32:36 -0500
Mark Rages <markrages_AT_mlug.missouri.edu> wrote:
> Ahh, I forgot CDDA is signed.
>
> Yes, I meant the u16 in the general sense that you picked up on.
>
> Well, you can try a byte-swap like this:
>
> #include <string.h> // for swab()
> #include <asm/byteorder.h> // for __LITTLE_ENDIAN macro
In my last replay I suggested that you not use headers like <linux/*.h>
and in this one, I'm goint to suggest that you not use <asm/*.h> headers.
You will also find __LITTLE_ENDIAN (and __BIG_ENDIAN) in <endian.h> which
is designed to be used in user space programs.
Erik
-- +-----------------------------------------------------------+ Erik de Castro Lopo nospam_AT_mega-nerd.com (Yes it's valid) +-----------------------------------------------------------+ "Attacks by Microsoft Chairman Bill Gates on the GNU General Public License, under which much open source and free software is distributed, have been driven by a fear that the GPL creates a domain of software that Microsoft cannot privatize and control" -- Richard Stallman
This archive was generated by hypermail 2b28 : Sun Aug 11 2002 - 02:40:05 EEST