Supported audio formats (looking for APE)

I was looking in moc for APE (MonkeyAudio) support, but it seems that this format is no supported. If i am wrong please let me know. If this format is not supported, are there any plans to put support for it to mocp ?.

There are plans, but I don't know when. Maybe someone else do this?

--
Damian Pietras - MOC developer

Maybe you can use mac-port to decompress APE files (i don't know if it is possible on the fly).

EdGeIII crypt # mac help
--- Monkey's Audio Console Front End (v 3.99) (c) Matthew T. Ashland ---
Proper Usage: [EXE] [Input File] [Output File] [Mode]

Modes:
Compress (fast): '-c1000'
Compress (normal): '-c2000'
Compress (high): '-c3000'
Compress (extra high): '-c4000'
Compress (insane): '-c5000'
Decompress: '-d'
Verify: '-v'
Convert: '-nXXXX'

Examples:
Compress: mac.exe "Metallica - One.wav" "Metallica - One.ape" -c2000
Decompress: mac.exe "Metallica - One.ape" "Metallica - One.wav" -d
Verify: mac.exe "Metallica - One.ape" -v
(note: int filenames must be put inside of quotations)

The bigest problem is the lack of my free time, not the lack of a known solution to do that.

--
Damian Pietras - MOC developer

Is there any chance to make moc to play ape files, that would be a really nice feature, not many players under linux and especially console players are able to play them.

I can't play ape file but i can play flac, so here is what i do :

cuebreakpoints sample.cue | shnsplit -o flac sample.ape

this commands splits the ape file and produces flac files

cuebreakpoints sample.cue | shnsplit -n name -o flac sample.ape

this one does the same but names the flac files

Thanks it helped me ;0

corewavpack

I updated my ffmpeg libs and realized that there is now support for playing APE files via ffplay.
It seems that MOCs ffmpeg-decoder can be used to playback APE files by just adding this filetype to its known formats.
This worked on my machine - there is definitely some investigation to do as to find out how to check in MOC's configuration whether the ffmpeg-libs on the machine support APE...

But using ffmpeg seems to way to go...

Just my two cent.

here's the patch:
http://pastebin.com/f3e7cc6ae
--- decoder_plugins/ffmpeg/ffmpeg.c.old
+++ decoder_plugins/ffmpeg/ffmpeg.c
@@ -345,6 +345,8 @@
strcpy (buf, "MP4");
else if (!strcasecmp(ext, "m4a"))
strcpy (buf, "M4A");
+ else if (!strcasecmp(ext, "ape"))
+ strcpy (buf, "APE");
}

static int ffmpeg_our_format_ext (const char *ext)
@@ -353,7 +355,8 @@
|| !strcasecmp(ext, "ra")
|| !strcasecmp(ext, "m4a")
|| !strcasecmp(ext, "mp4")
- || !strcasecmp(ext, "aac");
+ || !strcasecmp(ext, "aac")
+ || !strcasecmp(ext, "ape");
}


static void ffmpeg_get_error (void *prv_data, struct decoder_error *error)

i am auto-patching FreeBSD port by adding this to ~/etc/ports.diff (which is applied after each ports update):
http://pastebin.com/f59e8156d
--- /dev/null 2009-03-05 17:44:41.000000000 +0200
+++ audio/moc/files/patch-decoder_plugins-ffmpeg-ffmpeg.c 2009-03-05 17:43:52.000000000 +0200
@@ -0,0 +1,21 @@
+--- decoder_plugins/ffmpeg/ffmpeg.c.old
++++ decoder_plugins/ffmpeg/ffmpeg.c
+@@ -345,6 +345,8 @@
+ strcpy (buf, "MP4");
+ else if (!strcasecmp(ext, "m4a"))
+ strcpy (buf, "M4A");
++ else if (!strcasecmp(ext, "ape"))
++ strcpy (buf, "APE");
+ }
+
+ static int ffmpeg_our_format_ext (const char *ext)
+@@ -353,7 +355,8 @@
+ || !strcasecmp(ext, "ra")
+ || !strcasecmp(ext, "m4a")
+ || !strcasecmp(ext, "mp4")
+- || !strcasecmp(ext, "aac");
++ || !strcasecmp(ext, "aac")
++ || !strcasecmp(ext, "ape");
+ }
+
+ static void ffmpeg_get_error (void *prv_data, struct decoder_error *error)

maybe someone should send pr...

Thanks for the patch.

I edited ffmpeg.c manually since aac is moved to a separate plugin in the latest svn revision.
But it works like a charm :-)

Regards, Wansfell

I mannually added ape strings in the source file, but i can't view the ape files.
2211 revision

Resolved by SVN commit r2408.

For some reason moc does not recognise my .ape files. The directory shows up empty. I can play the files with e.g. mplayer, so ffmpeg supports ape:
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders<br /> libavcodec version 54.23.100 (internal)<br /> AUDIO: 44100 Hz, 2 ch, s16le, 0.0 kbit/0.00% (ratio: 0-&gt;176400)<br /> Selected audio codec: [ffape] afm: ffmpeg (FFmpeg Monkey's Audio)

When I try to play the track directly from the command line with moc, it gives the following message:

<br /> Note: No relevant classes found. No output generated.<br />

Do I need to add a specific option during configuration?

Replying to self... it may help some one else too.

I rebuild moc with the build option --without-aac forcing moc to use the aac codec from ffmpeg and all is well.

Edit: Simply rebuilding moc did the job (rather than using the standard Slackware package).

The answer is actually simpler than it would appear. Slackware's MOC package does not include MOC's FFmpeg decoder plug-in (required for APE) but when you rebuilt it from source that plug-in did get installed.

Why Slackware's package does not include the FFmpeg decoder I do not know. It is not excluded by the build script nor removed subsequently, so it must be that FFmpeg was not found by configure.

Indeed, ffmpeg is not included as an official Slackware package. It can however be easily added through other repositories (e.g. slackbuilds.org).