Transcrever 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_bodyTranscrição
Transcrever Mídia
Transcreva um arquivo de áudio ou vídeo como JSON, SRT ou VTT completo
Transcrever 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_bodyTranscrever Mídia
Envie um arquivo de áudio ou vídeo e receba sua transcrição diretamente. Este endpoint independente não cria um projeto de dublagem. O endpoint aceita arquivos de até 200 MB e 2 horas. Ele usa as mesmas regras de acesso de chave de API que a API de tradução. Solicitações bem-sucedidas retornam HTTP200.
Solicitação
Enviemultipart/form-data com os seguintes campos.
string
obrigatório
Sua chave de API VoiceCheap.
file
obrigatório
O arquivo de áudio ou vídeo a ser transcrito. Os formatos suportados incluem MP4, MOV, MKV, WebM, MPEG, MP3, WAV, M4A, FLAC, OGG e AAC.
string
padrão:"json"
Formato de resposta:
json, srt ou vtt.string
padrão:"auto-detect"
Código ISO do idioma de origem suportado. Deixe como
auto-detect a menos que você saiba o idioma de origem. Idiomas explícitos não suportados retornam um erro de validação antes do início do processamento.string
padrão:"auto-detect"
auto-detect ou um número inteiro de 1 a 32.string
Uma matriz de strings JSON de nomes, marcas, acrônimos ou termos de domínio a serem reconhecidos. Os termos da solicitação são mesclados com o glossário da conta ou da equipe salvo.
["VoiceCheap", "SmartSync", "ITC Global"]
boolean
padrão:"true"
Remova palavras de preenchimento comuns da transcrição.
boolean
padrão:"false"
Prefixe as indicações de SRT com
Speaker N: ou adicione tags de voz VTT. O JSON sempre inclui o locutor numérico em cada segmento e palavra.Resposta JSON
JSON é a saída mais completa. Ele contém o texto completo, confiança do idioma, duração da mídia, locutores, segmentos com carimbo de data/hora e palavras com carimbo de data/hora.{
"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
}
]
}
Exemplos
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
Erros
| Status | Código | Descrição |
|---|---|---|
| 400 | FILE_REQUIRED | Nenhum arquivo foi enviado |
| 400 | INVALID_FILE_TYPE | O tipo de arquivo não é suportado |
| 400 | INVALID_MEDIA_STREAM | O arquivo não possui fluxo de áudio |
| 400 | DURATION_DETECTION_FAILED | A duração da mídia não pôde ser lida |
| 400 | DURATION_TOO_LONG | A mídia tem mais de duas horas |
| 400 | INVALID_BRAND_VOCABULARY | Uma ou mais entradas do glossário são inválidas |
| 400 | INVALID_BOOLEAN_VALUE | Um booleano multipart não é true ou false |
| 400 | INVALID_JSON_FORMAT | Um campo multipart codificado em JSON está malformado |
| 400 | INVALID_MULTIPART_REQUEST | Os dados do formulário multipart estão malformados ou são muito grandes |
| 413 | FILE_TOO_LARGE | O arquivo excede 200 MB |
| 502 | TRANSCRIPTION_EMPTY | A transcrição não retornou fala utilizável |
| 502 | TRANSCRIPTION_FAILED | O mecanismo de transcrição não pôde terminar |
Esta página foi útil?

