Contains all built-in exceptions raised by Babycat.
However, Babycat does raise a few exceptions that are not included
in this module, such as like
- exception FeatureNotCompiled¶
Raised when you are trying to use a feature that wasn’t included at compile-time.
- exception WrongTimeOffset¶
For example, this exception is raised if you specify an
end_time_millisecondsthat would actually be before the
- exception WrongNumChannels¶
Raised when you want more channels than the audio has.
For example, if you passed
num_channels = 3as a decoding argument, but the audio file only has two channels, then we’ll raise this exception.
- exception WrongNumChannelsAndMono¶
Raised when the user sets both
convert_to_mono = Trueand
num_channels = 1.
num_channelsflag is used to select the first channel in a (potentially) multi-channel audio file. the
convert_to_monoflag takes all selected channels and flattens them into a mono channel. It is redundant to set
num_channels = 1and also
convert_to_mono = True.
- exception CannotZeroPadWithoutSpecifiedLength¶
zero_pad_endingis set without setting
zero_pad_endingargument is used to pad the ending of an audio waveform with zeros if the audio file runs out of audio from offsets
If you have not set an
end_time_milliseconds, then Babycat will return all of the audio from
start_time_millisecondsto the end of the audio file. In this context,
zero_pad_ending = Trueis not meaningful.
- exception UnknownInputEncoding¶
Raised when we failed to detect valid audio in the input data.
- exception UnknownDecodeError¶
Raised when we failed to decode the input audio stream, but we don’t know why.
- exception UnknownEncodeError¶
Raised when we failed to encode an audio stream into an output format.
- exception ResamplingError¶
Raised when we failed to resample the waveform.
- exception WrongFrameRate¶
Raised when the user set
frame_rate_hzto a value that we cannot resample to.
- exception WrongFrameRateRatio¶
frame_rate_hzwould upsample or downsample by a factor
The ratio between
frame_rate_hzand the audio’s original frame rate has to be less than 256–in both cases where
frame_rate_hzis less than the audio’s frame rate (downsampling) or greater than the audio’s frame rate (upsampling).