TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

/dev/audio

132 pointsby Idekaover 13 years ago

12 comments

bodyfourover 13 years ago
That reminds me of a couple tricks I used to use in the old days. As an alarm clock I'd do:<p><pre><code> $ sleep 28800; while :; do cat /etc/termcap; done &#62;/dev/audio </code></pre> I found that termcap had just the right mix of structure and randomness to make an annoying noise that was <i>really</i> hard to sleep through.<p>Another classic was:<p><pre><code> $ ping -f hostname &#62;/dev/audio </code></pre> When you have zero packet loss, "ping -f" would generate an endless sequence of '.' and '\b' characters, resulting in a constant tone. When there is 100% loss you only get the '.' characters and the sound will stop. In between, you'll get a progressively noisier sound. Then just turn the speakers on your SPARCstation all the way up and crawl around the lab, flexing the 10base2 cabling until you find what segment is causing that irritating intermittent problem!
评论 #3213623 未加载
评论 #3215729 未加载
morganpyneover 13 years ago
We had a lot of fun with this in University 20 years ago. Our computer lab had a handful of shiny new Sun Sparcstations. The freshmen would regularly end up hogging them (no timelimit) and we needed them for project work, so we'd just remote login to them and cat some pre-recorded messages out to /dev/audio. A very official-sounding "Please log out now, system going down for maintenance" usually worked wonders, although occasionally more serious messing with people's minds was done. Some of the 1st year students had literally no idea what a computer was capable of and would believe anything that came out of its speakers. :D
评论 #3213739 未加载
评论 #3215231 未加载
评论 #3215290 未加载
sbierwagenover 13 years ago
From July 19, 2000: "Catting weird things to /dev/audio"<p><a href="http://everything2.com/user/mcc/writeups/catting+weird+things+to+%252Fdev%252Faudio" rel="nofollow">http://everything2.com/user/mcc/writeups/catting+weird+thing...</a><p>The eleven-year-old MP3 link in this article is dead, of course. I probably still have the files on a hard drive somewhere, but they're exactly what you would expect: weird looping noise.
评论 #3214085 未加载
rwl4over 13 years ago
Only mildly related, but I have fond memories of my friend and I needing to wake each other up at different points in the 90's, and we had our neat-o Linux boxes next to our beds, and we would create loops that would echo ^G's to a tty on the console.<p>But if you sent them too fast the sound would completely cease, so we would have to put a sleep 1 in the loop to make a nice consistent beep-beep-beep-beep, etc.<p>That always amused us, and sure was useful.
SickAnimationsover 13 years ago
I found people had posted audio interpretations of binary files on YouTube.<p>shell32.dll: <a href="http://www.youtube.com/watch?v=mqNLuunxp0o" rel="nofollow">http://www.youtube.com/watch?v=mqNLuunxp0o</a> itunes.exe: <a href="http://www.youtube.com/watch?v=iY-lJrX2VD0&#38" rel="nofollow">http://www.youtube.com/watch?v=iY-lJrX2VD0&#38</a>;
tommydover 13 years ago
Probably been posted before, but this reminds me of this rather awesome article about one-liner algorithms outputting to /dev/audio to create some really quite cool "compositions": <a href="http://createdigitalmusic.com/2011/10/entire-musical-compositions-made-from-just-one-line-of-code-are-glitchy-but-musical/" rel="nofollow">http://createdigitalmusic.com/2011/10/entire-musical-composi...</a><p>There's a site to try your own at: <a href="http://wurstcaptures.untergrund.net/music/" rel="nofollow">http://wurstcaptures.untergrund.net/music/</a>
pavel_lishinover 13 years ago
Alas, OS X doesn't seem to support anything like this.
评论 #3213312 未加载
评论 #3213361 未加载
评论 #3213494 未加载
petercooperover 13 years ago
Related from HN a few years ago: <a href="http://news.ycombinator.com/item?id=564568" rel="nofollow">http://news.ycombinator.com/item?id=564568</a> (not a dupe, but extra awesome stuff on the same topic)
RexRollmanover 13 years ago
How hard is it to output /dev/audio to a file instead of hardware? For example, to capture the output of streaming audio.
评论 #3213740 未加载
davidhollanderover 13 years ago
I believe this is specific to OSS, which was deprecated after it went closed source for a bit and ALSA replaced it:<p><a href="http://en.wikipedia.org/wiki/Open_Sound_System" rel="nofollow">http://en.wikipedia.org/wiki/Open_Sound_System</a><p>I'm fairly happy using the OpenAL API instead to generate audio cross-platform at the moment.
评论 #3214526 未加载
stylishgnomeover 13 years ago
A while ago I did a bit of reverse-engineering on this and figured out how to get it to play music.<p><a href="https://github.com/caoilteguiry/dev_music" rel="nofollow">https://github.com/caoilteguiry/dev_music</a><p>Explanation of how it works is pretty scant at the moment, I'll try to expand it a little when I get a chance.
keeperofdakeysover 13 years ago
Try the directory /dev/input/ for your input devices.
评论 #3214241 未加载