babycat.exceptions¶
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 FileNotFoundError.
- exception FeatureNotCompiled¶
Bases:
babycat.exceptions.BabycatErrorRaised when you are trying to use a feature that wasn’t included at compile-time.
- exception WrongTimeOffset¶
Bases:
babycat.exceptions.BabycatErrorRaised when
start_time_millisecondsand/orend_time_millisecondsis invalid.For example, this exception is raised if you specify an
end_time_millisecondsthat would actually be before thestart_time_milliseconds.
- exception WrongNumChannels¶
Bases:
babycat.exceptions.BabycatErrorRaised 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¶
Bases:
babycat.exceptions.WrongNumChannelsRaised when the user sets both
convert_to_mono = Trueandnum_channels = 1.The
num_channelsflag is used to select the first channel in a (potentially) multi-channel audio file. theconvert_to_monoflag takes all selected channels and flattens them into a mono channel. It is redundant to setnum_channels = 1and alsoconvert_to_mono = True.
- exception CannotZeroPadWithoutSpecifiedLength¶
Bases:
babycat.exceptions.BabycatErrorRaised when
zero_pad_endingis set without settingend_time_milliseconds.The
zero_pad_endingargument is used to pad the ending of an audio waveform with zeros if the audio file runs out of audio from offsetsstart_time_millisecondstoend_time_milliseconds.If you have not set an
end_time_milliseconds, then Babycat will return all of the audio fromstart_time_millisecondsto the end of the audio file. In this context,zero_pad_ending = Trueis not meaningful.
- exception CannotRepeatPadWithoutSpecifiedLength¶
Bases:
babycat.exceptions.BabycatErrorRaised when
repeat_pad_endingis set without settingend_time_milliseconds.If you have not set an
end_time_milliseconds, then Babycat will return all of the audio fromstart_time_millisecondsto the end of the audio file. In this context,repeat_pad_ending = Trueis not meaningful.
- exception CannotSetZeroPadEndingAndRepeatPadEnding¶
Bases:
babycat.exceptions.BabycatErrorRaised if you try to set both
zero_pad_endingandrepeat_pad_endingasTrue.
- exception UnknownInputEncoding¶
Bases:
babycat.exceptions.BabycatErrorRaised when we failed to detect valid audio in the input data.
- exception UnknownDecodeError¶
Bases:
babycat.exceptions.BabycatErrorRaised when we failed to decode the input audio stream, but we don’t know why.
- exception UnknownEncodeError¶
Bases:
babycat.exceptions.BabycatErrorRaised when we failed to encode an audio stream into an output format.
- exception ResamplingError¶
Bases:
babycat.exceptions.BabycatErrorRaised when we failed to resample the waveform.
- exception WrongFrameRate¶
Bases:
babycat.exceptions.BabycatErrorRaised when the user set
frame_rate_hzto a value that we cannot resample to.
- exception WrongFrameRateRatio¶
Bases:
babycat.exceptions.WrongFrameRateRaised when
frame_rate_hzwould upsample or downsample by a factor>= 256.The ratio between
frame_rate_hzand the audio’s original frame rate has to be less than 256–in both cases whereframe_rate_hzis less than the audio’s frame rate (downsampling) or greater than the audio’s frame rate (upsampling).
- exception SourceError¶
Bases:
babycat.exceptions.BabycatErrorRaised during input validation of source transforms.
- exception CannotAppendSourcesWithDifferentNumChannels¶
Bases:
babycat.exceptions.SourceErrorRaised when we try to concatenate two audio sources with a different number of channels.
- exception CannotAppendSourcesWithDifferentFrameRates¶
Bases:
babycat.exceptions.SourceErrorRaised when we try to concatenate two audio sources with different frame rates.