audioop.lin2alaw()

audioop.lin2alaw(fragment, width) Convert samples in the audio fragment to a-LAW encoding and return this as a bytes object. a-LAW is an audio encoding format whereby you get a dynamic range of about 13 bits using only 8 bit samples. It is used by the Sun audio hardware, among others.

audioop.max()

audioop.max(fragment, width) Return the maximum of the absolute value of all samples in a fragment.

audioop.getsample()

audioop.getsample(fragment, width, index) Return the value of sample index from the fragment.

audioop.lin2ulaw()

audioop.lin2ulaw(fragment, width) Convert samples in the audio fragment to u-LAW encoding and return this as a bytes object. u-LAW is an audio encoding format whereby you get a dynamic range of about 14 bits using only 8 bit samples. It is used by the Sun audio hardware, among others.

audioop.maxpp()

audioop.maxpp(fragment, width) Return the maximum peak-peak value in the sound fragment.

audioop.lin2lin()

audioop.lin2lin(fragment, width, newwidth) Convert samples between 1-, 2-, 3- and 4-byte formats. Note In some audio formats, such as .WAV files, 16, 24 and 32 bit samples are signed, but 8 bit samples are unsigned. So when converting to 8 bit wide samples for these formats, you need to also add 128 to the result: new_frames = audioop.lin2lin(frames, old_width, 1) new_frames = audioop.bias(new_frames, 1, 128) The same, in reverse, has to be applied when converting from 8 to 16, 24 or 32 bi

audioop.bias()

audioop.bias(fragment, width, bias) Return a fragment that is the original fragment with a bias added to each sample. Samples wrap around in case of overflow.

audioop.error

exception audioop.error This exception is raised on all errors, such as unknown number of bytes per sample, etc.

audioop.cross()

audioop.cross(fragment, width) Return the number of zero crossings in the fragment passed as an argument.

audioop.findfactor()

audioop.findfactor(fragment, reference) Return a factor F such that rms(add(fragment, mul(reference, -F))) is minimal, i.e., return the factor with which you should multiply reference to make it match as well as possible to fragment. The fragments should both contain 2-byte samples. The time taken by this routine is proportional to len(fragment).