windows 如何以编程方式将两个 aac 文件合并为一个?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/836842/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to programatically combine two aac files into one?
提问by Daren Thomas
I'm looking for a cat
for aac music files (the stuff iTunes uses).
我正在寻找cat
aac 音乐文件(iTunes 使用的东西)。
Use Case: My father in law will not touch computers except for audiobooks he downloads to his iPod. I have taught him some iTunes (Windows) basics, but his library is a mess. It turns out, that iTunes is optimized for listening to podcasts and random songs from your library, not for audiobooks.
用例:我岳父不会碰电脑,除了他下载到他的 iPod 的有声读物。我教过他一些 iTunes (Windows) 基础知识,但他的资料库一团糟。事实证明,iTunes 已针对从您的资料库中收听播客和随机歌曲进行了优化,而不是针对有声读物进行了优化。
I would like to write a script (preferably python, but comfortable with other stuff too) to import his audiobook cds in a sane fashion, combining the tracks of each cd into a bookmarkable aac file (.m4b?) and then adding that to iTunes so it shows up in the audiobooks section.
我想编写一个脚本(最好是 python,但也适合其他东西)以理智的方式导入他的有声读物 cd,将每张 cd 的曲目组合成一个可收藏的 aac 文件(.m4b?),然后将其添加到 iTunes所以它出现在有声读物部分。
I have figured out how to talk to iTunes (there is a COM interface in Windows, look for the iTunes SDK). Using that interface, I can use iTunes to rip the CD to aac format. It's the actual concatenation of the aac files I'm having trouble with. Can't find the right stuff on the net...
我已经想出了如何与 iTunes 对话(Windows 中有一个 COM 接口,查找 iTunes SDK)。使用该界面,我可以使用 iTunes 将 CD 翻录为 aac 格式。这是我遇到问题的 aac 文件的实际串联。在网上找不到合适的东西...
回答by
I created a freeware program called "Chapter and Verse" to concatenate m4a (AAC) files into a single m4b audiobook file with chapter marks and metadata.
我创建了一个名为“Chapter and Verse”的免费软件程序,将 m4a (AAC) 文件连接成一个带有章节标记和元数据的 m4b 有声读物文件。
If you have already ripped the CD's to AAC using itunes (which you say you have) then the rest is easy with my software. I wrote it for this exact reason and scenario. You can download it from www.lodensoftware.com
如果您已经使用 itunes(您说您有)将 CD 翻录为 AAC,那么剩下的工作使用我的软件就很容易了。我正是出于这个原因和场景写了它。您可以从www.lodensoftware.com下载
After trying to work with SlideShow Assembler, the QT SDK and a bunch of other command line tools, I ended up building my own application based on the publicly available MP4v2 library. The concatenating of files and adding of chapters is done using the MP4v2 library.
在尝试使用 SlideShow Assembler、QT SDK 和一堆其他命令行工具后,我最终基于公开可用的 MP4v2 库构建了自己的应用程序。文件的连接和章节的添加是使用 MP4v2 库完成的。
There are quite a few nuances in building an audiobook properly formatted for the iPod. The information is hard to find. Working with Apple documentation and open libraries has its own challenges as well.
为 iPod 构建格式正确的有声读物有很多细微差别。信息很难找到。使用 Apple 文档和开放库也有其自身的挑战。
Best of Luck.
祝你好运。
回答by joshk0
Not programming related (well, kinda.)
与编程无关(好吧,有点。)
iTunes already has functionality to rip as a single track (e.g. an audiobook.) Check this out: http://www.ehow.com/how_2108906_merge-cd-single-track-itunes.html
iTunes 已经具有作为单个曲目翻录的功能(例如有声读物)。请查看:http: //www.ehow.com/how_2108906_merge-cd-single-track-itunes.html
That fixes your immediate problem, but I guess people can keep discussing how to do it programatically.
这解决了您眼前的问题,但我想人们可以继续讨论如何以编程方式做到这一点。
回答by Tim Lin
The most powerful Python audio manipulation module out there seems to be Python Audio Tools. The download comes with CLI tools that would probably do everything you'd want to do, even ripping, so you can even get by with shell scripting the whole thing. The module itself is also pretty powerful and has a handy set of functions to manipulate audio files. If you want to stick with writing everything in python, you can possibly learn enough to do what you want to do after studying their CLI source code. Specifically they have a tool that just does audio file cat in any codec. (They do depend on FAAC/FAAD2 for AAC support, but that'd be true for every library you'll find)
最强大的 Python 音频操作模块似乎是Python Audio Tools。下载附带的 CLI 工具可能会做你想做的一切,甚至翻录,所以你甚至可以通过 shell 脚本来完成整个事情。该模块本身也非常强大,并具有一组方便的功能来操作音频文件。如果您想坚持用 Python 编写所有内容,那么在研究了他们的 CLI 源代码后,您可能会学到足够多的知识来做您想做的事情。具体来说,他们有一个工具可以在任何编解码器中处理音频文件 cat。(它们确实依赖于 FAAC/FAAD2 的 AAC 支持,但对于您会找到的每个库都是如此)
回答by JimB
I haven't seen an aac codec library for python, but you could use wav files as an intermediary format.
我还没有看到用于 python 的 aac 编解码器库,但您可以使用 wav 文件作为中间格式。
You can pull the tracks off the cd as wav files, and then use the wave moduleto concatenate them into one large file, which could then be converted by itunes to aac. This may increase your processing time considerably because of the size of the data, but it would be fairly easy, and you don't need any external libraries.
您可以将光盘中的曲目作为 wav 文件拉出,然后使用wave 模块将它们连接成一个大文件,然后可以通过 iTunes 将其转换为 aac。由于数据的大小,这可能会大大增加您的处理时间,但它会相当容易,并且您不需要任何外部库。