When ever I set up the laptop with those little computer speakers I have to check the stereo setup: so I’m sure the right speaker is on the right and the left on the left. On the Mac I do this by going to System Preferences > Sound then switching the sound all the way to the right and flipping the volume up and down to make little bleeps. Then the same for the left.
Found this resource about using mplayer or ffmpeg to extract the audio of an flv flash movie (like those from youtube etc.) and save it as an mp3 file.
I adapted the ffmpeg version with the -ab flag that allows me to specify audio bitrate:
This could probably get more elaborate and use the containing directories to set album and artist tags. For now here is a bash script to set the titles based on the current file name. This uses a program called tagmp3.
artist="Artist"
album="Ablum"
for filename in *.mp3;
do title=`echo $filename | sed 's/.mp3$//g'`;
tagmp3 set "%A:$arrtist %a:$album %t:$title" $filename;
done
Now, obviously I could have avoided this in this case with the proper options and arguments to lame, but it’s all in hindsight.
Here’s the bash line I use to strip out .wav from the middle of all these files in the current directory:
for filename in *.mp3; do newname=`echo $filename | sed 's/\.wav\.mp3$/.mp3/g'`; mv $filename $newname; done
It’s long for one line but I think it’s still understandable and manageable. The result is:
song1.mp3
song2.mp3
song3.mp3
song4.mp3
...
Note: I notice that I’m being overly carefully with my regexes and wildcards in the example above but it should make it more clear how to adapt it to your case.
Here’s the command I used to generate my new custom outgoing message for my iPhone’s voicemail:
say -o outgoing-message.aiff -v Vicki ". . . Ahlec Jacobson \
did not answer. Please try emailing him, at alec jacobson at \
gee mail dot com. That's A. . L. . E. . C. . J. . A. . C. . O. . B. . \
S. . O. . N. . AT. GEE MAIL. DOT. COM. Or send a text message \
to this number. Or finally leave a message after the beep. \
Thank you. . . . . . . . . Good bye. . . ."
Here’s the result after I used lame to convert the aiff file to mp3 using this simple command:
I gave up using iTunes to play music about year ago, but I haven’t found a free alternative to iTunes’s exceptional file management based on mp3 ID3 tags (If you know of one — I mean better than iTunes one — let me know). So occasionally I let iTunes organize my music library. I drop in folders containing new music and let iTunes go at it. The problem is that if I have folders containing an mp3 and an m3u playlist I get duplicates. If I don’t notice this right away the duplicates build up.
Here’s a bash script to delete all true duplicates. The files must be exactly the same and have almost the same name (the difference being the number iTunes appends on a copy: “song.mp3″ becomes “song 1.mp3″).
Verbose version:
#!/bin/bash
find "$1" -regex ".* [0-9][0-9]*\.[^.]*" -print0 | while read -d $'\0' copy
do
original=`echo "$copy" | sed "s/\(.*\) [0-9][0-9]*\(\.[^.]*\)/\1\2/"`
# check that the hypothetical original exists
if [ -e "$original" ];then
# check that the original is exactly the same file as the copy
if diff "$original" "$copy" >/dev/null ;then
rm "$copy"
echo "$copy deleted..."
else
echo "$copy is different..."
echo " $copy not deleted..."
fi
else
echo "$original does not exist..."
echo " $copy not deleted..."
fi
done
Quiet Version
#!/bin/bash
find "$1" -regex ".* [0-9][0-9]*\.[^.]*" -print0 | while read -d $'\0' copy
do
original=`echo "$copy" | sed "s/\(.*\) [0-9][0-9]*\(\.[^.]*\)/\1\2/"`
# check that the hypothetical original exists
if [ -e "$original" ];then
# check that the original is exactly the same file as the copy
if diff "$original" "$copy" >/dev/null ;then
rm "$copy"
fi
fi
done