Input
AudioInputdataclass
Static audio to be used as input for the VoicePipeline.
Source code insrc/agents/voice/input.py
bufferinstance-attribute
A buffer containing the audio data for the agent. Must be a numpy array of int16 or float32.
frame_rateclass-attributeinstance-attribute
The sample rate of the audio data. Defaults to 24000.
sample_widthclass-attributeinstance-attribute
The sample width of the audio data. Defaults to 2.
channelsclass-attributeinstance-attribute
The number of channels in the audio data. Defaults to 1.
to_audio_file
to_base64
Returns the audio data as a base64 encoded string.
Source code insrc/agents/voice/input.py
StreamedAudioInput
Audio input represented as a stream of audio data. You can pass this to theVoicePipelineand then push audio data into the queue using theadd_audio method.
Source code insrc/agents/voice/input.py
add_audioasync
Adds more audio data to the stream.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
audio | NDArray[int16 |float32] | None | The audio data to add. Must be a numpy array of int16 or float32 or None.If None passed, it indicates the end of the stream. | required |