Python uses speech to text
Request Sandbox
1from openai import OpenAI23client = OpenAI(4 base_url="https://api.AiApiGiaRe.io/v1",5 api_key=key6)78# Basic transcription9audio_file = open("/path/to/file/audio.mp3", "rb")10transcription = client.audio.transcriptions.create(11 model="whisper-1", 12 file=audio_file13)14print(transcription.text)1516# Specify output format17transcription = client.audio.transcriptions.create(18 model="whisper-1", 19 file=audio_file, 20 response_format="text"21)Target: api.aiapigiare.io.vn
TLS 1.3 ActiveSpeech-to-Text API Guide
Request Sandbox
1from openai import OpenAI23client = OpenAI(4 base_url="https://api.AiApiGiaRe.io/v1",5 api_key=key6)78# Basic transcription9audio_file = open("/path/to/file/audio.mp3", "rb")10transcription = client.audio.transcriptions.create(11 model="whisper-1", 12 file=audio_file13)14print(transcription.text)1516# Specify output format17transcription = client.audio.transcriptions.create(18 model="whisper-1", 19 file=audio_file, 20 response_format="text"21)Target: api.aiapigiare.io.vn
TLS 1.3 ActiveOverview
The Audio API provides two main endpoints:
- 📝 transcriptions: Convert audio to text in the original language.
- 🔄 translations: Translate audio into English text.
Supported Formats
- 📁 File Size: Up to 25 MB
- 🎵 Supported Formats: mp3, mp4, mpeg, mpg, m4a, wav, webm
Usage Instructions
1. Transcription
Convert audio into text in its original language.
(Code extracted to sandbox)
2. Translation
Convert audio in any language into English text.
(Code extracted to sandbox)
3. Timestamp Functionality
(Code extracted to sandbox)
4. Handling Large Files
Use PyDub to split files larger than 25 MB:
(Code extracted to sandbox)
Optimization Tips
Prompt Usage Techniques
- 🔍 Correct specific word recognition.
- 📜 Maintain contextual continuity.
- ✍️ Control punctuation output.
- 🗣️ Retain filler words.
- 📝 Control text output style (e.g., simplified or traditional Chinese).
Supported Languages
The API supports 98 languages, including:
- Major Asian Languages: Chinese, Japanese, Korean, etc.
- European Languages: English, French, German, etc.
- Other Regional Languages: Arabic, Hindi, etc.
Note: Only languages with a Word Error Rate (WER) below 50% are listed. Other languages are supported but may have lower quality.