@dderevjanik/termux-api
Version:
This library allows you to interact with your Android device from Node.js using termux-api
25 lines (24 loc) • 838 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ttsEngines = ttsEngines;
const child_process_1 = require("child_process");
/**
* Get information about the available text-to-speech (TTS) engines.
* The name of an engine may be given to the termux-tts-speak
*/
async function ttsEngines() {
return new Promise((resolve, reject) => {
const command = `termux-tts-engines`;
(0, child_process_1.exec)(command, (error, stdout, stderr) => {
if (error) {
return reject(`Error: ${error.message}`);
}
if (stderr) {
return reject(`Error: ${stderr}`);
}
const output = stdout.trim();
const enginesInfo = JSON.parse(output);
return resolve(enginesInfo);
});
});
}