Convert wav to mp3 with a right click option

Audio editors, music players, video players, burning software, etc.
Message
Author
User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

Convert wav to mp3 with a right click option

#1 Post by don570 »

Edit: feb 22 2012 time of conversion estimate given
and a window to show progress of conversion


Edit: oct 24 Switched to xdialog from yaf splash to show foreign
languages. Now French German Spanish Finnish Dutch
Italian Portugese versions are available


Edit: oct 20 I changed name to conversion_audio
so that installation is easier


Edit: sept 8 new pet available to convert a MP3 file to
a WAV file - see post for details


I added a new feature to Puppy ... conversion of wav to mp3
with a right click option.


I've written two apps that convert a wav file to mp3
or an entire folder. The great thing about them is
that they work with the right click of your mouse.

wav to mp3 conversion -- both single file and folder

The folder conversion has an option to delete the original
wave files after the conversion has taken place.
This is the safest method I think.


Just click to install. They are both very small
because they both use LAME which is
built-in to nearly all Puppies.

You can get LAME if your Puppy doesn't have it installed.
http://www.dokupuppylinux.tk/programs:audio_encoders

Foreign language translations are easy to do
since I localized the scripts using Zigbert's method.

Both an entire folder and a single file.

Image
______________________________________________

right click on a folder and get

Image


________________________________________________________
Attachments
conversion_audio-2.4.pet
right click option to convert wav and mp3 and other audio formats
(6.9 KiB) Downloaded 980 times
folder_convert-1.4.pet
converts an entire folder of wav files to mp3
(5.42 KiB) Downloaded 940 times
Last edited by don570 on Sat 09 Apr 2016, 20:22, edited 21 times in total.

User avatar
dru5k1
Posts: 72
Joined: Mon 12 Apr 2010, 01:15

#2 Post by dru5k1 »

That is so cool. I had no idea puppy could do funky stuff like that with the right-click menu.

telltom
Posts: 97
Joined: Sun 23 May 2010, 19:56

#3 Post by telltom »

just great, thanks.

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

uploaded correct package now

#4 Post by don570 »

conversion_mp3-1.1.pet is the correct package

The previous package conversion_mp3-1.0.pet
was my first attempt, I believe.

Both scripts have been localized for foreign languages.

_______________________________________

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#5 Post by Flash »

Puppy comes with Asunder and Pcdripper, both of which can also convert WAV to mp3. In addition, they can convert an entire CD to mp3 without having to rip the whole CD first. Instead of ripping the whole CD before starting to convert the tracks to mp3, they rip one track and convert it to mp3 before going to the next track. That way doesn't require as much temporary storage as ripping the whole CD first.

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#6 Post by don570 »

Note to Flash - These are simple scripts that just
need lame to be installed. The whole idea is
to make puppy as small as possible but still powerful!!


Pmusic does an excellent job of converting waves to mp3,
but few people use it. Pmusic can even rip an entire CD
(but not a few selected tracks)

I was looking for the quickest and easiest method
of converting and that led me to pawdiocorder

http://www.murga-linux.com/puppy/viewto ... 64&t=28089

I studied one of the scripts 'wav2mp3'. I've been using
it for months and have been pleased with the results.

But then I remembered that on Apple's Mac OS that
they have scripts that allow mp3 conversion with a 'Control' click
which is the equivalent of Linux Right click option.

So I wrote these two scripts and they work well with my limited
testing over the last week.

____________________________________________________
_________________________________________________

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#7 Post by Flash »

Don570, I understand, and thank you for posting your scripts. I just wanted to be sure that any newcomers who read this thread know that there are other options which come with Puppy. :)

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#8 Post by don570 »

new versions

folder_conversion is 1.1

Now the deletion feature works correctly even is
folder or filenames have blank characters ie white space
_________________________________________________

conversion_mp3 is 1.2

Warning message now works properly if
there is blank characters in file name ie white space

__________________________________________

friendlybiker
Posts: 27
Joined: Sat 10 May 2008, 20:19
Location: Madison, WI

#9 Post by friendlybiker »

Will this pet do the opposite too, convert mp3 to wav?
[b][color=red]friendlybiker[/color][/b]

