Capítulo 324 de 988

Chapter 324: elevenLabsTranscriptToCaptions()

Core Idea

Turns the output from the ElevenLabs Speech to Text API into an array of Caption objects.

Key Concepts

  • Example
  • API
  • Arguments
  • transcript
  • Return value
  • captions
  • See also

Code Examples

const form = new FormData();
form.append('file', new Blob([fs.readFileSync('audio.mp3')]));
form.append('model_id', 'scribe_v2');
form.append('timestamps_granularity', 'word');

const response = await fetch('https://api.elevenlabs.io/v1/speech-to-text', {
	method: 'POST',
	headers: {
		'xi-api-key': process.env.ELEVENLABS_API_KEY!,
	},
	body: form,
});

const transcript = await response.json();
const {captions} = elevenLabsTranscriptToCaptions({transcript});
  • What it demonstrates: Usage pattern for elevenLabsTranscriptToCaptions() from the official docs.

Key Takeaways

  1. Understand example when working with elevenLabsTranscriptToCaptions().
  2. Understand api when working with elevenLabsTranscriptToCaptions().
  3. Understand arguments when working with elevenLabsTranscriptToCaptions().
  4. Understand transcript when working with elevenLabsTranscriptToCaptions().
  5. Understand return value when working with elevenLabsTranscriptToCaptions().

Connects To

  • ai Saas Template: related page in the AI Tooling Integrations section.
  • Bolt: related page in the AI Tooling Integrations section.
  • Chatbot: related page in the AI Tooling Integrations section.