简体   繁体   English

用Python / Java复制音频CD

[英]Ripping an audio CD in Python/Java

I have about 500 cd's that need backing up, they contain old sessions. 我有大约500 cd需要备份,其中包含旧会话。

I need a library that can be used by either (Java / Python) to rip these cd's 我需要一个可以被任一(Java / Python)翻录这些CD的库

It does not need to support 'nix and must support * Windows * 它不需要支持'nix,并且必须支持* Windows *

Bonus points given for a framework that can also handle metadata attached to tracks. 为框架提供的加分点也可以处理附加到轨道的元数据。

I have been looking for ages now, I cannot find anything and this question is on-topic 我一直在寻找的年龄,现在,我无法找到任何东西,这个问题是关于话题

We feel the best Stack Overflow questions have a bit of source code in them, but if your question generally covers … software tools commonly used by programmers … then you're in the right place to ask your question! 我们认为最好的Stack Overflow问题中包含一些源代码,但是如果您的问题通常涉及…程序员常用的软件工具…那么您来对地方了!

Edit: 编辑:

Still not found freeware libraries that support audio-cd ripping 仍未找到支持音频CD翻录的免费软件库

Java has a sound api http://www.oracle.com/technetwork/java/index-139508.html Java具有完善的api http://www.oracle.com/technetwork/java/index-139508.html

This site has some good resources, examples and source code: http://www.jsresources.org/examples/ And this: 该站点提供了一些很好的资源,示例和源代码: http : //www.jsresources.org/examples/并且:

that read audio CDs directly to extract the sound data. 直接读取音频CD来提取声音数据。 The examples utilize the package javax.sound.sampled. 这些示例使用包javax.sound.sampled。

http://www.jsresources.org/examples/audio_cdda.html http://www.jsresources.org/examples/audio_cdda.html

I can't find anything on Windows that has a direct API either, but you might get what you want by search for "command line". 我在Windows上也找不到具有直接API的任何东西,但是通过搜索“命令行”,您可能会得到想要的东西。 I found things like: 我发现类似:

Which you could then integrate into either a java or python process which managed the larger conversion process. 然后可以将其集成到管理较大的转换过程的Java或python过程中。 You could then use a tool like Mutagen to add the appropriate audio metadata for your recordings. 然后,您可以使用Mutagen之类的工具为您的录音添加适当的音频元数据。

Also, keep in mind that if you can find some way to mount the audio CD as a data disc (I don't know what current Windows behavior is, but MacOS X can do this, for example), you can just copy the CDA files from the disk and use a larger variety of tools and libraries to do the file type conversion. 另外,请记住,如果您找到某种方式将音频CD挂载为数据光盘(例如,我不知道Windows当前的行为是什么,但是MacOS X可以做到),则只需复制CDA磁盘中的文件,并使用各种工具和库来进行文件类型转换。

I'm pretty sure the the Windows Media Player COM API includes ripping functions. 我很确定Windows Media Player COM API包含翻录功能。 Semi-guaranteed to be on your Windows computer. 半保证可以在Windows计算机上使用。 Here's the C++ IWMPCdromRip interface (MSDN) 这是C ++ IWMPCdromRip接口 (MSDN)

Shot in the dark Python solution would be pywin32 for COM added to the WMP COM API - should get you what you want, though I'm also curious why you wouldn't want to just rip using WMP (or something else) and then post-process the resulting files as suggested by Adam Gent. 在黑暗的Python解决方案中拍摄的是将pywin32 for COM添加到WMP COM API中-应该可以为您提供所需的内容,尽管我也很好奇为什么您不希望仅使用WMP(或其他方法)进行撕裂,然后发布-按照Adam Gent的建议处理结果文件。 With 1 or 500+ CDs, I'd expect the big time sink to be physically loading the media and waiting for it to rip, not operating the buttons for ripping. 对于1张或500张以上的CD,我希望大量的时间用于物理加载媒体并等待其撕裂,而不是操作用于撕裂的按钮。

I haven't done too much with COM under either Java or Python (I don't use Windows for dev much any more), but years ago it was easy enough from C/C++ using the Windows gcc port (so no help from MSVS/CLR), Pascal, etc., so I can't imagine it wouldn't be available in Java (and of course it's there for Python using pywin32). 我在Java或Python下都没有对COM进行过多的工作(我不再将Windows用于开发工作了),但是几年前,使用Windows gcc端口从C / C ++中已经很容易了(所以MSVS没有帮助) / CLR),Pascal等,因此我无法想象Java中不会提供它(当然,使用pywin32的Python也可以使用它)。

If I could I would have done a "let-me-google-that-for-you-link"... 如果可以的话,我会做一个“让我为您链接的Google” ...

http://www.foobar2000.org/ http://www.foobar2000.org/

Foobar2000 seems to do what you want and has an SDK. Foobar2000似乎可以满足您的要求,并且具有SDK。 You could use Python CTypes although truthfully I don't think you will need to do any programming for what you want to do. 您可以使用Python CType,尽管实际上我认为您不需要为要执行的任何编程。

Addendum: 附录:

Python Option: Python选项:

You might want to also check out: http://code.google.com/p/quodlibet/ . 您可能还需要签出: http : //code.google.com/p/quodlibet/ Its written in Python and is cross platform with some rather powerful tagging capabilities (thanks to Mutagen which is free). 它是用Python编写的,并且是跨平台的,具有一些相当强大的标记功能(感谢Mutagen是免费的)。 However (from a cursory glance) it does not look like it supports ripping but you could use another tool for that. 但是(粗略地看)它似乎不支持翻录,但是您可以使用其他工具。

Java Option: Java选项:

I haven't tried atunes but it looks promising: http://www.atunes.org/?page_id=6 . 我没有尝试过atunes,但是看起来很有希望: http : //www.atunes.org/ ?page_id =6 According to their site there is a windows installer but "For ripping, lame, flac or oggenc must be installed." 根据他们的站点,有一个Windows安装程序,但是“要进行翻录,必须安装la脚,flac或oggenc。”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM