diff --git a/lib/tts-providers/mac-os.js b/lib/tts-providers/mac-os.js index 53e82686..17e889ff 100644 --- a/lib/tts-providers/mac-os.js +++ b/lib/tts-providers/mac-os.js @@ -13,9 +13,9 @@ function macSay(phrase, voice) { return Promise.resolve(); } - var selcetedRate = settings.macSay.rate; - if( !selcetedRate ) { - selcetedRate = "default"; + var selectedRate = settings.macSay.rate; + if( !selectedRate ) { + selectedRate = "default"; } var selectedVoice = settings.macSay.voice; if( voice ) { @@ -24,7 +24,7 @@ function macSay(phrase, voice) { // Construct a filesystem neutral filename const phraseHash = crypto.createHash('sha1').update(phrase).digest('hex'); - const filename = `macSay-${phraseHash}-${selcetedRate}-${selectedVoice}.m4a`; + const filename = `macSay-${phraseHash}-${selectedRate}-${selectedVoice}.m4a`; const filepath = path.resolve(settings.webroot, 'tts', filename); const expectedUri = `/tts/${filename}`; @@ -52,13 +52,13 @@ function macSay(phrase, voice) { // System Preferences -> Accessibility -> Speech -> System Voice // - var execCommand = `say "${phrase}" -o ${filepath}`; - if( selectedVoice && selcetedRate != "default" ) { - execCommand = `say -r ${selcetedRate} -v ${selectedVoice} "${phrase}" -o ${filepath}`; + var execCommand = `say "${phrase}" -o ${filepath} --data-format=aac`; + if( selectedVoice && selectedRate != "default" ) { + execCommand = `say -r ${selectedRate} -v ${selectedVoice} "${phrase}" -o ${filepath} --data-format=aac`; } else if ( selectedVoice ) { - execCommand = `say -v ${selectedVoice} "${phrase}" -o ${filepath}`; - } else if ( selcetedRate != "default" ) { - execCommand = `say -r ${selcetedRate} "${phrase}" -o ${filepath}`; + execCommand = `say -v ${selectedVoice} "${phrase}" -o ${filepath} --data-format=aac`; + } else if ( selectedRate != "default" ) { + execCommand = `say -r ${selectedRate} "${phrase}" -o ${filepath} --data-format=aac`; } exec(execCommand,