lingxiang_zheng@163.net wrote:
I have downloaded the mad 0.13.0b. I'm trying to use it to play mp3 on my ARM720T CPU. But I only have an 8-bits dsp sound decoder, so in the normal way, the mad product terrible sounds (I used --downsample and --mono). I have changed the default requested format to AFMT_U8 in audio_oss.c. After rebuilding the mad, I run the command "./madplay -v --downsample --mono --output=raw:/dev/dsp 03.mp3". But I still get terrible sounds. I also try the command "./madplay -v --downsample --mono --output=wav:03.wav 03.mp3". And then I use my PC to play the 03.wav. I found that the sound is good, while using the command "cat 03.wav > /dev/dsp" on ARM, I got bad sound. So I think that the format may not changed to AFMT_U8. Can anyone check the code for me? I only made three changes( I marked them 1,2,3).
The following begin at line 96 in audio_oss.c
The audio_oss module is not used for the --output=raw: or wav: formats, so your changes have no effect in those modes.
Also, the default audio parameters for /dev/dsp may not be what you expect, so using `cat' or the raw: output format is not usually a good idea since no attempt will be made to change those parameters from their current settings.
You should either try to use the audio_oss module (by not specifying an output option, assuming OSS is your default) or modify the other audio_* modules to provide the correct output bit depth.
Eventually I think I'd like to extend the output option specification to allow bit depths to be specified at runtime.
Cheers,