snarlydwarf Wrote: 
> Well it wouldn't have to incorporate any decoder at all, actually: it is
> assumedly possible to tell the difference between AAC and Apple Lossless
> by some quick peek at the file.
> 
> So a little baby perl program that did this check and then passed
> exec'd the proper decoder should be doable.
> 
> ie,
> if ($aac) {
> exec ($AAC_DECODER, @args);
> } elsif ($lossless) {
> exec ($APPLE_LOSSLESS_DECODER, @args);
> } else {
> print STDERR "Not lossless or aac, I give up.\n";
> }
> 
> I don't have any aac or apple lossless, so no idea how to tell the
> difference between them, but it should be doable with just a few lines
> of perl.
> 
> You may need to massage the @args a bit as well, but that shouldn't be
> too hard, especially if you cheat and make convert.conf pass the args
> you want in the order you want.

Yes, good point.  In fact, this little perl script could attempt the
more common codec first (AAC via faad2) and parse STDERR/STDOUT for
certain faad2 error messages which occur from trying to play a non-AAC
file.  If the error occurred, it could then attempt the second, less
common (ALAC via alac) on the file.  If an error occurred with alac
then you'd assume the file was either corrupt or an unrecognized codec.


-- 
emeraldcityeg
------------------------------------------------------------------------
emeraldcityeg's Profile: http://forums.slimdevices.com/member.php?userid=4782
View this thread: http://forums.slimdevices.com/showthread.php?t=22572

_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/unix

Reply via email to