English Language đēđ¸
Example Code Using Node.js
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
let data = new FormData();
data.append('file', fs.createReadStream('YOUR_UPLOADED_FILE'));
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://api.iapp.co.th/asr/v3',
headers: {
'apikey': 'YOUR_API_KEY',
...data.getHeaders()
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
let data = new FormData();
data.append('file', fs.createReadStream('YOUR_UPLOADED_FILE'));
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://api.iapp.co.th/asr/v3',
headers: {
'apikey': 'YOUR_API_KEY',
...data.getHeaders()
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
import requests
url = "https://api.iapp.co.th/asr/v3"
files=[
('file',('{YOUR_MEDIA_FILE}',open('{YOUR_FILE_PATH}','rb'),'application/octet-stream'))
]
headers = {
'apikey': '{YOUR_API_KEY}'
}
response = requests.request("POST", url, headers=headers, files=files)
print(response.text)
{
"output": [
{
"text": " Hello, I'm Siang Poo Yai.",
"speaker": "SPEAKER_01",
"start": 0.009,
"end": 2.944,
"segment": 0
},
{
"text": " Hello, I'm a grown man.",
"speaker": "SPEAKER_00",
"start": 4.104,
"end": 7.5,
"segment": 1
}
],
"audio_duration_in_seconds": 7.629,
"uploaded_filename": "2ppl (3).wav",
"processing_time_in_seconds": 0.37958788871765137
}