Bug 29470 - converting to mp3 or ogg as a service ?
Summary: converting to mp3 or ogg as a service ?
Status: RESOLVED WORKSFORME
Alias: None
Product: konqueror
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: Aaron J. Seigo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-07-21 17:33 UTC by jochen
Modified: 2004-05-10 20:58 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
service menu example (128 bytes, application/x-desktop)
2003-12-26 17:27 UTC, Mike Diehl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jochen 2001-07-21 17:29:13 UTC
(*** This bug was imported into bugs.kde.org ***)

Package:           konqueror
Version:           unknown (using KDE 2.2.0 beta1)
Severity:          wishlist
Installed from:    compiled sources
Compiler:          gcc version 2.95.3 20010315 (SuSE)
OS:                Linux (i686) release 2.4.6
OS/Compiler notes: 

Now that we can drag and drop from a CD to mp3 and ogg wouldn't it be easy to create a service to convert wavs into mp3 or ogg ?

e.g. you drag wav(s) to Services/Ogg-Converter
and it is created in the same directory the wav resides.

Or something like that.
I would like that :-)


(Submitted via bugs.kde.org)
(Called from KBugReport dialog)
Comment 1 Mike Diehl 2003-12-26 03:27:58 UTC
How about a konqueror service menu that could accomplish this? I made a simple one like so.

[Desktop Entry]
ServiceTypes=audio/x-wav
Actions=convertToOgg

[Desktop Action convertToOgg]
Name=Convert to ogg
Exec=oggenc %U

Theres a very good Service menu how-to here http://developer.kde.org/documentation/tutorials/dot/servicemenus.html
Comment 2 Mike Diehl 2003-12-26 17:27:36 UTC
Created attachment 3842 [details]
service menu example

Sample .desktop service menu file.
Comment 3 mail 2003-12-26 17:44:55 UTC
This is what I do, maybe someone can improve it, lame and oggenc have to be installed:

$ cat kwavenc.desktop

[Desktop Entry]
ServiceTypes=audio/x-wav
Actions=b64;b128;b192;lq;mq;hq;custom

[Desktop Action b64]
Name=make a 64kBit MP3
Name[de]=ein 64kBit MP3 erzeugen
Icon=sound
Exec=xterm -e "(echo m;echo 64;echo n)|wavenc %f"

[Desktop Action b128]
Name=make a 128kBit MP3
Name[de]=ein 128kBit MP3 erzeugen
Icon=sound
Exec=xterm -e "(echo m;echo 128;echo n)|wavenc %f"

[Desktop Action b192]
Name=make a 192kBit MP3
Name[de]=ein 192kBit MP3 erzeugen
Icon=sound
Exec=xterm -e "(echo m;echo 192;echo n)|wavenc %f"

[Desktop Action custom]
Name=make a customized MP3 or OGG
Name[de]=ein MP3 oder OGG erzeugen, mehr Optionen
Icon=sound
Exec=xterm -e "wavenc %f"

[Desktop Action lq]
Name=make a low quality OGG
Name[de]=ein sehr kleines OGG erzeugen
Icon=sound
Exec=xterm -e "(echo o;echo 0;echo n)|wavenc %f"

[Desktop Action mq]
Name=make a normal OGG
Name[de]=ein normales OGG erzeugen
Icon=sound
Exec=xterm -e "(echo o;echo 4;echo n)|wavenc %f"

[Desktop Action hq]
Name=make a high quality OGG
Name[de]=ein hochqualitatives OGG erzeugen
Icon=sound
Exec=xterm -e "(echo o;echo 7;echo n)|wavenc %f"


$ cat wavenc

#!/bin/bash

export IFS="
"

test -z "$1" && echo -e "\nusage: wavenc file.wav\n" && exit

function makemp3()
{
        temp=`echo $1|sed 's/.wav$/.mp3/g'`
        mp3name="`echo ${temp}|sed 's/.WAV$/.mp3/g'`"

        echo -e "\nbitrate? [32,40,48,56,64,80,96,112,128,160,192,224,256,320]"
        read -e bitrate

        echo
        echo "Stereo -> Mono? [y/N]"
        read -e mono
        if [ "${mono}" = "j" ] || [ "${mono}" = "y" ]
        then ifmono="-a"
        fi

        echo

        nice -10 lame -b ${bitrate} -h ${ifmono} "$1" "${mp3name}"
}


function makeogg()
{
        temp=`echo $1|sed 's/.wav$/.ogg/g'`
        oggname="`echo ${temp}|sed 's/.WAV$/.ogg/g'`"

        echo -e "\nquality (higher is better)? [-1..10]"
        read -e quality

        echo
        echo "Stereo -> Mono? [y/N]"
        read -e mono
        if [ "${mono}" = "j" ]
        then ifmono="--downmix"
        fi

        echo

        nice -10 oggenc -q ${quality} ${ifmono} "$1" -o "${oggname}"
}


echo -e "\nMP3 or OGG? [m/o]"
read -e enctype


if [ "$enctype" = "o" ]
then makeogg $1
exit
fi
Comment 4 jochen 2004-05-10 20:58:56 UTC
Maybe I try improve the service menu and put it on kde-apps.org