@dderevjanik/termux-api
Version:
This library allows you to interact with your Android device from Node.js using termux-api
24 lines (23 loc) • 741 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.audioInfo = audioInfo;
const child_process_1 = require("child_process");
/**
* Get information about audio capabilities
*/
async function audioInfo() {
return new Promise((resolve, reject) => {
const command = `termux-audio-info`;
(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 settings = JSON.parse(stdout);
return resolve(settings);
});
});
}