For the complete documentation index, see llms.txt. This page is also available as Markdown.

Can I send multiple files over a streaming websocket?

Audio file headers, such as the headers in .wav files, contain essential metadata about the audio stored within the file. The metadata typically includes details about the audio format, sample rate, and bit depth.

In the context of streaming audio, having valid header information at the beginning of each file is crucial for accurate decoding and playback.

Attempting to stream multiple audio files over the same websocket without removing header information from subsequent files will result in the subsequent files' headers being interpreted as binary audio data. Understanding the nuances of audio file headers is crucial for devising efficient strategies for streaming multiple audio files over websockets while maintaining data integrity.

Due to the complexities involved, we recommend sending a single file per websocket connection.

If it is critical to send multiple files over the same websocket connection, first ensure all files are in the same audio format. You can then remove the header information from all files except the first one, or you can remove the header information from all files and specify the encoding and sample_rate query parameters based on the audio format.

Last updated