Description : The audioop module contains some useful operations on sound fragments. It operates on sound fragments consisting of signed integer samples 8, 16, 24 or 32 bits wide, stored in bytes-like objects. All scalar items are integers, unless specified otherwise.
Changed in version 3.4: Support for 24-bit samples was added. All functions now accept any bytes-like object. String input now results in an immediate error.
This module provides support for a-LAW, u-LAW and Intel/DVI ADPCM encodings.
A few of the more complicated operations only take 16-bit samples, otherwise the sample size (in bytes) is always a parameter of the operation.
Method Name : audioop.max(fragment, width)
Description : Return the maximum of the absolute value of all samples in a fragment.
Method Name : audioop.maxpp(fragment, width)
Description : Return the maximum peak-peak value in the sound fragment.
Method Name : audioop.minmax(fragment, width)
Description : Return a tuple consisting of the minimum and maximum values of all samples in the sound fragment.
Method Name : audioop.mul(fragment, width, factor)
Description : Return a fragment that has all samples in the original fragment multiplied by the floating-point value factor. Samples are truncated in case of overflow.
Method Name : audioop.ratecv(fragment, width, nchannels, inrate, outrate, state[, weightA[, weightB]])
Description : Convert the frame rate of the input fragment.
state is a tuple containing the state of the converter. The converter returns a tuple (newfragment, newstate), and newstate should be passed to the next call of ratecv(). The initial call should pass None as the state.
The weightA and weightB arguments are parameters for a simple digital filter and default to 1 and 0 respectively.
Method Name : audioop.reverse(fragment, width)
Description : Reverse the samples in a fragment and returns the modified fragment.
Method Name : audioop.rms(fragment, width)
Description : Return the root-mean-square of the fragment, i.e. sqrt(sum(S_i^2)/n).
This is a measure of the power in an audio signal.
Method Name : audioop.tomono(fragment, width, lfactor, rfactor)
Description : Convert a stereo fragment to a mono fragment. The left channel is multiplied by lfactor and the right channel by rfactor before adding the two channels to give a mono signal.
Method Name : audioop.tostereo(fragment, width, lfactor, rfactor)
Description : Generate a stereo fragment from a mono fragment. Each pair of samples in the stereo fragment are computed from the mono sample, whereby left channel samples are multiplied by lfactor and right channel samples by rfactor.
Comments