Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Commit 606a619

Browse files
salvoravidaAlexey Reznichenko
authored andcommitted
Stop using AMD module system
Remove "module: 'AMD'" together with "out: 'speech.browser.sdk.js'" from the gulp file. Squashed commits: * add gulp build only ES6 modules * update package.json for npm module support * update distrib es6 build * update gitignore * fix string template on Mic not allowed error * ES5 - IE fix
1 parent a9b1989 commit 606a619

File tree

8 files changed

+7
-5099
lines changed

8 files changed

+7
-5099
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
/**/node_modules/
33
# ignore auto-generated (transpiled) js files
44
src/**/*.js
5+
distrib/*
56

67
/**/speech.key
7-
/samples/**/package-lock.json
8+
/samples/**/package-lock.json
9+
.idea/

distrib/speech.browser.sdk-min.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

distrib/speech.browser.sdk.d.ts

Lines changed: 0 additions & 1100 deletions
This file was deleted.

distrib/speech.browser.sdk.js

Lines changed: 0 additions & 3989 deletions
This file was deleted.

distrib/speech.browser.sdk.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

gulpfile.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ gulp.task("build", function() {
2626
target: "ES5",
2727
declaration: true,
2828
noImplicitAny: true,
29-
removeComments: true,
30-
module: "AMD",
31-
out: 'speech.browser.sdk.js'
29+
removeComments: true
3230
}))
3331
.pipe(sourcemaps.write("."))
3432
.pipe(minify())

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.0.8",
44
"description": "Microsoft Speech SDK for browsers",
55
"main": "distrib/speech.browser.sdk-min.js",
6+
"module": "distrib/Speech.Browser.Sdk.js",
67
"types": "distrib/speech.browser.sdk.d.ts",
78
"keywords": [
89
"microsoft",

src/common.browser/MicAudioSource.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export class MicAudioSource implements IAudioSource {
9393
this.OnEvent(new AudioSourceReadyEvent(this.id));
9494
this.initializeDeferral.Resolve(true);
9595
}, (error: MediaStreamError) => {
96-
const errorMsg = "Error occurred during microphone initialization: ${error}";
96+
const errorMsg = `Error occurred during microphone initialization: ${error}`;
9797
const tmp = this.initializeDeferral;
9898
// HACK: this should be handled through onError callbacks of all promises up the stack.
9999
// Unfortunately, the current implementation does not provide an easy way to reject promises
@@ -111,7 +111,7 @@ export class MicAudioSource implements IAudioSource {
111111
// NOTE: On iOS, the Web Audio API requires sounds to be triggered from an explicit user action.
112112
// https://github.com/WebAudio/web-audio-api/issues/790
113113
this.context.resume().then(next, (reason: any) => {
114-
this.initializeDeferral.Reject("Failed to initialize audio context: ${error}");
114+
this.initializeDeferral.Reject(`Failed to initialize audio context: ${reason}`);
115115
});
116116
} else {
117117
next();

0 commit comments

Comments
 (0)