keolis-services
Version:
Keolis services includes Microphone, Location, Voice Activity Detector, Heart rate through web bluetooth API, text to speech, stop watch with our own cloud.
46 lines (42 loc) • 1.61 kB
JavaScript
const { init } = require('./services/login');
const { startHeartRate } = require('./services/heartRate');
const { getLocation } = require('./services/location');
const { startRecording, stopRecording, TextToSpeach, startContinuousArtyom } = require('./services/record');
const { startVoiceDetect } = require('./services/voiceDectector');
const { spotify_authorize } = require('./services/spotify');
const { stopwatch_start, stopwatch_stop, stopwatch_reset } = require('./services/stopWatch');
navigator.permissions.query({ name: 'geolocation' }).then(function(permissionStatus) {
if (permissionStatus.state == "granted") { // granted, denied, prompt
console.log("Geolocation access granted.")
} else {
console.error("Geolocation access denied.")
}
})
navigator.mediaDevices.getUserMedia({ audio: true }).then(function(permissionStatus) {
if (permissionStatus.active) {
console.log("Audio access granted");
} else {
console.log("Audio access denied");
}
});
navigator.permissions.query({ name: 'microphone' }).then(function(permissionStatus) {
if (permissionStatus.state == "granted") { // granted, denied, prompt
console.log("Microphone access granted.");
startContinuousArtyom();
} else {
console.error("Microphone access denied.")
}
});
module.exports = {
init,
startHeartRate,
spotify_authorize,
getLocation,
startRecording,
stopRecording,
startVoiceDetect,
stopwatch_start,
stopwatch_stop,
stopwatch_reset,
TextToSpeach,
};