Skip to content

Commit

Permalink
Merge bd17829 into 7c75cfe
Browse files Browse the repository at this point in the history
  • Loading branch information
ad31c0 committed May 24, 2021
2 parents 7c75cfe + bd17829 commit 9218be5
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 62 deletions.
4 changes: 3 additions & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,6 @@ module.exports.ENABLE_DB_ENCRYPTION = false;
module.exports.SEMPRE_URL = process.env.THINGENGINE_NLP_URL || 'https://nlp-staging.almond.stanford.edu';
module.exports.THINGPEDIA_URL = process.env.THINGPEDIA_URL || 'https://dev.almond.stanford.edu/thingpedia';
module.exports.CLOUD_SYNC_URL = process.env.THINGENGINE_CLOUD_SYNC_URL || 'https://dev.almond.stanford.edu';
module.exports.NL_URL = process.env.THINGENGINE_NL_URL || 'https://nlp-staging.almond.stanford.edu';
module.exports.MS_SPEECH_RECOGNITION_PRIMARY_KEY = 'de1f02817356494483ba502b2ce95f6f';
module.exports.MS_SPEECH_RECOGNITION_SECONDARY_KEY = '3dc6ce0b832940f0b0c984a1517c457e';

2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ async function init(platform) {

if (platform.hasCapability('sound')) {
const speech = new Genie.SpeechHandler(conversation, platform, {
nlUrl: Config.NL_URL
subscriptionKey: Config.MS_SPEECH_RECOGNITION_PRIMARY_KEY
});

let play;
Expand Down
18 changes: 0 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@
"optionalDependencies": {
"canberra": "^0.1.2",
"pulseaudio2": "^0.5.0",
"snowboy": "^1.3.1",
"webrtcvad": "^1.0.1"
"snowboy": "^1.3.1"
},
"devDependencies": {
"coveralls": "^3.1.0",
Expand Down
40 changes: 0 additions & 40 deletions service/platform/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,38 +243,6 @@ class SoundEffectsApi {
}
}

let webrtcvad;
try {
webrtcvad = require('webrtcvad').default;
} catch(e) {
console.log("VAD not available");
webrtcvad = null;
}

class VAD {
constructor() {
this._instance = null;
}

setup(bitrate, level) {
if (this._instance)
this._instance = null;

if (webrtcvad) {
this._instance = new webrtcvad(bitrate, level);
// console.log("setup VAD bitrate", bitrate, "level", level);
return true;
}

return false;
}

process(chunk) {
if (!this._instance)
return false;
return this._instance.process(chunk);
}
}

class ServerPlatform extends Tp.BasePlatform {
constructor() {
Expand All @@ -292,7 +260,6 @@ class ServerPlatform extends Tp.BasePlatform {
safeMkdirSync(this._cacheDir);

this._wakeWordDetector = null;
this._voiceDetector = null;
this._soundEffects = null;

this._sqliteKey = null;
Expand Down Expand Up @@ -350,9 +317,6 @@ class ServerPlatform extends Tp.BasePlatform {

if (canberra)
this._soundEffects = new SoundEffectsApi();

if (webrtcvad && VAD)
this._voiceDetector = new VAD();
} else {
this._pulse = null;
}
Expand Down Expand Up @@ -409,8 +373,6 @@ class ServerPlatform extends Tp.BasePlatform {
case 'wakeword-detector':
this._ensurePulseAudio();
return this._wakeWordDetector !== null;
case 'voice-detector':
return this._voiceDetector !== null;

case 'sound-effects':
this._ensurePulseAudio();
Expand Down Expand Up @@ -438,8 +400,6 @@ class ServerPlatform extends Tp.BasePlatform {
case 'wakeword-detector':
this._ensurePulseAudio();
return this._wakeWordDetector;
case 'voice-detector':
return this._voiceDetector;
case 'sound-effects':
this._ensurePulseAudio();
return this._soundEffects;
Expand Down

0 comments on commit 9218be5

Please sign in to comment.