Package echonest :: Package remix :: Module audio :: Class LocalAudioFile
[hide private]
[frames] | no frames]

Class LocalAudioFile

source code


The basic do-everything class for remixing. Acts as an AudioData object, but with an added analysis selector which is an AudioAnalysis object. It conditianally uploads the file it was initialized with. If the file is already known to the Analyze API, then it does not bother uploading the file.
Instance Methods [hide private]
 
__init__(self, filename, verbose=True, defer=False, sampleRate=None, numChannels=None)
Given an input ndarray, import the sample values and shape (if none is specified) of the input numpy.array.
source code
 
save(self) source code
 
toxml(self, context=None) source code
 
__setstate__(self, state)
Recreates circular reference after unpickling.
source code

Inherited from AudioData: __add__, __getitem__, __len__, add_at, append, encode, getsample, getslice, load, pad_with_zeros, render, sum, unload

Inherited from AudioRenderable: resolve_source, sources

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
a new object with type S, a subtype of T
__new__(cls, filename, verbose=True, defer=False, sampleRate=None, numChannels=None) source code

Inherited from AudioRenderable: init_audio_data

Properties [hide private]
  duration
Since we consider AudioFile to be an evolved version of AudioData, we return the measured duration from the analysis.

Inherited from AudioData: source

Inherited from object: __class__

Method Details [hide private]

__new__(cls, filename, verbose=True, defer=False, sampleRate=None, numChannels=None)
Static Method

source code 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__
(inherited documentation)

__init__(self, filename, verbose=True, defer=False, sampleRate=None, numChannels=None)
(Constructor)

source code 

Given an input ndarray, import the sample values and shape (if none is specified) of the input numpy.array.

Given a filename (and an input ndarray), use ffmpeg to convert the file to wave, then load the file into the data, auto-detecting the sample rate, and number of channels.

Parameters:
  • filename - path to a local MP3 file
Overrides: object.__init__

Property Details [hide private]

duration

Since we consider AudioFile to be an evolved version of AudioData, we return the measured duration from the analysis.
Get Method:
unreachable.duration(self) - Since we consider AudioFile to be an evolved version of AudioData, we return the measured duration from the analysis.