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​
- Whisper - High-quality speech recognition
- Whisper Large - Advanced speech recognition
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 processlanguage: Language code (e.g., "en" for English)task: "transcribe" or "translate"temperature: Controls randomness in outputbest_of: Number of candidates to consider
Best Practices​
- Use high-quality audio files
- Specify the correct language
- Choose appropriate task type
- Handle long audio files properly
- Process results efficiently