Skip to content

Commit

Permalink
Fix support for neural-only voices (#160)
Browse files Browse the repository at this point in the history
* Fix semantic version comparison logic

* Fix support for neural-only voices
  • Loading branch information
Krxtopher authored Mar 1, 2023
1 parent 9812a62 commit 688a15b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
20 changes: 18 additions & 2 deletions package-lock.json

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

3 changes: 3 additions & 0 deletions packages/amazon-sumerian-hosts-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@
"scripts": {
"lint": "eslint .",
"docs": "jsdoc -c jsdoc.conf.json"
},
"dependencies": {
"compare-versions": "^6.0.0-rc.1"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: MIT-0
import {compareVersions} from 'compare-versions';
import AbstractHostFeature from '../AbstractHostFeature';
import AnimationUtils from '../animpack/AnimationUtils';
import MathUtils from '../MathUtils';
Expand Down Expand Up @@ -278,7 +279,7 @@ class AbstractTextToSpeechFeature extends AbstractHostFeature {
response.Voices.forEach(voice => {
if (
voice.SupportedEngines.includes('standard') ||
version >= minNeuralSdk
compareVersions(version, minNeuralSdk) >= 0
) {
availableVoices.push(voice);
}
Expand Down Expand Up @@ -370,7 +371,10 @@ class AbstractTextToSpeechFeature extends AbstractHostFeature {
// Default to the standard engine if neural is not available for this version
if (
engine === undefined ||
this.constructor.AWS_VERSION < this.constructor.POLLY_MIN_NEURAL_VERSION
compareVersions(
this.constructor.AWS_VERSION,
this.constructor.POLLY_MIN_NEURAL_VERSION
) < 0
) {
engine = this.constructor.POLLY_DEFAULTS.Engine;
}
Expand Down

0 comments on commit 688a15b

Please sign in to comment.