Hi!
Is it possible to write a sound file to /dev/dsp and hear the right sound? I've tried it with .WAV but it isn't working. If it's possible please tell me which sound format it is
Thanks
Sound question
Re:Sound question
That sounds suspiciously like a pure linux (or other similar OS) question to me, rather than a OSdev one...
Re:Sound question
Hmm.. So i asked that because i've ported sound driver from linux. So now it's working under VMware and i'd like to play something easily. I just don't know how
Re:Sound question
And for those who wonder: yes, the old OSS drivers work exactly that way. You dump raw data into /dev/dsp and it gets played. Format/samplerate/whatever can be configured with various ioctl()-calls (surprise?).
If one just dumps a .wav into /dev/dsp, one will normally hear it, but it will be played with the default settings (which might be 8-bit unsigned ?-Law mono 22050 or pretty much anything else) which naturally can do all kinds of funny things with the sound. In addition, there will be a burst of noise in the beginning of the sound, because .wav files contain a header, which is not audio data, and throwing that through speakers makes no sense. Finally, this is assuming the .wav isn't compressed, which actually is possible.
If one just dumps a .wav into /dev/dsp, one will normally hear it, but it will be played with the default settings (which might be 8-bit unsigned ?-Law mono 22050 or pretty much anything else) which naturally can do all kinds of funny things with the sound. In addition, there will be a burst of noise in the beginning of the sound, because .wav files contain a header, which is not audio data, and throwing that through speakers makes no sense. Finally, this is assuming the .wav isn't compressed, which actually is possible.
Re:Sound question
Common way for computer nerd to test whether the sound card works:mystran wrote: And for those who wonder: yes, the old OSS drivers work exactly that way. You dump raw data into /dev/dsp and it gets played. Format/samplerate/whatever can be configured with various ioctl()-calls (surprise?).
Code: Select all
cat /dev/hda >/dev/dsp
Re:Sound question
Yeah... Just some IOCTL were missing... That was the problem first time i tried WAV
Re:Sound question
This is one thing I'm going to try out, heh.Candy wrote:Common way for computer nerd to test whether the sound card works:mystran wrote: And for those who wonder: yes, the old OSS drivers work exactly that way. You dump raw data into /dev/dsp and it gets played. Format/samplerate/whatever can be configured with various ioctl()-calls (surprise?).NTFS sounds rather funny actuallyCode: Select all
cat /dev/hda >/dev/dsp