Re: sound through enbd
[email protected] (Peter T. Breuer)
| Newsgroups | gmane.linux.enbd.general |
|---|---|
| Message-ID | <[email protected]> |
Dag Sverre Seljebotn <[email protected]> wrote: > > Any insight on what the proper format is for /dev/audio :-)? Sox really > > is not doing a good job of converting .wav's for me, and it stands to > > reason that I am not using the correct format parameters! > > bplay is your friend... (if I understand your question correctly) I don't know if you do :). I have "play" (part of sox) and it works well, but it does so by using dsp as output and configging it to use whatever format is flavour of the day for it given free choice, and it isn't .au. What I want is .au format, because it won't need a dma channel to get /dev/audio working. If you look in soundcard.h you will find: * Audio data formats (Note! U8=8 and S16_LE=16 for compatibility) * */ #define SNDCTL_DSP_GETFMTS _SIOR ('P',11, int) /* Returns a mask */ #define SNDCTL_DSP_SETFMT _SIOWR('P',5, int) /* Selects ONE fmt*/ # define AFMT_QUERY 0x00000000 /* Return current fmt */ # define AFMT_MU_LAW 0x00000001 # define AFMT_A_LAW 0x00000002 # define AFMT_IMA_ADPCM 0x00000004 # define AFMT_U8 0x00000008 # define AFMT_S16_LE 0x00000010 /* Little endian signed 16*/ # define AFMT_S16_BE 0x00000020 /* Big endian signed 16 */ # define AFMT_S8 0x00000040 # define AFMT_U16_LE 0x00000080 /* Little endian U16 */ # define AFMT_U16_BE 0x00000100 /* Big endian U16 */ # define AFMT_MPEG 0x00000200 /* MPEG (2) audio */ # define AFMT_AC3 0x00000400 /* Dolby Digital AC3 */ and I can advertise that I understand any or all of those formats, but I don't really know which one /dev/audio understands, and I don't know which magic parameters are required for sox to produce one of them. As I said, sox foo.wav -t ul -U -c 2 -r 4000 /dev/audio resample seems to produce recognizable speech from a 44.1KHz .wav file, but it's horribly "muffled" sounding. replacing the ul with au sounds better, and replacing the -c2 with nothing sounds even better. OTOH on another .wav file s input the situation is reversed. So I would like somebody to definitively TELL me what format I shoudl use for /dev/audio, and what magic to give to sox to get it. (all the above travel fine across enbd) Peter Peter