Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm interested in creating musical programs like these:

http://www.youtube.com/watch?v=GtQdIYUtAHg&feature=player_embedded

Essentially these programs just generate sequences of integers, which (apparently), when fed directly into a 8khz audio stream (like "/dev/audio"), produce interesting music.

My problem is that my system does not have /dev/audio. In fact, looking through my /dev, it's unclear to me whether any of the devices is a direct audio interface.

I have two questions:

  1. Is there a nice package which will let me pipe in a stream of numbers from the command line, and produce a matching 8Khz audio output?

  2. If not, how might I go about directly accessing my audio device?

share|improve this question
1  
Answered my own question, but can't put it in as an answer yet (not enough reputation). This works fine for me: ./a.out | aplay –  John Doucette Oct 2 '11 at 5:20
add comment

2 Answers 2

up vote 2 down vote accepted

This worked out fine for me:

./a.out | aplay
share|improve this answer
    
Thanks! And you probably have enough reputation now to mark that as the answer. –  phyzome Jan 21 '13 at 2:52
add comment

From the video it looks like they are using PCM. On Ubuntu try using /dev/snd/pcm*

share|improve this answer
    
So I've tried ./a.out > /dev/snd/pcm[some identifier] for all /dev/snd/pcm*. None of them produce audible sounds. Is there something extra I need to do? –  John Doucette Oct 2 '11 at 5:06
    
You might need to set the volume: manpages.ubuntu.com/manpages/gutsy/man1/amixer.1.html –  polynomial Oct 2 '11 at 5:08
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.