Skip to content

Instantly share code, notes, and snippets.

@gugat
Last active August 29, 2015 14:04
Show Gist options
  • Save gugat/39c09bc518f034ab90eb to your computer and use it in GitHub Desktop.
Save gugat/39c09bc518f034ab90eb to your computer and use it in GitHub Desktop.
Take song name from file and play it with mplayer
#!/usr/bin/ruby
a = IO.readlines("/home/guga/Music/playlist_regueton").each do |line|
if !line.strip.empty?
cmd = `find '/media/guga/Mi disco/' -name #{line.strip}*`
puts cmd
`mplayer "#{cmd.strip}"`
end
end
#!/bin/bash
for line in $(cat /home/guga/Music/playlist_regueton2); do find /media/guga/Mi\ disco -name $line* -exec mplayer {} \; ; done
#
# Convert .wav to .mp3 with FFMPEG command line tool
#
Dir.glob("/home/guga/Music/*.wav").each do |musica|
`ffmpeg -i "#{musica}" -f mp2 "/home/guga/Music/#{File.basename(musica).gsub('.wav','')}.mp3" `
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment