diff --git a/binding/nodejs/src/eagle.ts b/binding/nodejs/src/eagle.ts index fcfdbf4d..09bc4abe 100644 --- a/binding/nodejs/src/eagle.ts +++ b/binding/nodejs/src/eagle.ts @@ -162,7 +162,7 @@ export class EagleProfiler { * 16-bit linearly-encoded. EagleProfiler operates on single-channel audio. * @return {EnrollProgress} The percentage of completeness of the speaker enrollment process along with the feedback code * corresponding to the last enrollment attempt: - * - `AUDIO_OK`: The audio is good for enrollment. + * - `NONE`: The audio is good for enrollment. * - `AUDIO_TOO_SHORT`: Audio length is insufficient for enrollment, * i.e. it is shorter than`.min_enroll_samples`. * - `UNKNOWN_SPEAKER`: There is another speaker in the audio that is different from the speaker diff --git a/demo/nodejs/file.js b/demo/nodejs/file.js old mode 100644 new mode 100755 index d8912da0..c3925d8d --- a/demo/nodejs/file.js +++ b/demo/nodejs/file.js @@ -130,6 +130,8 @@ async function fileDemo() { console.error( "Audio file did not meet requirements. Wave file must be 16KHz, 16-bit, linear PCM (mono)." ); + eagleProfiler?.release(); + process.exit(); } let audioData = []; @@ -157,7 +159,7 @@ async function fileDemo() { if (enrollPercentage < 100) { console.error(`Failed to create speaker profile. Insufficient enrollment percentage: ${enrollPercentage.toFixed(2)}%. Please add more audio files for enrollment.`); - eagle.release(); + eagleProfiler?.release(); process.exit(); } else if (enrollPercentage === 100) { const speakerProfile = eagleProfiler.export(); @@ -213,13 +215,16 @@ async function fileDemo() { } catch (error) { console.error(`Exception trying to read file as wave format: ${testAudioPath}`); console.error(error); - return; + eagle?.release(); + process.exit(); } if (!checkWaveFile(inputWaveFile, eagle.sampleRate)) { console.error( "Audio file did not meet requirements. Wave file must be 16KHz, 16-bit, linear PCM (mono)." ); + eagle?.release(); + process.exit(); } let frames = getInt16Frames(inputWaveFile, eagle.frameLength); diff --git a/demo/nodejs/mic.js b/demo/nodejs/mic.js old mode 100644 new mode 100755 index 49b557a7..0fb27e51 --- a/demo/nodejs/mic.js +++ b/demo/nodejs/mic.js @@ -219,7 +219,7 @@ async function micDemo() { printResults(scores, speakerLabels); } - process.stdout.write("\nStopping..."); + process.stdout.write("\nStopping...\n"); } catch (e) { if (e instanceof EagleErrors.EagleActivationLimitReachedError) { console.error(`AccessKey '${accessKey}' has reached it's processing limit.`);