utils
Vonage Video Connector utils.
- class pipecat.transports.vonage.utils.AudioProps(sample_rate: int, is_stereo: bool)[source]
Bases:
objectAudio properties for normalization.
- Parameters:
sample_rate – The sample rate of the audio.
is_stereo – Whether the audio is stereo (True) or mono (False).
- sample_rate: int
- is_stereo: bool
- class pipecat.transports.vonage.utils.ImageFormat(*values)[source]
Bases:
StrEnumEnum for image formats.
- PLANAR_YUV420 = 'PLANAR_YUV420'
- PACKED_YUV444 = 'PACKED_YUV444'
- RGB = 'RGB'
- RGBA = 'RGBA'
- BGR = 'BGR'
- BGRA = 'BGRA'
- pipecat.transports.vonage.utils.check_audio_data(buffer: bytes | memoryview, number_of_frames: int, number_of_channels: int) None[source]
Check the audio sample width based on buffer size, number of frames and channels.
- pipecat.transports.vonage.utils.process_audio_channels(audio: ndarray[tuple[Any, ...], dtype[int16]], current: AudioProps, target: AudioProps) ndarray[tuple[Any, ...], dtype[int16]][source]
Normalize audio channels to the target properties.
- async pipecat.transports.vonage.utils.process_audio(resampler: BaseAudioResampler, audio: ndarray[tuple[Any, ...], dtype[int16]], current: AudioProps, target: AudioProps) ndarray[tuple[Any, ...], dtype[int16]][source]
Normalize audio to the target properties.
- pipecat.transports.vonage.utils.image_colorspace_conversion(image: bytes, size: tuple[int, int], from_format: ImageFormat, to_format: ImageFormat) bytes | None[source]
Convert image colorspace from one format to another.