Commands tagged audio (65)

  • Then run with, play "franz ferdinand the fallen" If you're running mpv, use this function: play() { mpv --cache=4096 --cache-initial=256 <(youtube-dl -f 140 -o - ytsearch:"$1"); }


    0
    play() { mplayer -cache 4096 -cache-min 5 <(youtube-dl -f 140 -o - ytsearch:"$1"); }
    ryanmjacobs · 2014-12-23 03:31:57 0

  • 0
    ffmpeg -i orig_video.wmv audio_out.wav
    lolssl · 2015-10-02 12:55:39 0
  • The "map" may be different depending on the .wmv file. run `ffprobe` to see which is the video-track in the .wmv file usually this is "0.0". Stream #0.0: Video:... Stream #0.1: Audio: .. and "1.0" corresponds to the 2nd input file - your new audio. You may want to add "-acodec wmav2" and "-ar 128k" options for 128kbit/s Windows Media Audio 2 or whatever audio-codec/quality your want. `ffmpeg -codecs | grep "EA"` gives you a list of available codecs for Encoding Audio. Try using '-sameq' instead of '-vcodec copy' (re-encode the video with same quality rather than a bit-exact copy - this often solves muxing issues but will cause a small loss of either video quality or increased bandwidth). and also try a different output format eg. 'new_video.avi' or '..mov' instead of 'new_video.wmv'. you may need both, this should work: ffmpeg -i vid.wmv -i aud.wav -sameq -map 0.0 -map 1.0 output.avi


    0
    ffmpeg -i orig_video.wmv -i new_audio.wav -vcodec copy -map 0.0 -map 1.0 new_video.wmv
    lolssl · 2015-10-02 12:56:27 0

  • 0
    mplayer -ao pcm:fast:file=audio.wav -vo null -vc null video.avi
    lolssl · 2015-10-02 12:58:07 0

  • 0
    lame -V0 -q0 --vbr-new audio.wav audio.mp3
    lolssl · 2015-10-02 12:58:42 0
  • Uses ffmpeg to convert all that annoying .FLAC files to MP3 files keeping all the Artist's information in them. There's not much more to it. Show Sample Output


    0
    find . -name "*.flac" -exec ffmpeg -i {} -ab 160k -map_metadata 0 -id3v2_version 3 {}.mp3 \;
    gustavohmsilva · 2016-06-28 19:35:06 0
  • Replace video and audio extension according to your needs


    0
    ffmpeg -i file.video file.audio
    miskopo · 2016-07-19 08:39:24 0
  • Uses soxi instead of mplayer


    0
    soxi -D * | awk '{SUM += $1} END { printf "%d:%d:%d\n",SUM/3600,SUM%3600/60,SUM%60}'
    hufman · 2017-04-08 17:37:03 0
  • All the other example fail when running in a folder containing too many files due to * being saturated. This command does not use *, allowing me to run it in one folder containing over 300000 audio files. As to running on so many files, I used GNU parallel in order to spawn as many processes as cores, tremendously fasting up the process. Show Sample Output


    0
    ls|grep ".wav"|parallel -j$(nproc) soxi -D {}|awk '{SUM += $1} END { printf "%d:%d:%d\n",SUM/3600,SUM%3600/60,SUM%60}'
    jupiter126 · 2017-05-02 21:37:24 0
  • Tries to switch all audio devices to the A2DP profile for optimal sound quality. Useful for bluetooth speakers and headphones that always power up in HSP/HFP mode. Note however that this command is only a shorthand for the GUI, so it cannot fix stubborn BT controllers that leave your device stuck in HSP mode until a manual re-coupling.


    0
    for card in $(pacmd list-cards | grep 'name: ' | sed 's/.*<\(.*\)>.*/\1/'); do pacmd set-card-profile $card a2dp_sink; done
    lordtoran · 2019-04-18 18:01:45 1

  • -1
    for f in *.ogg ; do mplayer -quiet -vo null -vc dummy -ao pcm:waveheader:file="$f.wav" "$f" ; done
    ideasman42 · 2009-02-23 10:09:10 2
  • The quality ranges between 0 to 9, with the smaller number indicates a higher quality file but bigger too.


    -1
    lame -h -V 6 track9.wav track9.mp3
    dcabanis · 2009-05-23 23:27:20 0
  • Is a simple script for video streaming a movie


    -1
    cat video.ogg | nc -l -p 4232 & wget http://users.bshellz.net/~bazza/?nombre=name -O - & sleep 10; mplayer http://users.bshellz.net/~bazza/datos/name.ogg
    el_bazza · 2010-11-29 03:34:31 1
  • I often run some command that takes a while to finish. By putting the say command afterward, I get an audio notification. Please note that this command (say) only works on Mac OS X and not Linux.


    -2
    long_command; say I am all done
    haivu · 2010-01-27 19:03:01 1
  • this will increase the volume by 2 decibels on the pcm channel. the argument to -c is for which sound card to use, the arg after set is the channel (PCM, Master, etc.) and what to set by. related commands: amixer -c 0 set PCM 2dB- decrease volume by 2 decibels amixer -c 0 set PCM toggle toggle mute/unmute this is for alsa systems for mac os (and maybe other UNIX systems) osascript -e 'set Volume *' where * is any number (can have decimal points) between 0 and 10


    -4
    amixer -c 0 set PCM 2dB+
    Fate · 2009-02-22 22:06:46 0
  •  < 1 2 3

What's this?

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.

Share Your Commands


Check These Out

Import SQL into MySQL with a progress meter
This uses PV to monitor the progress of the MySQL import and displays it though Zenity. You could also do this pv ~/database.sql | mysql -u root -pPASSWORD -D database_name and get a display in the CLI that looks like this 2.19MB 0:00:06 [ 160kB/s] [> ] 5% ETA 0:01:40 My Nautalus script using this command is here http://www.daniweb.com/forums/post1253285.html#post1253285

Selecting a random file/folder of a folder
I used only shuf command.

Find duplicate UID in /etc/passwd
You can use only awk

Combine all .mpeg files in current directory into one big one.
Good old cat & output redirection. Using this method you can combine all kinds of things - even mpeg files. My video camera makes a series of .mpeg files that are broken into 4gb chunks. Using this command I can easily join them together. Even better, combined with the cp command the files can be copied and joined in one step.

C function manual

seq can produce the same thing as Perl's ... operator.
Optionally, one can use {1..50} instead of seq. E.g. for i in {1..50} ; do echo Iteration $i ; done

list block devices
Shows all block devices in a tree with descruptions of what they are.

Find common lines between two files

list and sort files by size in reverse order (file size in human readable output)
This command list and sort files by size and in reverse order, the reverse order is very helpful when you have a very long list and wish to have the biggest files at the bottom so you don't have scrool up. The file size info is in human readable output, so ex. 1K..234M...3G Tested with Linux (Red Hat Enterprise Edition)

bash or tcsh redirect both to stdout and to a file
When plumbers use pipes, they sometimes need a T-joint. The Unix equivalent to this is 'tee'. The -a flag tells 'tee' to append to the file, rather than clobbering it. Tested on bash and tcsh.


Stay in the loop…

Follow the Tweets.

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

Subscribe to the feeds.

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: