Skip to main content

Speech-to-Text Guide 🎤

Overview​

This guide will help you get started with speech-to-text conversion using our AI models. We'll cover how to convert audio files to text and process the results.

Available Models​

Basic Usage​

Here's a simple example of how to convert speech to text:

from flymyai import client

# Initialize the client
fma_client = client(apikey="your-api-key")

# Set the model
model = "flymyai/whisper"

# Prepare the input data
payload = {
"audio_url": "https://example.com/audio.mp3",
"language": "en",
"task": "transcribe"
}

# Make the prediction
response = fma_client.predict(
model=model,
payload=payload
)

# Get the transcribed text
transcribed_text = response.output_data["text"]

Parameters​

  • audio_url: URL of the audio file to process
  • language: Language code (e.g., "en" for English)
  • task: "transcribe" or "translate"
  • temperature: Controls randomness in output
  • best_of: Number of candidates to consider

Best Practices​

  1. Use high-quality audio files
  2. Specify the correct language
  3. Choose appropriate task type
  4. Handle long audio files properly
  5. Process results efficiently