Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How hard is it to output /dev/audio to a file instead of hardware? For example, to capture the output of streaming audio.


That's so simple and old school !!

cat /dev/audio > record.au

Here you will get Sun .au, which is mulaw IIRC.

/dev/dsp is different.

EDIT - after a quick google search, here are some details on the encoding difference : OSS has three kind of device files for audio programming. The only difference between these device files is the default sample encoding used after opening the device. /dev/dsp uses 8 bit unsigned encoding while /dev/dspW uses 16 bit signed little endian (Intel) encoding and /dev/audio uses logarithmic mu-Law encoding. There are no other differences between the devices. All of them work in 8 kHz mono mode after opening them.

http://www.opensound.com/pguide/audio.html


That will capture the microphone input; it won't capture the sound that the computer is playing, which is what I think the comment you are replying to wants.


Oops, I thought the original poster to record, like a dictaphone.


Thank you!




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: