Download OpenAPI specification:Download
input | string input text |
speed | number [ 0.8 .. 1.2 ] larger is faster, |
speaker_id | integer Enum: 0 1 2 3 0: SouthWomen 1: NorthemWomen 2: SouthMen 3: NorthemMen |
encode_type | integer Enum: 0 1 0: wav 1: mp3 |
{- "input": "đầu vào",
- "speed": 1,
- "speaker_id": 1,
- "encode_type": 0
}
UklGRv4AAABXQVZFZm10IBAAAAABAAEAgD4AAAB9AAACABAAZGF0YQAAAAA=
encoding_type | string Enum: "wav" "mp3" |
audio_file | string <binary> |
const request = require('request'); var fs = require('fs'); const options = { method: 'POST', url: 'https://ai-speech-text.api.vngcloud.vn/speech-api/api/v1/speechtotext/sync', headers: { 'content-type': 'multipart/form-data', Authorization: 'Bearer REPLACE_BEARER_TOKEN' }, formData: { 'encoding_type': 'wav', 'audio_file': { 'value': fs.createReadStream('REPLACE_FILE_LOCATION'), 'options': { 'filename': 'audio.wav', 'contentType': null } } } }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
{- "id": "stt-9a90bcfe-0e1e-41ba-b574-ae735e44dd07",
- "audio_file": "tts-cce199f7-94ac-45cc-94bb-b37f32342902.wav",
- "encode_type": "wav",
- "billed_duration": 1,
- "transcript": "Đầu vào"
}