audio
Audio files played as a user’s turn.
A turn’s audio: names a recording to play instead of synthesizing its
text. Any format libsndfile reads works: WAV, MP3, FLAC, OGG.
- async pipecat.evals.audio.load_user_audio(path: str) tuple[bytes, int][source]
Read an audio file as the PCM a user turn is sent as.
The file keeps its own sample rate; the bot resamples on its way in.
- Parameters:
path – Path to the audio file.
- Returns:
Tuple of
(pcm_bytes, sample_rate)– raw 16-bit little-endian mono PCM.- Raises:
ValueError – If the file cannot be read as audio.