I want to know "How to get clear sound from /dev/dsp".
I use the ioctl function in order to get 16bit signed
integer, 8KHz sampled sound.
But the sound(voice) gotten from /dev/dsp (by opening /dev/dsp and
reading that file_descriptor(fd) ) is not clear. There is some noise
(or scratch sound) in voice.(I think that it is not
a problem of sound-card/microphone)
I tried to open /dev/dsp with O_RDONLY and read the fd
for some seconds to get voice, saved the voice data in memory.
After that, I closed the fd, reopen /dev/dsp with
O_WRONLY, and write the saved voice data to a new file-descriptor.
In this manner, I didn't hear scratch-sound.
But opening /dev/dsp with O_RDWR, and read/write voice data make
some scratch sound.
open O_RDONLY -> read sound -> close ->
open O_WDONLY -> write sound -> close -> open O_RDONLY -> ...
It means that a sound-block read from sound_card
(not voice data of some duration) is played back as soon as possible
Repeating this sequence also makes scratch sound which is the bigger
scratch sound than the sound of O_RDWR mode.
I want to open /dev/dsp O_RDWR, set up the file descriptor
to full duplex mode, and read/write the fd without scrath sound.
Is it impossible to reduce scratch sound in opening /dev/dsp
withO_RDWR mode ?
Thank you for reading...