This command creates and burns a gapless audio CD with 99 tracks. Each track is a 30 second sine wave, the first is 1 Hz, the second 2 Hz, and so on, up to 99 Hz. This is useful for testing audio systems (how low can your bass go?) and for creating the constant vibrations needed to make non-Newtonian fluids (like cornstarch and water) crawl around.
Note, this temporarily creates 500MB of .cdda files in the current directory. If you don't use the "rm" at the end of the command, you can burn more disks using
cdrdao write cdrdao.toc
Prerequisites: a blank CD-R in /dev/cdrw, sox (http://sox.sourceforge.net/), and cdrdao (http://cdrdao.sourceforge.net/). I'm also assuming a recent version of bash for the brace expansion (which just looks nicer than using seq(1), but isn't necessary).
Show Sample Output
This one uses dictionary.com
change the *.avi to whatever you want to match, you can remove it altogether if you want to check all files.
find . -type f -iname '*.flac' # searches from the current folder recursively for .flac audio files | # the output (a .flac audio files with relative path from ./ ) is piped to while read FILE; do FILENAME="${FILE%.*}"; flac -cd "$FILE" | lame -b 192 - "${FILENAME}.mp3"; done # for each line on the list: # FILE gets the file with .flac extension and relative path # FILENAME gets FILE without the .flac extension # run flac for that FILE with output piped to lame conversion to mp3 using 192Kb bitrate Show Sample Output
Pick a mp3 at random and play it. Assumes the availability of locate with an updated db and mpg123 Not the most useful command I guess, but all of the really useful ones are taken...
Do you have an entire album in a unique file and want to split it in individual tracks? If you also have the cue file you can do it!
Packages for Debian-based systems users:
* cuetools shntool
* FLAC (.flac): flac
* WavPack (.wv): wavpack
* Monkey's Audio (.ape): libmac2 monkeys-audio (deb http://www.debian-multimedia.org sid main)
NOTE: "sid" packages are unstable, but I didn't have problems with them. If you prefer, use the "stable" version repository.
To transfer the tags, you can use this (works with .flac, .ogg and .mp3):
cuetag sample.cue split-track*.flac
Show Sample Output
This will record the capture channel of your soundcard, directly encoded in Ogg Vorbis, in stereo at quality 5 (I'm using this to record live jam sessions from my line input). You can choose which device to capture (eg. line input, microphone or PCM output) with
alsamixer -V capture
You can do the same thing and live encode in MP3 or FLAC if you wish, just check FLAC and LAME man pages.
rips the audio and video stream of a movie. The two streams are stored separately.
Record from a webcam, audio using ALSA encoded as MP3, video as MPEG-4.
The original was a little bit too complicated for me. This one does not use any variables.
Takes all .flac directories, feeds them into a simple transcode pipeline to spit out .wavs with the same name (but correct extension).
Useful contexts : You are doing yoga or some other physical training in which you are holding a position. Or you practice the pomodoro productivity technique. Or your girlfriend said "We're leaving in 40 minutes". Design details: sleep executes before espeak to give you a 5 seconds head start. espeak is run in the background so it doesn't mess up the timing.
This will lower the quality of mp3 files, but is necessary to play them on some mobile devices.
This assumes that there is a 10.2 sec delay between the video and the audio (delayed). To extract the original video into a audio and video composites look at the command on extracting audio and video from a movie
Record audio to an MP3 file via ALSA. Adjust -i argument according to arecord -l output.
Creates a 5 minute flv file, with the given sequence of images and audio with 0.5 fps. The images were created using the following command: for x in `seq 0 300`; do cp ../head.PNG head-`printf '%03d' $x`.png; done You can also inject metadata to seek easier using yamdi as follows: yamdi -i muxed.flv -o video.flv Show Sample Output
Using mplayer to extract audio file from a CD
There are some pretty good live performances on late night TV. With Mythtv I record David Letterman, Jimmy Fallon, and Conan nightly all in HD from over the air broadcasts. If I find a live performance I like I copy it to my Rockboxed iPod using this command. The Rockbox firmware knows how to downmix 5.1 audio. The command above extracts the audio from the video starting at 58 minutes and 15 seconds. It ends at the end of the file since this was the last performance of the recording. The command creates an ac3 file. I copy the ac3 file to my Rockbox iPod and rock on.
Takes two input video files and an external audio track and encodes them together to an MPEG-4 DivX output video file with the correct size ready for uploading.
Looks up a word on merriam-webster.com, does a screen scrape for the FIRST audio pronunciation and plays it.
USAGE: Put this one-liner into a shell script (e.g., ~/bin/pronounce) and run it from the command line giving it the word to say:
pronounce lek
If the word isn't found in merriam-webster, no audio is played and the script returns an error value. However, M-W is a fairly complete dictionary (better than howjsay.com which won't let you hear how to pronounce naughty words).
ASSUMPTIONS: GNU's sed (which supports -r for extended regular expressions) and Linux's aplay. Aplay can be replaced by any program that can play .WAV files from stdin.
KNOWN BUGS: only the FIRST pronunciation is played, which is problematic if you wanted a particular form (plural, adjectival, etc) of the word. For example, if you run this:
pronounce onomatopoetic
you'll hear a voice saying "onomatopoeia".
Playing the correct form of the word is possible, but doing so might make the screen scraper even more fragile than it already is. (The slightest change to the format of m-w.com could break it).
Show Sample Output
The FLAC audio must be encoded at 16000Hz sampling rate (SoX is your friend). Outputs a short JSON string, the actual speech is in the hypotheses->utterance, the accuracy is stored in hypotheses->confidence (ranging from 0 to 1). Google also accepts audio in some special speex format (audio/x-speex-with-header-byte), which is much smaller in comparison with losless FLAC, but I haven't been able to encode such a sample. Show Sample Output
-vn removes tha video content, the copy option tells ffmpeg to use the same codec for generating the output
Takes an mpeg video and coverts it to a youtube compatible flv file. The -r 25 sets the frame rate for PAL, for NTSC use 29.97
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: