Pergunta

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. Is this possible in Python?
  2. Are there libraries or modules, which allow me to acquire an audio file?

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

  1. Are there other libraries to import audio files in Python?
  2. Is there something similar for AIFF files?

Obviously, I can convert the AIFF into a WAV file, but I would like to import the AIFF file directly, if possible.

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?

Foi útil?

Solução

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

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.

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.

Outras dicas

Yes, I also came across this problem using scipy.io.wavfile. I looked up the problem and see that Scikits might be interesting to get around this wave only solution.

https://sites.google.com/site/ldpyproject/scikits-audiolab

As for Pure Data I use this a lot, but of course it does depend on what you wishing to do with your sound file...?

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top