=================================================================== RCS file: /cvsrepo/anoncvs/cvs/www/Attic/audio-port.html,v retrieving revision 1.9 retrieving revision 1.10 diff -c -r1.9 -r1.10 *** www/Attic/audio-port.html 2004/11/05 21:57:05 1.9 --- www/Attic/audio-port.html 2007/06/01 19:54:48 1.10 *************** *** 102,122 ****

This is about the smallest code fragment that will deal with most issues. !

16 bit formats and endianess

In normal usage, you just ask for an encoding type (e.g., AUDIO_ENCODING_SLINEAR), and you retrieve ! an encoding with endianess (e.g., AUDIO_ENCODING_SLINEAR_LE). ! Considering that a soundcard does not have to use the same endianess as your platform, you should be prepared to deal with that. The easiest way is probably to prepare a full audio buffer, and to use ! swab(3) if an endianess change is required. Dealing with external samples usually amounts to:
  1. Parsing the sample format,
  2. Getting the sample in, !
  3. Swapping endianess if it is not your native format,
  4. Computing what you want to output into a buffer, !
  5. Swapping endianess if the sound card is not in your native format,
  6. Playing the buffer.
Obviously, you may be able to remove steps 3 and 5 if you are simply --- 102,122 ----

This is about the smallest code fragment that will deal with most issues. !

16 bit formats and endianness

In normal usage, you just ask for an encoding type (e.g., AUDIO_ENCODING_SLINEAR), and you retrieve ! an encoding with endianness (e.g., AUDIO_ENCODING_SLINEAR_LE). ! Considering that a soundcard does not have to use the same endianness as your platform, you should be prepared to deal with that. The easiest way is probably to prepare a full audio buffer, and to use ! swab(3) if an endianness change is required. Dealing with external samples usually amounts to:
  1. Parsing the sample format,
  2. Getting the sample in, !
  3. Swapping endianness if it is not your native format,
  4. Computing what you want to output into a buffer, !
  5. Swapping endianness if the sound card is not in your native format,
  6. Playing the buffer.
Obviously, you may be able to remove steps 3 and 5 if you are simply *************** *** 271,276 **** Porting www@openbsd.org !
$OpenBSD: audio-port.html,v 1.9 2004/11/05 21:57:05 saad Exp $ --- 271,276 ---- Porting www@openbsd.org !
$OpenBSD: audio-port.html,v 1.10 2007/06/01 19:54:48 aanriot Exp $