Transcrire un média
curl --request POST \
--url https://api.voicecheap.ai/v1/transcribe \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"outputFormat": "<string>",
"originalLanguage": "<string>",
"numberOfSpeakers": "<string>",
"brandVocabulary": "<string>",
"removeFillerWords": true,
"includeSpeakerLabels": true
}
'import requests
url = "https://api.voicecheap.ai/v1/transcribe"
payload = {
"outputFormat": "<string>",
"originalLanguage": "<string>",
"numberOfSpeakers": "<string>",
"brandVocabulary": "<string>",
"removeFillerWords": True,
"includeSpeakerLabels": True
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
outputFormat: '<string>',
originalLanguage: '<string>',
numberOfSpeakers: '<string>',
brandVocabulary: '<string>',
removeFillerWords: true,
includeSpeakerLabels: true
})
};
fetch('https://api.voicecheap.ai/v1/transcribe', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.voicecheap.ai/v1/transcribe",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'outputFormat' => '<string>',
'originalLanguage' => '<string>',
'numberOfSpeakers' => '<string>',
'brandVocabulary' => '<string>',
'removeFillerWords' => true,
'includeSpeakerLabels' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.voicecheap.ai/v1/transcribe"
payload := strings.NewReader("{\n \"outputFormat\": \"<string>\",\n \"originalLanguage\": \"<string>\",\n \"numberOfSpeakers\": \"<string>\",\n \"brandVocabulary\": \"<string>\",\n \"removeFillerWords\": true,\n \"includeSpeakerLabels\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.voicecheap.ai/v1/transcribe")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"outputFormat\": \"<string>\",\n \"originalLanguage\": \"<string>\",\n \"numberOfSpeakers\": \"<string>\",\n \"brandVocabulary\": \"<string>\",\n \"removeFillerWords\": true,\n \"includeSpeakerLabels\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voicecheap.ai/v1/transcribe")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"outputFormat\": \"<string>\",\n \"originalLanguage\": \"<string>\",\n \"numberOfSpeakers\": \"<string>\",\n \"brandVocabulary\": \"<string>\",\n \"removeFillerWords\": true,\n \"includeSpeakerLabels\": true\n}"
response = http.request(request)
puts response.read_bodyTranscription
Transcrire un média
Transcrivez un fichier audio ou vidéo sous forme de JSON, SRT ou VTT complet
Transcrire un média
curl --request POST \
--url https://api.voicecheap.ai/v1/transcribe \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"outputFormat": "<string>",
"originalLanguage": "<string>",
"numberOfSpeakers": "<string>",
"brandVocabulary": "<string>",
"removeFillerWords": true,
"includeSpeakerLabels": true
}
'import requests
url = "https://api.voicecheap.ai/v1/transcribe"
payload = {
"outputFormat": "<string>",
"originalLanguage": "<string>",
"numberOfSpeakers": "<string>",
"brandVocabulary": "<string>",
"removeFillerWords": True,
"includeSpeakerLabels": True
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
outputFormat: '<string>',
originalLanguage: '<string>',
numberOfSpeakers: '<string>',
brandVocabulary: '<string>',
removeFillerWords: true,
includeSpeakerLabels: true
})
};
fetch('https://api.voicecheap.ai/v1/transcribe', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.voicecheap.ai/v1/transcribe",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'outputFormat' => '<string>',
'originalLanguage' => '<string>',
'numberOfSpeakers' => '<string>',
'brandVocabulary' => '<string>',
'removeFillerWords' => true,
'includeSpeakerLabels' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.voicecheap.ai/v1/transcribe"
payload := strings.NewReader("{\n \"outputFormat\": \"<string>\",\n \"originalLanguage\": \"<string>\",\n \"numberOfSpeakers\": \"<string>\",\n \"brandVocabulary\": \"<string>\",\n \"removeFillerWords\": true,\n \"includeSpeakerLabels\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.voicecheap.ai/v1/transcribe")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"outputFormat\": \"<string>\",\n \"originalLanguage\": \"<string>\",\n \"numberOfSpeakers\": \"<string>\",\n \"brandVocabulary\": \"<string>\",\n \"removeFillerWords\": true,\n \"includeSpeakerLabels\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voicecheap.ai/v1/transcribe")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"outputFormat\": \"<string>\",\n \"originalLanguage\": \"<string>\",\n \"numberOfSpeakers\": \"<string>\",\n \"brandVocabulary\": \"<string>\",\n \"removeFillerWords\": true,\n \"includeSpeakerLabels\": true\n}"
response = http.request(request)
puts response.read_bodyTranscrire un média
Téléchargez un fichier audio ou vidéo et recevez directement sa transcription. Ce point de terminaison autonome ne crée pas de projet de doublage. Le point de terminaison accepte des fichiers allant jusqu’à 200 Mo et 2 heures. Il utilise les mêmes règles d’accès par clé API que l’API de traduction. Les requêtes réussies renvoient le code HTTP200.
Requête
Envoyezmultipart/form-data avec les champs suivants.
string
requis
Votre clé API VoiceCheap.
file
requis
Le fichier audio ou vidéo à transcrire. Les formats pris en charge incluent MP4, MOV, MKV, WebM, MPEG, MP3, WAV, M4A, FLAC, OGG et AAC.
string
défaut:"json"
Format de réponse :
json, srt ou vtt.string
défaut:"auto-detect"
Code ISO de la langue source pris en charge. Laissez cette valeur sur
auto-detect sauf si vous connaissez la langue source. Les langues explicites non prises en charge renvoient une erreur de validation avant le début du traitement.string
défaut:"auto-detect"
auto-detect ou un entier compris entre 1 et 32.string
Un tableau de chaînes JSON contenant des noms, des marques, des acronymes ou des termes techniques à reconnaître. Les termes de la requête sont fusionnés avec le glossaire enregistré du compte ou de l’équipe.
["VoiceCheap", "SmartSync", "ITC Global"]
boolean
défaut:"true"
Supprimez les mots de remplissage courants de la transcription.
boolean
défaut:"false"
Préfixez les repères SRT avec
Speaker N: ou ajoutez des balises vocales VTT. Le format JSON inclut toujours le locuteur numérique sur chaque segment et chaque mot.Réponse JSON
Le format JSON est la sortie la plus complète. Il contient le texte intégral, la confiance linguistique, la durée du média, les locuteurs, les segments horodatés et les mots horodatés.{
"source": "standalone",
"language": "en",
"languageConfidence": 0.99,
"duration": 12.4,
"text": "Welcome to VoiceCheap.",
"speakers": [{ "id": 0, "label": "Speaker 1" }],
"segments": [
{
"index": 0,
"text": "Welcome to VoiceCheap.",
"begin": 0.18,
"end": 1.74,
"duration": 1.56,
"speaker": 0,
"language": "en",
"confidence": 0.94,
"words": [
{
"index": 0,
"text": "Welcome",
"speaker": 0,
"confidence": 0.96,
"begin": 0.18,
"end": 0.62,
"duration": 0.44
}
]
}
],
"words": [
{
"index": 0,
"text": "Welcome",
"speaker": 0,
"confidence": 0.96,
"begin": 0.18,
"end": 0.62,
"duration": 0.44
}
]
}
Exemples
curl -X POST "https://api.voicecheap.ai/v1/transcribe" \
-H "x-api-key: vc_your-api-key" \
-F "file=@interview.mp4" \
-F "outputFormat=json" \
-F "numberOfSpeakers=2" \
-F 'brandVocabulary=["VoiceCheap","SmartSync"]'
curl -X POST "https://api.voicecheap.ai/v1/transcribe" \
-H "x-api-key: vc_your-api-key" \
-F "file=@interview.mp4" \
-F "outputFormat=srt" \
-F "includeSpeakerLabels=true" \
--output interview.srt
curl -X POST "https://api.voicecheap.ai/v1/transcribe" \
-H "x-api-key: vc_your-api-key" \
-F "file=@interview.mp4" \
-F "outputFormat=vtt" \
--output interview.vtt
Erreurs
| Statut | Code | Description |
|---|---|---|
| 400 | FILE_REQUIRED | Aucun fichier n’a été téléchargé |
| 400 | INVALID_FILE_TYPE | Le type de fichier n’est pas pris en charge |
| 400 | INVALID_MEDIA_STREAM | Le fichier ne contient aucun flux audio |
| 400 | DURATION_DETECTION_FAILED | La durée du média n’a pas pu être lue |
| 400 | DURATION_TOO_LONG | Le média dépasse deux heures |
| 400 | INVALID_BRAND_VOCABULARY | Une ou plusieurs entrées du glossaire sont invalides |
| 400 | INVALID_BOOLEAN_VALUE | Un booléen multipart n’est pas true ou false |
| 400 | INVALID_JSON_FORMAT | Un champ multipart encodé en JSON est mal formé |
| 400 | INVALID_MULTIPART_REQUEST | Les données de formulaire multipart sont mal formées ou trop volumineuses |
| 413 | FILE_TOO_LARGE | Le fichier dépasse 200 Mo |
| 502 | TRANSCRIPTION_EMPTY | La transcription n’a renvoyé aucune parole exploitable |
| 502 | TRANSCRIPTION_FAILED | Le moteur de transcription n’a pas pu terminer |
Cette page vous a-t-elle été utile ?

