Medien transkribieren
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_bodyTranskription
Medien transkribieren
Transkribieren Sie eine Audio- oder Videodatei als vollständiges JSON, SRT oder VTT
Medien transkribieren
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_bodyMedien transkribieren
Laden Sie eine Audio- oder Videodatei hoch und erhalten Sie direkt das Transkript. Dieser eigenständige Endpunkt erstellt kein Synchronisationsprojekt. Der Endpunkt akzeptiert Dateien bis zu 200 MB und 2 Stunden. Er verwendet dieselben API-Schlüssel-Zugriffsregeln wie die Übersetzungs-API. Erfolgreiche Anfragen geben HTTP200 zurück.
Anfrage
Senden Siemultipart/form-data mit den folgenden Feldern.
string
erforderlich
Ihr VoiceCheap API-Schlüssel.
file
erforderlich
Die zu transkribierende Audio- oder Videodatei. Unterstützte Formate sind MP4, MOV, MKV, WebM, MPEG, MP3, WAV, M4A, FLAC, OGG und AAC.
string
Standard:"json"
Antwortformat:
json, srt oder vtt.string
Standard:"auto-detect"
Unterstützter ISO-Code der Quellsprache. Lassen Sie dies als
auto-detect, es sei denn, Sie kennen die Quellsprache. Nicht unterstützte explizite Sprachen führen vor Beginn der Verarbeitung zu einem Validierungsfehler.string
Standard:"auto-detect"
auto-detect oder eine Ganzzahl von 1 bis 32.string
Ein JSON-String-Array von Namen, Marken, Akronymen oder Fachbegriffen zur Erkennung. Anfrageterme werden mit dem gespeicherten Konto- oder Team-Glossar zusammengeführt.
["VoiceCheap", "SmartSync", "ITC Global"]
boolean
Standard:"true"
Entfernen Sie häufige Füllwörter aus dem Transkript.
boolean
Standard:"false"
Stellen Sie SRT-Cues
Speaker N: voran oder fügen Sie VTT-Sprach-Tags hinzu. JSON enthält immer den numerischen Sprecher für jedes Segment und jedes Wort.JSON-Antwort
JSON ist die vollständigste Ausgabe. Sie enthält den vollständigen Text, die Sprachkonfidenz, die Mediendauer, Sprecher, zeitgestempelte Segmente und zeitgestempelte Wörter.{
"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
}
]
}
Beispiele
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
Fehler
| Status | Code | Beschreibung |
|---|---|---|
| 400 | FILE_REQUIRED | Es wurde keine Datei hochgeladen |
| 400 | INVALID_FILE_TYPE | Dateityp wird nicht unterstützt |
| 400 | INVALID_MEDIA_STREAM | Datei hat keinen Audiostream |
| 400 | DURATION_DETECTION_FAILED | Mediendauer konnte nicht gelesen werden |
| 400 | DURATION_TOO_LONG | Medien sind länger als zwei Stunden |
| 400 | INVALID_BRAND_VOCABULARY | Ein oder mehrere Glossareinträge sind ungültig |
| 400 | INVALID_BOOLEAN_VALUE | Ein Multipart-Boolean ist nicht true oder false |
| 400 | INVALID_JSON_FORMAT | Ein JSON-kodiertes Multipart-Feld ist fehlerhaft |
| 400 | INVALID_MULTIPART_REQUEST | Multipart-Formulardaten sind fehlerhaft oder zu groß |
| 413 | FILE_TOO_LARGE | Datei überschreitet 200 MB |
| 502 | TRANSCRIPTION_EMPTY | Die Transkription ergab keine verwertbare Sprache |
| 502 | TRANSCRIPTION_FAILED | Die Transkriptions-Engine konnte nicht fertiggestellt werden |
War diese Seite hilfreich?

