public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] [OT] Shell redirection magic for audio capture?
@ 2005-12-28 20:27 michael higgins
  0 siblings, 0 replies; only message in thread
From: michael higgins @ 2005-12-28 20:27 UTC (permalink / raw
  To: gentoo-user

Hello all.

Being comparatively clueless, I've considered this particular problem for a long time. I finally came to what I believe is a solution, but a clunky one. Can any shell wizards make this work any better? Is there some other solution?

In other words, it works, but I'd like to put an example up somewhere as a good method to be able to capture sound in progress. It wasn't obvious to me, so I hope it might help the next one like me. So, any suggestions as to how this method can be improved? 

The procedure:

$ mkfifo audio_cat
$ mkfifo to_null

$ cat to_null> /dev/null& \
(cat audio_cat|AudioCompress -C -s 15 -m | \
tee to_null| aplay -r 22050 -f S16_LE -c 2 -D plug:hw:0)&\ 
mplayer -bandwidth 96 -cache 64 -ao pcm:file=audio_cat -playlist "http://asx.abacast.com/kboo.asx?ref=js&embedded=false&timeout=false&uofc=false"

... So, now I hear something coming up I want to capture:

$ cat to_null | sox -r 22050 -c 2 -w -s -t .raw - -r 44100 -c2 -w -s -t .wav test.wav

$ <ctl-c>

... etc.

So, it seems to work pretty well. It's a little glitchy when everything is loading.

AO: [pcm] 22050Hz 2ch s16le (2 bps)
Building audio filter chain for 22050Hz/2ch/s16le -> 22050Hz/2ch/s16le...
Video: no video
Starting playback...
Playing raw data 'stdin' : Signed 16 bit Little Endian, Rate 22050 Hz, Stereo
underrun!!! (at least 648.999 ms long)
underrun!!! (at least 496.815 ms long)
underrun!!! (at least 623.697 ms long)
underrun!!! (at least 117.697 ms long)
underrun!!! (at least 523.569 ms long)
A:1392.5 (23:12.4) 85.0% 0%

But, then solid as a rock, I think. 

. . .

So, I'm just looking for any comments or suggestions, I guess.

Have a good New Year, Getoo-ers!

-- 
 |\  /|        |   |          ~ ~  
 | \/ |        |---|          `|` ?
 |    |ichael  |   |iggins    \^ /
 michael.higgins[at]evolone[dot]org
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-12-28 20:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-28 20:27 [gentoo-user] [OT] Shell redirection magic for audio capture? michael higgins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox