在Python中导入音轨(wav或aiff) [英] Importing audio track (wav or aiff) in Python

查看:201
本文介绍了在Python中导入音轨(wav或aiff)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有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.

  1. 这在Python中可行吗?
  2. 有没有可以让我获取音频文件的库或模块?

在整个搜索过程中,我发现了 scipy.io.wavfile ,适用于WAV音频文件.

Throughout my search, I have found scipy.io.wavfile, which works for WAV audio files.

  1. 还有其他库可以用Python导入音频文件吗?
  2. 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支持-请参见

Python comes with AIFF support as part of the standard library -- see the aifc module.

此模块为读写AIFF和AIFF-C提供支持 文件. AIFF是音频交换文件格式,一种用于存储的格式 文件中的数字音频样本. AIFF-C是该版本的较新版本 格式,其中包含压缩音频数据的功能.

This module provides support for reading and writing AIFF and AIFF-C files. AIFF is Audio Interchange File Format, a format for storing digital audio samples in a file. AIFF-C is a newer version of the format that includes the ability to compress the audio data.

根据最终目标是什么,使用专门设计用于与以下工具配合使用的工具 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)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