Page 1 of 1
a script for users of crappy mp3 players
Posted: Thu May 19, 2005 5:24 pm
by DaveQB
I am not sure how many are in this same situation, but my mp3 player requires 44100hz sampled audio. Also its seeking is rather slow, so an hour of audio, stopped, say 30 mins into, takes about 10mins to seek back to that spot. So i cut mine up into smaller pieces so i can jump tracks to where i was last at.
Here's the script i use:
Code: Select all
#!/bin/bash
lame -f --scale 2 --resample 44100 -b 80 $1
mpgsplit "$1".mp3 [1/8] -o "$1"a.mp3
mpgsplit "$1".mp3 [2/8] -o "$1"b.mp3
mpgsplit "$1".mp3 [3/8] -o "$1"c.mp3
mpgsplit "$1".mp3 [4/8] -o "$1"d.mp3
mpgsplit "$1".mp3 [5/8] -o "$1"e.mp3
mpgsplit "$1".mp3 [6/8] -o "$1"f.mp3
mpgsplit "$1".mp3 [7/8] -o "$1"g.mp3
mpgsplit "$1".mp3 [8/8] -o "$1"h.mp3
What it does is re-ecnode it to 44100hz and add some extra volume (Patrick, i struggle to hear you when i am driving and listening)
Then it splits them into 8 8ths with the extension shown for each one.
All you need to do is supply the script with the audio file as an argument, so if called the script tllts-split.sh i would do this
tllts-split.sh tllts_84-05-18-05.mp3
Hope that helps someone.
Re: ascript for users of crappy mp3 players
Posted: Fri May 20, 2005 9:35 am
by Patrick
DaveQB wrote:Patrick, i struggle to hear you when i am driving and listening
I know I have marble mouth!

I'll try to speak more clearly going forward.
ascript for users of crappy mp3 players
Posted: Fri May 20, 2005 11:01 am
by mowestusa
Thanks for the script. I look forward to trying it out. I have the same problem with my mp3 player, but I'm too cheap to get a new one.
I know nothing about bash scripts, but can you put multiple files after the script name and then have the script run again on the next file listed on the cli?
Or would it be easy to have this script do this to ever mp3 in a directory (lets say a bashpodder created directory full of your podcasts) What changes would we need to make?
Thanks again.
Steve
mowestusa@yahoo.com
Posted: Sat May 21, 2005 3:44 am
by DaveQB
To be honest, I am not bash scripting expert. But i can't see why it can't take a directory as an argument.
To add mutliple files as arguments, you could
1) copy the conent of the section, paste it below and change all the $1's to $2 in the newly pasted part, repeat for as many arguments you think you will need.
2) you might be able to use a for do loop. But again I am no expert.
Here is the file as a download, simply save, make it executable and your away. You'll see i started to add a little more to it, ie ask to delete the new file that is created.
Link
Posted: Thu May 26, 2005 10:01 am
by mowestusa
Dave,
You'll have to forgive me, but what did you install in order to get "mpgsplit". I run on Debian and on Slackware. I couldn't find a package on Linuxpackages. I also didn't find it on Debian by doing in "apt-get install mpgsplit".
If you could help me find this and install it I would appreciate it.
Thanks
mowestusa
Posted: Thu May 26, 2005 10:20 am
by DaveQB
OH sorry dude. I ment to mention the "dependancies"
I should find a way to script into it a little check on the system.
I believe what your after is the mpgtx package
Posted: Mon Jun 13, 2005 1:46 pm
by DaveQB
Updated
Made it a Python script (as I am trying to learn Python)
Now all you need to do it supply the URL as the argument and it will download it to the current directory, re-encode it with a 44100hz sample rate and split it into 8 equal pieces.
example
[david@laptop ~]$ tllts-split
http://mirror.linuxquestions.org/pub/ar ... -08-05.mp3
Link to download
Posted: Thu Jun 30, 2005 10:00 pm
by DaveQB
Ok I made some changes on it as i downloaded an episode of LugRadio through torrent and then realised i could use this on it as it downloads first.
http://www.dward.us/software/
This new revision checks when arument you give to it, if its a local file it doesnt try to download it, but just starts resampling and cutting up. If its is an ftp or http adres it will download to local dir first and then reasmaple and cut up.
Also got error checking too if you use it incorrectly.
Curious, is anyone using this sript, or just me ?
