Recording with ALSA staring me in the face (and midi playback)

Finding the right app to record stuff is a bit of a pain on linux, and playing back midi files can be a trial also. But everything you need is right there in your alsa-utils package. Open up a terminal and let’s get going!

Recording from a microphone:

 arecord -f cd -t wav -c 2 -D plughw:1,0 foobar.wav

This will record you microphone input from your chosen soundcard (in this case card 1, device 0) at 2 channel CD quality, outputting to a wav file for you to play with later. To playback your recording:

aplay foobar.wav

For more information and options, simply type:

man aplay

OK, to play back midi files, you may need to ensure you have timidity installed. Then find a midi file (*.mid) or a kar file (*.kar) and download it. Then it is simply:

 aplaymidi -l

to find an open port, in my case 128:0, then:

 aplaymidi mymidifile.mid

If you want to get the best out of kar files, then install pykaraoke, it will play back the midi and highlight the lyrics through the song :)

Leave a Reply

Your email address will not be published. Required fields are marked *