将评论标签写入WAV和M4A
我有一个音频应用程序,我需要读和编写WAV和M4A文件的评论标签。这就是我所需要的。我挣扎了几个小时,没有成功。
我到达的最接近的是com.github.goxr3plus:jaudiotagger:2.2.7
。我在用audiorecord
写下的wav成功了Mediarecorder 。
我的问题是:如何使用AudioreCord在文件上编写评论标签?我知道如何使用AudioreCord(包括其标头)编写WAV文件,但是我未能找到明确的规范,例如这个标题。
但是,无论如何,我都不知道如何在有或没有外部库的情况下为M4A文件添加评论标头。线索?
I have an audio app and I need to read and write the COMMENT tag of WAV and M4A files. This is all I need. I had struggled for hours without success.
The closest I arrived is using com.github.goxr3plus:jaudiotagger:2.2.7
. I had success with WAV written with AudioRecord
but exception with M4A written with MediaRecorder
.
My question is: How to write the COMMENT tag on files with AudioRecord? I know how to write a WAV file using AudioRecord, including its headers, but I had failed to find a CLEAR specification, like this one for the headers.
And yet, in any case, I do not know how to add the COMMENT header for M4A files, with or without external libraries. Clues?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在网上浏览很多后,我发现了解决方案在这里 >“其中'....'代表4个字节,显示每个'块的长度''。因此,我做了以下方法,该方法为我构建了ICMT块:
现在很容易:
唯一要小心的是选择均匀长度的字符串
myTextComment
。抱歉,如果这是众所周知的,请添加参考,因为这花了我太多时间。
After surfing the web a lot I found the solution here, where the crucial information is "where '....' represents 4 bytes that show the length of each 'chunk'". So I did the following method that builds the ICMT chunk for me:
Now it is easy:
The only thing to be careful is to choose the string
MyTextComment
with even length.Sorry if this is well known, adding it for reference since it took me waaaaay too much time.