nuance
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -15,4 +15,4 @@ var fs = require("fs"); | ||
var dictationURL = "https://dictation.nuancemobility.net:443/NMDPAsrCmdServlet/dictation"; | ||
var ttsURL = "https://tts.nuancemobility.net/NMDPTTSCmdServlet/tts"; | ||
var dictationBaseURL = "https://dictation.nuancemobility.net:443/NMDPAsrCmdServlet/dictation"; | ||
var ttsBaseURL = "https://tts.nuancemobility.net/NMDPTTSCmdServlet/tts"; | ||
@@ -62,3 +62,3 @@ var fileContent; | ||
ttsURL += "?appId=" + appID + "&appKey=" + appKey + "&id=" + options.identifier; | ||
var ttsURL = ttsBaseURL + "?appId=" + appID + "&appKey=" + appKey + "&id=" + options.identifier; | ||
@@ -75,2 +75,15 @@ if(options.voice){ | ||
var file = fs.createWriteStream(options.output); | ||
file.on('finish',()=>{ | ||
if(typeof options.success === "function"){ | ||
options.success(); | ||
} | ||
}); | ||
file.on('error',(err)=>{ | ||
if(typeof options.error === "function"){ | ||
options.error(err); | ||
} | ||
}); | ||
https.get(ttsURL, function(response) { | ||
@@ -84,6 +97,2 @@ if(response.statusCode && response.statusCode != 200){ | ||
response.pipe(file); | ||
if(typeof options.success === "function"){ | ||
options.success(); | ||
} | ||
} | ||
@@ -129,3 +138,3 @@ }); | ||
dictationURL += "?appId=" + appID + "&appKey=" + appKey + "&id=" + options.identifier; | ||
dictationURL = dictationBaseURL + "?appId=" + appID + "&appKey=" + appKey + "&id=" + options.identifier; | ||
@@ -132,0 +141,0 @@ if(options.path){ |
{ | ||
"name": "nuance", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "A simple Nuance HTTP Client for NodeJS.", | ||
@@ -5,0 +5,0 @@ "main": "nuance.js", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
17321
295
1