Convert wav to mp3 with a right click option
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
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
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)
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, ist it the right mouse-button?
What is echo doing here?
What is t doing here?
RSH
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%.*}"
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"
What is echo doing here?
Code: Select all
sed "s/\/$//
Code: Select all
t="${z%.*}"
Last edited by RSH on Wed 09 Nov 2011, 14:28, edited 1 time in total.
You seem to know more about programming
than me. It's the blind leading the blind.
Here's a tip that has been invaluable for me.
If a script isn't working, then insert the following:
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
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
If you had three inputs, they would be automatically
named $1 $2 $3 by bash shell.
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.
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.
___________________________________________
than me. It's the blind leading the blind.
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
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"
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
It look like a simple inputing of a variable.What is
Code:
"$1"
If you had three inputs, they would be automatically
named $1 $2 $3 by bash shell.
Programmers like to stick an echo line by itselfWhat is echo doing here?
Code:
sed "s/\/$//
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.
That looks like some clumsy coding by me.What is t doing here?
Code:
t="${z%.*}"
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.
___________________________________________
loop example
A script to understand loops that I have found.
The 'shift' command is used to switch to a new argument in
the list.
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
_______________________________________
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
# ./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.
another loop example with for statement
terminal output is
# ./script 1 2 4 6
Argument value is: 1
Argument value is: 1
Argument value is: 2
Argument value is: 4
Argument value is: 6
Code: Select all
#!/bin/bash
echo "Argument value is: $1"
for item in "$@"
do
echo "Argument value is: $item"
done
terminal output is
# ./script 1 2 4 6
Argument value is: 1
Argument value is: 1
Argument value is: 2
Argument value is: 4
Argument value is: 6
Hello don570,
thank you for your help.
After help and hints from big_bass, emil, L18L, PANZERKOPF, rhadon and you, i was able to create the tool, i wanted to create. It works fine. Now i have to put all these things together (saving to hd) and study it. There's a lot of documentation i've found.
The Tool is created as ROX-App, like your Audiotools. The Code is fully commended in german and english. So, i think, you should take a look inside, because if have found out something interesting about:
The pet is here:
http://murga-linux.com/puppy/viewtopic. ... 2&start=15
RSH
Edit:
thank you for your help.
After help and hints from big_bass, emil, L18L, PANZERKOPF, rhadon and you, i was able to create the tool, i wanted to create. It works fine. Now i have to put all these things together (saving to hd) and study it. There's a lot of documentation i've found.
The Tool is created as ROX-App, like your Audiotools. The Code is fully commended in german and english. So, i think, you should take a look inside, because if have found out something interesting about:
Code: Select all
t="${z%.*}"
http://murga-linux.com/puppy/viewtopic. ... 2&start=15
RSH
Edit:
Let me tell you something to this. From Time to Time i've been working as a teacher for playing drums. In the private sector and even on schools. So, everytime i've teached anybody, i've learned something at the same time. And for sure, i've learned from your posts as well.You seem to know more about programming
than me. It's the blind leading the blind. Laughing
I've been studying loops and here's some things
I've learned. I show the script ,
then the output in the terminal.
Here's a quick way of making a list for a loop
to use each word as an argument
# ./script
Argument value is: apple
Argument value is: orange
Argument value is: pear
Argument value is: plum
Here is the usual way programmers make a list
# ./script
Argument value is: apple
Argument value is: orange
Argument value is: pear
Argument value is: plum
Double quotation marks are useless as this example
shows...
# ./script
Argument value is: ap
Argument value is: ple
Argument value is: orange
Argument value is: pear
Argument value is: plum
Now I change the IFS (Internal Field Separator) to a comma
and the white space is protected
# ./script
Argument value is: ap ple
Argument value is: orange
Argument value is: pear
Argument value is: plum
I've learned. I show the script ,
then the output in the terminal.
Here's a quick way of making a list for a loop
to use each word as an argument
Code: Select all
#!/bin/bash
LIST='apple orange pear plum'
for item in $LIST
do
echo "Argument value is: $item"
done
Argument value is: apple
Argument value is: orange
Argument value is: pear
Argument value is: plum
Here is the usual way programmers make a list
Code: Select all
#!/bin/bash
LIST='apple
orange
pear
plum'
for item in $LIST
do
echo "Argument value is: $item"
done
Argument value is: apple
Argument value is: orange
Argument value is: pear
Argument value is: plum
Double quotation marks are useless as this example
shows...
Code: Select all
#!/bin/bash
LIST=$(echo "ap ple" orange pear plum)
for item in $LIST
do
echo "Argument value is: $item"
done
Argument value is: ap
Argument value is: ple
Argument value is: orange
Argument value is: pear
Argument value is: plum
Now I change the IFS (Internal Field Separator) to a comma
and the white space is protected
Code: Select all
#!/bin/bash
IFS=,
LIST='ap ple,orange,pear,plum'
for item in $LIST
do
echo "Argument value is: $item"
done
Argument value is: ap ple
Argument value is: orange
Argument value is: pear
Argument value is: plum
loop example
The following example will loop three times
even though there are 4 arguments
# ./Script "ap ple" orange pear plum
“argument is ....ap ple″
“argument is ....orange″
“argument is ....pear″
even though there are 4 arguments
Code: Select all
#!/bin/bash
x=1
while [ $x -le 3 ]
do
echo “argument is ....$1″
shift
x=`expr $x + 1`
done
“argument is ....ap ple″
“argument is ....orange″
“argument is ....pear″
Last edited by don570 on Wed 09 Nov 2011, 20:26, edited 2 times in total.
new version folder_convert 1.2
new version folder_convert 1.2
folder_convert has been fixed to show foreign languages properly.
I dumped the old yaf-splash and now use xdialog
______________________________________________
folder_convert has been fixed to show foreign languages properly.
I dumped the old yaf-splash and now use xdialog
______________________________________________
dejan script
Here's a script based on dejan's work.
It allows sed command to work on text that has
whitespace .
The terminal output is
# ./Script
/root/spot
_________________________________________________
Here's a script I wrote to
study positional characters i.e number of inputs --> $#
and to study exit status ---> $?
# ./script a b c
number of positional characters = 3
a b c
0
1
./script
0
_______________________________________
It allows sed command to work on text that has
whitespace .
Code: Select all
#!/bin/sh
FIND="/ap ple/"
ADD="/root/"
echo "/ap ple/spot" | sed 's:^'"$FIND"':'"$ADD"':'
# ./Script
/root/spot
_________________________________________________
Here's a script I wrote to
study positional characters i.e number of inputs --> $#
and to study exit status ---> $?
Code: Select all
#!/bin/bash
echo number of positional characters = $#
until [ -z "$1" ] # Until all parameters used up . . .
do
echo -n "$1 "
shift
done
echo # Extra line feed.
echo "$?" # Determine exit status
if [ -z "$0" ] ; then
echo
else
echo "$?"
echo "$0"
echo "$?"
fi
exit 0
# ./script a b c
number of positional characters = 3
a b c
0
1
./script
0
_______________________________________
Here's a script I found to do simple calculations
...and the terminal output.
# ./script
Enter input:
2+2
Result with 2 digits after decimal point:
4
Result with 10 digits after decimal point:
4
Result as rounded integer:
4
# ./script
Enter input:
2*8
Result with 2 digits after decimal point:
16
Result with 10 digits after decimal point:
16
Result as rounded integer:
16
# ./script
Enter input:
8/4
Result with 2 digits after decimal point:
2.00
Result with 10 digits after decimal point:
2.0000000000
Result as rounded integer:
2
____________________________________
Code: Select all
#!/bin/bash
# Simple linux bash calculator
echo "Enter input:"
read userinput
echo "Result with 2 digits after decimal point:"
echo "scale=2; ${userinput}" | bc
echo "Result with 10 digits after decimal point:"
echo "scale=10; ${userinput}" | bc
echo "Result as rounded integer:"
echo $userinput | bc
# ./script
Enter input:
2+2
Result with 2 digits after decimal point:
4
Result with 10 digits after decimal point:
4
Result as rounded integer:
4
# ./script
Enter input:
2*8
Result with 2 digits after decimal point:
16
Result with 10 digits after decimal point:
16
Result as rounded integer:
16
# ./script
Enter input:
8/4
Result with 2 digits after decimal point:
2.00
Result with 10 digits after decimal point:
2.0000000000
Result as rounded integer:
2
____________________________________
Here's a script I found that does renaming(recursively)
of filenames that have whitespace .
_____________________________________________________________
of filenames that have whitespace .
Code: Select all
#!/bin/sh
# This bash script will locate and replace spaces
# in the filenames
DIR="."
# Controlling a loop with bash read command by redirecting STDOUT as
# a STDIN to while loop
# find will not truncate filenames containing spaces
find $DIR -type f | while read file; do
# using POSIX class [:space:] to find space in the filename
if [[ "$file" = *[[:space:]]* ]]; then
# substitute space with "_" character and consequently rename the file
mv "$file" `echo $file | tr ' ' '_'`
fi;
# end of while loop
done
French German Spanish Finnish Italian Portugese Dutch
languages now supported
More languages are now supported by conversion_audio
thanks to
Béèm
ferro10n
Instructions to help in conversion effort are here
http://www.murga-linux.com/puppy/viewtopic.php?t=72856
_________________________________________
languages now supported
More languages are now supported by conversion_audio
thanks to
Béèm
ferro10n
Instructions to help in conversion effort are here
http://www.murga-linux.com/puppy/viewtopic.php?t=72856
_________________________________________
Here I tested a new way of inputing variable values
using curly brackets.
Also there is a line in the script to
experiment with the test command ---> [
which is the square bracket. The output is zero
because 5 does not equal 9. The terminal output shows
this outcome.
Here's the terminal output. Note that there is two inputs
2barks and the extension .wav
________________________________________
using curly brackets.
Also there is a line in the script to
experiment with the test command ---> [
which is the square bracket. The output is zero
because 5 does not equal 9. The terminal output shows
this outcome.
Code: Select all
#!/bin/sh
FILENAME=$1
EXTENSION=$2
echo $@
[ 5 != 9 ]
echo $?
aplay /root/puppy-reference/audio/${FILENAME}${EXTENSION}
exit 0
2barks and the extension .wav
Code: Select all
# ./script 2barks .wav
2barks .wav
0
Playing WAVE '/root/puppy-reference/audio/2barks.wav'
: Signed 16 bit Little Endian, Rate 8000 Hz, Mono
new version of conversion audio - version 1.5
Two improvements
1) I estimate the conversion time for the user,
however this probably won't be accurate if you have a slow machine
2) I pop a window up to show the conversion so it won't be
such a mystery!
Note: the foreign translations had to be changed as well.
______________________________________________________
Two improvements
1) I estimate the conversion time for the user,
however this probably won't be accurate if you have a slow machine
2) I pop a window up to show the conversion so it won't be
such a mystery!
Note: the foreign translations had to be changed as well.
______________________________________________________
new version 1.7
new version 1.7
opens and converts more audio formats
such as flac and wma
Conversion time is approximate. I give the time needed
assuming the user has a fast machine.
____________________________________________
opens and converts more audio formats
such as flac and wma
Conversion time is approximate. I give the time needed
assuming the user has a fast machine.
____________________________________________