Chat
Audio
Use chat + audio models (audio-as-input
) to transcribe and analyze audio.
Transcribe and Analyze Audio
Process audio files alongside text prompts using a chat model.
Quickstart
Send a text prompt to generate a response from a chat model.
Streaming
Get real-time responses when analyzing an audio file.
javascript
Node.js Example
javascript
Browser Example
javascript
Key Points
Node.js
: Convert the Web Stream usingReadable.fromWeb()
for compatibility.Browser
: UsegetReader()
andTextDecoder
to process the stream.Error Handling
: Both methods use try…catch to handle potential errors.Data Handling
: Data chunks are processed as they arrive via data events or.read()
calls.
Explore Specialized Models
You might also be interested in pretrained models for tasks like:
Speech-to-Text
: Convert spoken words into written text.Audio Classification
: Categorize audio files into predefined labels.