------------------------------
5.2.8-Lucid
"Where the North Begins"

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

rewrite wav to mp3

#10 Post by don570 »

It should be easy to rewrite the script.
I'll look into it.

Paudioscripts has a script mp32wav

You should use that if you have a folder of music that
needs conversion
http://www.murga-linux.com/puppy/viewto ... 64&t=28089

User avatar
esmourguit
Posts: 1410
Joined: Fri 17 Nov 2006, 14:45
Location: Entre l'ile aux oiseaux.et l'ile de sainte Lucie

#11 Post by esmourguit »

Bonjour à tous,
Here are the french localized files for the conversion scripts.
Cordialement ;)
Attachments
conversion_french_files.tar.gz
(981 Bytes) Downloaded 683 times
[url=http://moulinier.net/][color=blue][b]Toutou Linux[/b][/color][/url] - [url=http://toutoulinux.free.fr/pet.php][color=blue][b]Paquets français[/b][/color][/url]

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#12 Post by don570 »

Merci à esmourguit !

Je travaille à une application 'quick_launch-1.0'
Elle aura besoin d'une traduction dans quelques jours.
_____________________________________________

I worked on a right click option to convert a mp3 to
a wav file. It was harder than I thought!!

I wanted a gtkdialog window to pop up and give options
since this is the safest way, but it added complexity.

The user has two options. One a high quality stereo wav
that can be edited with mhwaveedit
or a mono mp3.

Available at first post
___________________________________

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#13 Post by don570 »

Here are the locals in a simple to install pet package.

So far only French.
Attachments
folder_convert-NLS-1.1.pet
(1.05 KiB) Downloaded 685 times
conversion_mp3-NLS-1.2.pet
(611 Bytes) Downloaded 731 times

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

new package name - conversion_audio

#14 Post by don570 »

I combined two programs into one and
I changed the name to conversion_audio.

convert_mp3 and convert_wav will be no more.

The new package is easy to install and understand.

Just click to install and you will see the appropriate option
when you right click on a wav or mp3 file.

You will be given a chance to cancel just before the conversion
of a file.

I did this just in case a person accidently chose the option :lol:

_________________________________________________

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

Switched to xdialog from yaf splash to show

#15 Post by don570 »

new version 1.4

oct 24 Switched to xdialog from yaf splash to show foreign
languages accurately.
Now German and Spanish versions are available


I made a radical change for the better! :lol:


There are now German and Spanish translations available
in addition to French.
Thanks to Laie , RSH and GustavoYz .
______________________________________________

User avatar
RSH
Posts: 2397
Joined: Mon 05 Sep 2011, 14:21
Location: Germany

#16 Post by RSH »

Hello, don570!

Tonight i have discovered your Rightclick-Audioconversiontool. It was a nice Surprise to me, to find my translation added to this Tool. I am lucky about that, and so i have downloaded it and installed it in my Puppy Studio rebuild No. 37.

I works fine, and: I LIKE IT!

Nice Work and the Code is truly education to me. I am just a beginner in writing GUIS for some Tools. May be you are interested in my GUI for the Bristol Software Synthesizers, they can be found here: http://www.mediafire.com/file/6pr21567d ... 86-GUI.pet. Also the Bristol Synthesizers: http://www.mediafire.com/file/xm7q4jb99 ... 1_i386.pet

To let you understand, how much i like this Tool, i'd started to make a translation for the folder-convert-1.1.pet. So, here is the folder_convert-NLS-de-1.1.pet, with only the german translation within.

Please add this one to your NLS-File - if you like to do so.

Wish you well,

RSH
Attachments
folder_convert-NLS-de-1.1.pet
(1.09 KiB) Downloaded 430 times

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#17 Post by don570 »

Thanks for the translation.

folder_convert was an experiment. I don't have training in
programming so I wrote it in a strange way
that professionals would laugh at, I'm sure.

..but it seems to work, so I posted it along with conversion_audio
which ought to be in every Puppy.

User avatar
RSH
Posts: 2397
Joined: Mon 05 Sep 2011, 14:21
Location: Germany

#18 Post by RSH »

Hello don570,

i like your .pet stuff and even the code. I've been a programmer for years and years back there, from 1990 to 2007. But, in PASCAL and doing it using another OS: the TOS, AtariST Series. Later using the TOSBOX on Windows ME, wich gives me 14 MB RAM and a whole lot of speed. Sometimes i have to make some scrolling-functions in my own programs a little less faster manually by programming-code.

Now let's take a look at my Problem. It has to do with the code from your rightclick audio stuff. While i am reading your code, i am trying to translate it to PASCAL.
I hope it will help me a little, to understand this script-programming-code (has it got a name, like PASCAL, C++ or JAVA).

Let me explain: if i'm writing "extension", this means to me the (almost) three characters after the dot. (.pet for example)

Code: Select all

z=`echo "$1" | sed "s/\/$//"`
t="${z%.*}"
z=`echo "$1" | sed "s/\/$//"` gives me the full path- and filename after the mouseclick, right?
After "t="${z%.*}"[/code]" there's only the full path- and filename without the extension, right?

Or am i totally wrong?

So, i want this code to return to me

1. the full path- and filename WITH extension
2. the full path- and filename WITHOUT extension
3. only the filename

2. and 3. maybe can be done by me, using string-functions like the PASCAL-functions (delete, insert concat etc). L18L shows me some equivalents.

In PASCAL we call them STRINGS and i need these strings in a form or way to do something with them like copy, delete and insert parts of them or other strings, declared by myself.

Can you help me? Any Idea?

What is

Code: Select all

"$1"
, ist it the right mouse-button?

What is echo doing here?

Code: Select all

sed "s/\/$//
What is t doing here?

Code: Select all

t="${z%.*}"
RSH
Last edited by RSH on Wed 09 Nov 2011, 14:28, edited 1 time in total.

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#19 Post by don570 »

You seem to know more about programming
than me. It's the blind leading the blind. :lol:

Here's a tip that has been invaluable for me.

If a script isn't working, then insert the following:

Code: Select all

gxmessage bingo
This shows me if I have reached a certain part in a
script. This is especially valuable in loops.

As well I find often that there is a need to
find out the variables value so I insert the
following line

Code: Select all

 gxmessage   APP_LIST= "$APP_LIST"
to find the value of a variable named APP_List.

I often write small scripts in /root to check out
my theories on how a script will act.

There's a list of free info here -->

http://murga-linux.com/puppy/viewtopic.php?t=71288

I personally use this for any Bash scripting I've done--->
http://www.murga-linux.com/puppy/viewtopic.php?t=40422
What is
Code:
"$1"
It look like a simple inputing of a variable.
If you had three inputs, they would be automatically
named $1 $2 $3 by bash shell.

What is echo doing here?
Code:
sed "s/\/$//
Programmers like to stick an echo line by itself
to show a blank line in the terminal.
Is that what is confusing you?
I should have taken it out if I left it in.
What is t doing here?
Code:
t="${z%.*}"
That looks like some clumsy coding by me.
I should have given descriptive variable names
rather than letters. It's a bad habit I've gotten into.
You should avoid doing it. A gxmessage line should find out
what it is. Note that I used quotes to preserve the whitespace!!!



If you read the script found here
http://www.murga-linux.com/puppy/viewtopic.php?t=71927
there's use of 'dirname' and 'basename' which I've avoided
doing, mainly because of my lack of knowledge,
but also because they don't appear to work in functions
and child processes.

If you want to know about a line of script I've written you
should give me a line number --> It's a menu option in Geany.


___________________________________________

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

loop example

#20 Post by don570 »

A script to understand loops that I have found.
The 'shift' command is used to switch to a new argument in
the list.

Code: Select all

#!/bin/bash
echo "Argument value is: $1"

while [ "$*" != "" ]
do
echo "Argument value is: $1"
shift
done
Here is terminal output for different inputs

# ./script a b c d
Argument value is: a
Argument value is: a
Argument value is: b
Argument value is: c
Argument value is: d


The double quotation mark does protect whitespace

# ./script "a b" "c d"
Argument value is: a b
Argument value is: a b
Argument value is: c d

_______________________________________
Last edited by don570 on Wed 02 Nov 2011, 00:07, edited 1 time in total.

Post Reply