Skip to content

Commit

Permalink
delete platform.js
Browse files Browse the repository at this point in the history
  • Loading branch information
bugsounet committed Dec 23, 2023
1 parent e523b29 commit c2cbf22
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 85 deletions.
1 change: 0 additions & 1 deletion components/loadLibraries.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ function libraries(that) {
// { "library to load" : "store library name" }
{ "fs": "fs" },
{ "os": "os" },
{ "../components/platform": "platform" },
{ "../components/rules": "rules" },
{ "../components/porcupine": "Porcupine" },
{ "../components/snowboy": "Snowboy" }
Expand Down
22 changes: 2 additions & 20 deletions components/parseData.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ async function init(that) {
that.detector = false
that.running = false
that.lib = {}
that.PLATFORM_RECORDER = new Map()
that.PLATFORM_RECORDER.set("linux", "arecord")
that.PLATFORM_RECORDER.set("mac", "sox")
that.PLATFORM_RECORDER.set("raspberry-pi", "arecord")
that.PLATFORM_RECORDER.set("windows", "sox")
that.detectorModel = 0
}

Expand All @@ -37,21 +32,8 @@ async function parse(that) {
return
}

/** autodetect platform / recorder **/
/** Warn: Mac / windows not yet supported by detector **/
let platform
try {
platform = that.lib.platform.getPlatform(that)
} catch (error) {
console.error("[DETECTOR] [DATA] The NodeJS binding does not support that platform. Supported platforms include macOS (x86_64), Windows (x86_64), Linux (x86_64), and Raspberry Pi (1-4)");
process.exit(1)
return
}

let recorderType = that.PLATFORM_RECORDER.get(platform)
console.log(`[DETECTOR] [DATA] Platform: '${platform}'; attempting to use '${recorderType}' to access microphone ...`)
that.config.mic.recorder= recorderType
that.config.snowboyMicConfig.recorder= recorderType
that.config.mic.recorder= "arecord"
that.config.snowboyMicConfig.recorder= "arecord"

if (that.Porcupine.length) {
/* Porcupine init */
Expand Down
64 changes: 0 additions & 64 deletions components/platform.js

This file was deleted.

0 comments on commit c2cbf22

Please sign in to comment.