Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
monkey audio (.ape) running and conversion HOW-TO
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
jacek_migacz
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jun 2005
Posts: 141

PostPosted: Mon Oct 10, 2005 3:25 pm    Post subject: monkey audio (.ape) running and conversion HOW-TO Reply with quote

1. installing conversion tool ape2mp3:

go to http://sourceforge.net/projects/mac-port/ and leech mac

Code:
tar -xf mac-*-*-*.tar.gz
./configure
make && make install


and our conversion works!

Code:
mac --help


sample:
Code:
mac in.ape out.wav -d


-----------------------------------------------------------------------------------------------

2. just playing .ape files in xmms player

go to http://sourceforge.net/projects/mac-port/ and leech xmms-mac

Code:
tar -xf xmms-mac-*.tar.gz
./configure
make && make install


restart xmms and feel free to listen to ape crap! ;)
Back to top
View user's profile Send private message
carbonti
n00b
n00b


Joined: 05 Sep 2005
Posts: 29

PostPosted: Sun Oct 23, 2005 9:21 pm    Post subject: Reply with quote

Thanks for the heads up on this. Works very well.

I originally wanted to enable only the xmms-mac-0.3.1 codec for xmms playback but it needed mac-3.99 to complile. So do both. Good stuff.
Back to top
View user's profile Send private message
Marctraider
Guru
Guru


Joined: 24 Dec 2003
Posts: 387

PostPosted: Wed Oct 26, 2005 12:49 pm    Post subject: Reply with quote

thanks, I prefer just FLAC files or good quality mp3 files so i will convert the wav's to flacs :) after this is done :lol:
_________________
MOBO: Maximus II Gene
RAM: DDR2 OCZ 4GB
CPU: E6400 Conroe
GPU: HD2600XT
SATA: 3x 250GB.
Back to top
View user's profile Send private message
Pithlit
l33t
l33t


Joined: 27 Dec 2003
Posts: 887
Location: fuhen

PostPosted: Mon Oct 31, 2005 12:14 am    Post subject: Reply with quote

There's an ebuild for mac-3.99 btw. You can get it here, thanks to gimpel.

And since I'm an extremely lazy person... and mac doesn't seem to be able to do batch converting... I wrote a (very nasty-but-working) script to convert *.ape to *.mp3. Now... if you people can make the script better, nicer, leaner... then by all means do so. I'd apreciate it if any fixes would be posted here :D . If ape files contain tags, then be aware they get lost during the conversion with this script.

Code:
#!/bin/bash
#My first ever attempt at scripting something. The result is perfect for me.
#I'm NOT the one to blame if this wipes out your hdd or breaks your CPU. You've
#been warned. Other than that... I realise it's not a good script. It needs
#tweaking or even better: a complete rewrite. But as stated before - it works
#for me. It spews out some trivial errors.
#
#Pithy

[ ! -d "$1" ] && echo "usage: ape2mp3 <apedir>" && exit
#Set the OUTDIR to where you want your intermediate wav files to end up
OUTDIR="/home/media/Music/$(basename "$1")"
[ ! -d "$OUTDIR" ] && mkdir -p "$OUTDIR"
#Set the OUTDIR2 to where you want your final mp3 files to end up
OUTDIR2="/home/media/Music/128/$(basename "$1")"
[ ! -d "$OUTDIR2" ] && mkdir -p "$OUTDIR2"
cd "$1" || exit

echo OUTDIR: $OUTDIR

find -depth -print0 | while read -d $'\0' filename;
do
    filename="${filename##*/}"
    mac "${filename}" "$OUTDIR/${filename}" -d
done

cd "$OUTDIR"
for e in *.ape
do
    mv "$e" "`echo $e | sed 's/\(.*\.\)ape/\1wav/'`"
done

echo OUTDIR2: $OUTDIR2

find -depth -print0 | while read -d $'\0' filename;
do
    filename="${filename##*/}"
#Set the lame options to your liking. The optins here will result in
#a decent 128kbps mp3. Good enough for your regular mp3 player.
    lame -h "${filename}" "$OUTDIR2/${filename}"
done

