问题描述
我有AIFF格式的音轨.我想使用Python打开此音频文件,导入声音的幅度并进行一些数学分析,例如傅立叶变换等.
I have an audio track in AIFF format. I would like to open this audio file with Python, and import the amplitudes of the sound and perform some mathematical analysis such as Fourier Transform, etc.
- 这在Python中可行吗?
- 有没有可以让我获取音频文件的库或模块?
在整个搜索过程中,我发现了 scipy.io.wavfile
,适用于WAV音频文件.
Throughout my search, I have found scipy.io.wavfile
, which works for WAV audio files.
- 还有其他库可以用Python导入音频文件吗?
- AIFF文件是否有类似内容?
很明显,我可以将AIFF转换为WAV文件,但如果可能的话,我想直接导入AIFF文件.
Obviously, I can convert the AIFF into a WAV file, but I would like to import the AIFF file directly, if possible.
作为附带的问题:是否存在一些更具体的(具体而言,我的意思是比Python更好的)编程语言来执行此类音频文件的分析和获取?
As a side question: are there some more specific (by specific, I mean better than Python) programming languages to perform such kind of analysis and acquisition of audio files?
推荐答案
Python作为标准库的一部分附带了AIFF支持-请参见 aifc 模块.
Python comes with AIFF support as part of the standard library -- see the aifc module.
根据最终目标是什么,使用专门设计用于与以下工具配合使用的工具 PureData 可能会提高工作效率.音频,并具有读取音频文件和执行fft作为原语的功能.
Depending on what your end goals are, you may be more productive using a tool like PureData that's designed just for working with audio and has things like reading audio files and performing ffts as primitives.
这篇关于在Python中导入音轨(wav或aiff)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!