如何使用python从mp3文件中提取原始数据?

编程入门 行业动态 更新时间:2024-10-27 11:16:19
本文介绍了如何使用python从mp3文件中提取原始数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经完成了有关使用Python进行音频数据分析的作业.我想知道有没有什么好的模块可供我用来从mp3文件中提取原始数据.我的意思是原始数据,而不是元数据,id3标签.

I have got homework regarding audio data analysis using Python. I wonder is there any good module for me to use to extract the raw data from a mp3 file. I mean the raw data, not the metadata, id3 tags.

我知道如何使用wave模块来处理.wav文件.我可以readframes获取原始数据.但我不知道该如何处理mp3.我在Google和stackoverflow上搜索了很多内容,然后找到了eyeD3.但是不幸的是,文档相当令人沮丧,现在的版本是0.7.1,与我在Internet上可以找到的大多数示例不同.

I know how to use the wave module to process .wav files. I can readframes to get the raw data. But I don't know how to do with mp3. I have searched a lot on google and stackoverflow and find eyeD3. But unfortunately the documentation is rather frustrating and now the version is 0.7.1, different from most examples I can find on the Internet.

有没有什么好的模块可以从mp3中提取原始数据?如果eyeD3有任何好的文档,那也很好.

Is there any good module that can extract raw data from a mp3? If there is any good documentation for eyeD3, it is also good.

推荐答案

如果我理解您的问题,则可以尝试使用 pydub (我写的一个库)来获取音频数据,如下所示:

If I understand your question, you can try using pydub (a library I wrote) to get the audio data like so:

from pydub import AudioSegment sound = AudioSegment.from_mp3("test.mp3") # sound._data is a bytestring raw_data = sound._data

更多推荐

如何使用python从mp3文件中提取原始数据?

本文发布于:2023-10-31 08:01:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1545509.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何使用   原始数据   文件   python

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!