cd "$OUTDIR2"
for i in *.wav
do
    mv "$i" "`echo $i | sed 's/\(.*\.\)wav/\1mp3/'`"
done

#Uncomment the following line if you want to remove the folder with your wav
#files. I like to keep it. You know... better safe than sorry. And I just might
#decide to burn me an audio CD.
#The script will probably complain about missing folders. Ignore it.

#rm -r "$OUTDIR"

echo "conversion finished"
cd "$OLDPWD"


P.S. I can't code shit (in any language) so go easy on me.
_________________
If someone solves a problem for you say thanks... and put [SOLVED] in the title!
Back to top
View user's profile Send private message
Marctraider
Guru
Guru


Joined: 24 Dec 2003
Posts: 387

PostPosted: Mon Oct 31, 2005 12:43 am    Post subject: Reply with quote

Pithlit wrote:
There's an ebuild for mac-3.99 btw. You can get it here, thanks to gimpel.

And since I'm an extremely lazy person... and mac doesn't seem to be able to do batch converting... I wrote a (very nasty-but-working) script to convert *.ape to *.mp3. Now... if you people can make the script better, nicer, leaner... then by all means do so. I'd apreciate it if any fixes would be posted here :D . If ape files contain tags, then be aware they get lost during the conversion with this script.

Code:
#!/bin/bash
#My first ever attempt at scripting something. The result is perfect for me.
#I'm NOT the one to blame if this wipes out your hdd or breaks your CPU. You've
#been warned. Other than that... I realise it's not a good script. It needs
#tweaking or even better: a complete rewrite. But as stated before - it works
#for me. It spews out some trivial errors.
#
#Pithy

[ ! -d "$1" ] && echo "usage: ape2mp3 <apedir>" && exit
#Set the OUTDIR to where you want your intermediate wav files to end up
OUTDIR="/home/media/Music/$(basename "$1")"
[ ! -d "$OUTDIR" ] && mkdir -p "$OUTDIR"
#Set the OUTDIR2 to where you want your final mp3 files to end up
OUTDIR2="/home/media/Music/128/$(basename "$1")"
[ ! -d "$OUTDIR2" ] && mkdir -p "$OUTDIR2"
cd "$1" || exit

echo OUTDIR: $OUTDIR

find -depth -print0 | while read -d $'\0' filename;
do
    filename="${filename##*/}"
    mac "${filename}" "$OUTDIR/${filename}" -d
done

cd "$OUTDIR"
for e in *.ape
do
    mv "$e" "`echo $e | sed 's/\(.*\.\)ape/\1wav/'`"
done

echo OUTDIR2: $OUTDIR2

find -depth -print0 | while read -d $'\0' filename;
do
    filename="${filename##*/}"
#Set the lame options to your liking. The optins here will result in
#a decent 128kbps mp3. Good enough for your regular mp3 player.
    lame -h "${filename}" "$OUTDIR2/${filename}"
done

cd "$OUTDIR2"
for i in *.wav
do
    mv "$i" "`echo $i | sed 's/\(.*\.\)wav/\1mp3/'`"
done

#Uncomment the following line if you want to remove the folder with your wav
#files. I like to keep it. You know... better safe than sorry. And I just might
#decide to burn me an audio CD.
#The script will probably complain about missing folders. Ignore it.

#rm -r "$OUTDIR"

echo "conversion finished"
cd "$OLDPWD"


P.S. I can't code shit (in any language) so go easy on me.


Boy, everyone has his or her's talents, you are doing a fine job, who cares about how its written :lol:
as long as it works!
My work would most probably be even more garbish at the moment 8O
_________________
MOBO: Maximus II Gene
RAM: DDR2 OCZ 4GB
CPU: E6400 Conroe
GPU: HD2600XT
SATA: 3x 250GB.
Back to top
View user's profile Send private message
gimpel
Advocate
Advocate


Joined: 15 Oct 2004
Posts: 2720
Location: Munich, Bavaria

PostPosted: Mon Oct 31, 2005 9:24 am    Post subject: Reply with quote

Pithlit wrote:
There's an ebuild for mac-3.99 btw. You can get it here, thanks to gimpel.


