# cat /dev/dsp0.0



## bashrules (May 12, 2013)

Hi all,

I already asked this question at the Daemonforums a few days ago. Let me ask this question on this higher frequented forum, again. Back in the day, I could record voice via `$ cat /dev/dsp0.0 > sound.au`. Right now, I have FreeBSD 9.0 running on i386. Initially, the file size of sound.au is 0 bytes. After every 2 minutes and 15 seconds, the file size gets bumped up exactly 1 MB. Looks like /dev/dsp0.0 buffers 1 MB and pushes it then out in one chunk. Is there a way to change that to say 10 KB?

To make it worse, I hear only white noise when playing it back with `$ cat sound.au > /dev/dsp0.0`. I tested the microphone on an other computer (and Windows).

 Bash


----------



## jozze (May 12, 2013)

I don't think this is because of the devices, but because of the 'cat(1)()' command itself. You can try using 'dd(1)()' command instead. So if your microphone is at /dev/dspX: `$ dd if=/dev/dspX of=sound.au bs=10k`, which will make sure input and output chunks are at 10 KB. 

You can actually control sizes of both input and output chunks individually with ibs and obs. For best results it's best to actually leave out the bs.

If your audio card is located at /dev/dspY you can replay the file with `$ dd if=sound.au of=/dev/dspY`.


----------



## Anonymous (May 12, 2013)

bashrules said:
			
		

> ...
> To make it worse, I hear only white noise when playing it back with
> 
> $ cat sound.au > /dev/dsp0.0



Besides the valuable advices from @jozze, you want to check also the output of the command `$ mixer`:

For example, on my FreeBSD 9.1 server on which never has been touched anything regarding sound the output is:

```
Mixer vol      is currently set to  75:75
Mixer pcm      is currently set to  75:75
Mixer speaker  is currently set to  74:74
Mixer line     is currently set to  75:75
Mixer mic      is currently set to   0:0
Mixer mix      is currently set to   0:0
Mixer rec      is currently set to  75:75
Mixer igain    is currently set to   0:0
Mixer ogain    is currently set to  50:50
Mixer monitor  is currently set to  75:75
```
Note that the mic and igain levels are 0:0, i.e. are muted. So, if you didn't change anything here, you need to set the input gain and the mic level to values other than 0, in order to record sound, for example:

`$ mixer mic 75:75`
`$ mixer igain 75:75`

Perhaps you know the following already, however, it is worth to note it at least for the record. For `$ cat sound.au > /dev/dsp0.0` outputs the exact sound and not "white noise", the input format must be signed 8bit @ 8 kHz sample rate, because this is the default data format of the sound device. This would be the case, if you recorded the sound using the same device, but it is not necessarily the case for a file from another source.


----------



## bashrules (May 12, 2013)

Awesome. Now it works. Thanks guys.


----------