humm, lokal server is off atm. look here: https://bugs.gentoo.org/show_bug.cgi?id=94477

Pithlit: nice script! may i post that on the howto page?
_________________
http://proaudio.tuxfamily.org/wiki - pro-audio software overlay
Back to top
View user's profile Send private message
Pithlit
l33t
l33t


Joined: 27 Dec 2003
Posts: 887
Location: fuhen

PostPosted: Mon Oct 31, 2005 9:05 pm    Post subject: Reply with quote

Sure gimpel. I've been pinging you for the past 2 days on #get-e for that :P

Thanks Marctraider.
_________________
If someone solves a problem for you say thanks... and put [SOLVED] in the title!
Back to top
View user's profile Send private message
boudewijn
Apprentice
Apprentice


Joined: 11 Jan 2005
Posts: 257
Location: Netherlands

PostPosted: Sat Feb 11, 2006 1:16 am    Post subject: Reply with quote

Hi

I cant compile the mac-stuff :(
Code:

configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating src/Console/Makefile
config.status: creating src/Shared/Makefile
config.status: creating src/MACLib/Makefile
config.status: creating src/MACLib/Assembly/Makefile
config.status: creating src/MACLib/Old/Makefile
config.status: creating src/Examples/Makefile
config.status: creating src/Examples/Analyze/Makefile
config.status: creating src/Examples/Analyze/Sample1/Makefile
config.status: creating src/Shared/config.h
config.status: src/Shared/config.h is unchanged
config.status: executing depfiles commands

Build options:
  mac                 3.99-u4-b4
  enable-backward          no


Checking status:

        1: No NASM found, you need NASM to compile the asm source in *x86* arch.

nasm: /usr/bin/nasm /usr/X11R6/bin/nasm /usr/bin/X11/nasm /usr/man/man1/nasm.1 /usr/share/man/man1/nasm.1.gz
/usr/bin/:/usr/kde/3.4/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/3.4.4:/opt/blackdown-jdk-1.4.2.02/bin:/opt/blackdown-jdk-1.4.2.02/jre/bin:/usr/qt/3/bin:/usr/kde/3.4/bin:/opt/jdk1.5.0_06/bin/


Nasm has been installed by portage, but configure can't find it.
Also just did manual install but that one can't be found to.

Tried this too:

./configure ac_cv_path_NASM=/usr/bin

Didn't work either.


Anyone knows how to tackle this?
_________________
Mijn Nederlandstalige Gentoo forum:
http://www.gentoo-forum.nl
Back to top
View user's profile Send private message
purevirtual
n00b
n00b


Joined: 23 Sep 2004
Posts: 4

PostPosted: Sat Feb 11, 2006 2:33 am    Post subject: Reply with quote

I've had the same problem with NASM and think it's related to AMD64.
But
Code:
linux32 ./configure
linux32 ./make

worked for me. At least mac compiled without issues.
But whenever I try to decompress or verify an ape file, mac segfaults :cry:
Back to top
View user's profile Send private message
boudewijn
Apprentice
Apprentice


Joined: 11 Jan 2005
Posts: 257
Location: Netherlands

PostPosted: Sun Feb 12, 2006 3:14 pm    Post subject: Reply with quote

purevirtual wrote:
I've had the same problem with NASM and think it's related to AMD64.
But
Code:
linux32 ./configure
linux32 ./make

worked for me. At least mac compiled without issues.
But whenever I try to decompress or verify an ape file, mac segfaults :cry:

damn :(

almost all music on the web is flac (which works usually) or ape :(
ape sucks (nothing illegal by the way: i just download music I already have on vinyl records, and I'm to lazy to record about 1000 records ;) )
_________________
Mijn Nederlandstalige Gentoo forum:
http://www.gentoo-forum.nl
Back to top
View user's profile Send private message
purevirtual
n00b
n00b


Joined: 23 Sep 2004
Posts: 4

PostPosted: Sun Feb 12, 2006 3:49 pm    Post subject: Reply with quote

I'll try to compile ape on my 32-bit machine. Maybe we can create some kind of ape-bin package for AMD64.
Back to top
View user's profile Send private message
boudewijn
Apprentice
Apprentice


Joined: 11 Jan 2005
Posts: 257
Location: Netherlands

PostPosted: Sun Feb 12, 2006 4:27 pm    Post subject: Reply with quote

purevirtual wrote:
I'll try to compile ape on my 32-bit machine. Maybe we can create some kind of ape-bin package for AMD64.



very nice plan.
Do you have Jabber\ICQ\M$N?

boudewijnector@jabber.xs4all.nl , boudewijnector@hotmail.com

Let's discuss it :)
_________________
Mijn Nederlandstalige Gentoo forum:
http://www.gentoo-forum.nl
Back to top
View user's profile Send private message
purevirtual
n00b
n00b


Joined: 23 Sep 2004
Posts: 4

PostPosted: Tue Feb 14, 2006 1:25 am    Post subject: Reply with quote

Ok, for anybody who wants to build mac on AMD64:
- the NASM warning issued by configure can be ignored
- there's a patch available resolving the segfaults:
http://www.oook.cz/bsd/patch-mac-pointercasting
Back to top
View user's profile Send private message
dpetka2001
l33t
l33t


Joined: 04 Mar 2005
Posts: 804

PostPosted: Sat Feb 18, 2006 12:32 pm    Post subject: Reply with quote

one question...if i use this conversion tool what would be the quality of the .mp3 files?? i mean the bitrate...can i define the bitrate of the conversed mp3 files?? or should i convert them to .wav first and then to .mp3 using lame encoder?? thanks...
Back to top
View user's profile Send private message
dpetka2001
l33t
l33t


Joined: 04 Mar 2005
Posts: 804

PostPosted: Mon Feb 20, 2006 1:34 pm    Post subject: Reply with quote

anyone care to answer to my question?? thanks...
Back to top
View user's profile Send private message
Nuisance-Value
n00b
n00b


Joined: 12 Apr 2005
Posts: 23

PostPosted: Wed Mar 01, 2006 11:59 am    Post subject: Reply with quote

If you are using the Pithlit script you can change the bit rate in the following line:

Code:
lame -h "${filename}" "$OUTDIR2/${filename}"


using the help file from lame:

Code:
LAME version 3.96.1 (http://lame.sourceforge.net/)

usage: lame [options] <infile> [outfile]

    <infile> and/or <outfile> can be "-", which means stdin/stdout.

RECOMMENDED:
    lame -h input.wav output.mp3

OPTIONS:
    -b bitrate      set the bitrate, default 128 kbps
    -f              fast mode (lower quality)
    -h              higher quality, but a little slower.  Recommended.
    -m mode         (s)tereo, (j)oint, (m)ono
                    default is (j) or (s) depending on bitrate
    -V n            quality setting for VBR.  default n=4

    --preset type   type must be "medium", "standard", "extreme", "insane",
                    or a value for an average desired bitrate and depending
                    on the value specified, appropriate quality settings will
                    be used.
                    "--preset help" gives more info on these

    --longhelp      full list of options
Back to top
View user's profile Send private message
Nuisance-Value
n00b
n00b


Joined: 12 Apr 2005
Posts: 23

PostPosted: Wed Mar 01, 2006 12:04 pm    Post subject: Reply with quote

I have a question for Pithlit if he is still about or any one that is good with bash.

I want to convert the whole of my APE collect to mp3 in one command.

The folder/file structure is as

TOP LEVEL ->ARTIST ->Albums

The Pithlit Script will only afsak look at one folder at a time.

Would it be possible to change this script to recusively go through the whole folder structure and convert all ape files with in and replicate the folder structre for the converted mp3's?
Back to top
View user's profile Send private message
Pithlit
l33t
l33t


Joined: 27 Dec 2003
Posts: 887
Location: fuhen

PostPosted: Tue Mar 07, 2006 9:06 pm    Post subject: Reply with quote

Would it be possible... yes. But right now I don't have time to learn how (I'm no good at scripting - as said somewhere above :oops: .). AFAIK all it takes is something like "find *.ape && for *.ape convert". As for how... I'm clueless right now. Maybe in a month or so.
_________________
If someone solves a problem for you say thanks... and put [SOLVED] in the title!
Back to top
View user's profile Send private message
Incabulos
n00b
n00b


Joined: 14 Apr 2003
Posts: 28
Location: Sydney, Australia

PostPosted: Fri Mar 17, 2006 1:38 am    Post subject: Reply with quote

Quote:
I want to convert the whole of my APE collect to mp3 in one command.

The folder/file structure is as

TOP LEVEL ->ARTIST ->Albums


Dont know a nice bashy way of doing it, but if you are familar with using find I would try something along the lines of:

Code:
find . -type f -name *.ape -print -exec mac {} -d | lame - {}.mp3 -otherencodingopts \;


Assuming that you want to run mac to convert it to uncompressed PCM audio/wav then feed this to mp3 encoder of choice via STDIN. It will recurse all subdirs and create the .mp3s in the same directory that the .ape files are currently in.

Your output filenames will be a bit broken too - track.ape.mp3 is how the mp3 of track.ape will look. But I'm not pretending to be a coder either :)

I've just discovered the mac tool today, I'm loving that I can convert this idiot format to .oggs rather than having to use some old and busted xmms plugin to play them in their native format.
Back to top
View user's profile Send private message
Nuisance-Value
n00b
n00b


Joined: 12 Apr 2005
Posts: 23

PostPosted: Fri Mar 17, 2006 5:09 pm    Post subject: Reply with quote

I went out and learnt BASH so I could do a full conversion of all of my ape files into mp3 and mirror the directory structure.

Here is my script

http://sourceforge.net/projects/lossless2lossy/

Let me know if you find any bugs or have any requests.
Back to top
View user's profile Send private message
gimpel
Advocate
Advocate


Joined: 15 Oct 2004
Posts: 2720
Location: Munich, Bavaria

PostPosted: Fri Mar 17, 2006 5:23 pm    Post subject: Reply with quote

Nuisance-Value wrote:
I went out and learnt BASH so I could do a full conversion of all of my ape files into mp3 and mirror the directory structure.

Here is my script

http://sourceforge.net/projects/lossless2lossy/

Let me know if you find any bugs or have any requests.


cool! linked ;)

support for .ape files with .cue sheets would be cool. If there is .ape & .cue, convert to mp3, and afterwards use mp3splt to split and tag it.
Oh, and of course ogg support ;)
_________________
http://proaudio.tuxfamily.org/wiki - pro-audio software overlay
Back to top
View user's profile Send private message
Nuisance-Value
n00b
n00b


Joined: 12 Apr 2005
Posts: 23

PostPosted: Fri Mar 17, 2006 6:12 pm    Post subject: Reply with quote

OK I'll have a look.

I really want to add reading ape v1 and v2 and then writting them to the idv3 mp3 tag. But as yet I haven't found a way of getting the info of the ape file.

If any one knows of a linux command line app or manual way or reading it let me know.

Adding OGG support would be easy. I'll look into that straight away...
Back to top
View user's profile Send private message
Pithlit
l33t
l33t


Joined: 27 Dec 2003
Posts: 887
Location: fuhen

PostPosted: Fri Mar 17, 2006 6:19 pm    Post subject: Reply with quote

Weee... yeah.. ogg is easy, so should be the splitting thing. And after that... we'd need to find someone to write us a nice fancy GUI. :twisted:

Ape has tags?
_________________
If someone solves a problem for you say thanks... and put [SOLVED] in the title!
Back to top
View user's profile Send private message
Nuisance-Value
n00b
n00b


Joined: 12 Apr 2005
Posts: 23

PostPosted: Sat Mar 18, 2006 1:08 am    Post subject: Reply with quote

I was thinking of adding a gui once the script has finished. Something new to learn :)

I was also thinking about adding flac too, and wavpack.

Yeah ape has tags :)
Back to top
View user's profile Send private message
Nuisance-Value
n00b
n00b


Joined: 12 Apr 2005
Posts: 23

PostPosted: Sat Mar 18, 2006 2:31 am    Post subject: Reply with quote

I've all but added ogg support now, I just need to know the usual options for it. I don't use ogg myself...

I've so far add what is equilivilent to VBR with settings running from 0 (low) to 10 (hight)

What else do I need to add?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum