augnitorecorder
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -33,2 +33,3 @@ export declare class AugnitoRecorder { | ||
stopAudio(): void; | ||
getBlob(): Blob; | ||
log(event: any): void; | ||
@@ -35,0 +36,0 @@ onSessionEventCallback(data: any): void; |
@@ -109,3 +109,3 @@ function _regeneratorRuntime() { | ||
return function (i, a) { | ||
if (o === f) throw new Error("Generator is already running"); | ||
if (o === f) throw Error("Generator is already running"); | ||
if (o === s) { | ||
@@ -252,3 +252,3 @@ if ("throw" === i) throw a; | ||
} else { | ||
if (!u) throw new Error("try statement without catch or finally"); | ||
if (!u) throw Error("try statement without catch or finally"); | ||
if (this.prev < i.finallyLoc) return handle(i.finallyLoc); | ||
@@ -293,3 +293,3 @@ } | ||
} | ||
throw new Error("illegal catch attempt"); | ||
throw Error("illegal catch attempt"); | ||
}, | ||
@@ -317,3 +317,3 @@ delegateYield: function (e, r, n) { | ||
var i = _toPrimitive(t, "string"); | ||
return "symbol" == typeof i ? i : String(i); | ||
return "symbol" == typeof i ? i : i + ""; | ||
} | ||
@@ -408,3 +408,3 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { | ||
// main-thread | ||
_createClass(Executor, [{ | ||
return _createClass(Executor, [{ | ||
key: "Start", | ||
@@ -425,4 +425,4 @@ value: function Start() { | ||
self.onmessage = function (event) { | ||
if (event.data === "DONE") { | ||
add("EOS"); | ||
if (event.data === DONE_MSG) { | ||
add(EOS_MSG); | ||
if (enableLogs) { | ||
@@ -491,3 +491,3 @@ console.log("Worker received DONE, time to terminate..."); | ||
} else { | ||
if (data === "EOS") { | ||
if (data === EOS_MSG) { | ||
if (enableLogs) { | ||
@@ -550,3 +550,3 @@ console.warn("Gulping ".concat(EOS_MSG, " as socket seems already closed...")); | ||
var currentTime = +new Date(); | ||
if (lastDataSent > lastDataReceived && currentTime - lastDataReceived > 10000) { | ||
if (lastDataSent > lastDataReceived && currentTime - lastDataReceived > SOCKET_TIMEOUT) { | ||
if (enableLogs) { | ||
@@ -621,3 +621,2 @@ console.error("No data received since more than ".concat(SOCKET_TIMEOUT / 1000, " secs, closing time...")); | ||
}]); | ||
return Executor; | ||
}(); | ||
@@ -646,3 +645,3 @@ | ||
} | ||
_createClass(Streamer, [{ | ||
return _createClass(Streamer, [{ | ||
key: "StartStream", | ||
@@ -966,2 +965,16 @@ value: function () { | ||
/** | ||
* Returns a Blob object containing the audio data in WAV format. | ||
* @returns {Blob} - Blob object containing the audio data in WAV format. | ||
*/ | ||
}, { | ||
key: "getBlob", | ||
value: function getBlob() { | ||
var wavView = this.encodeWAV(); | ||
var audioBlob = new Blob([wavView], { | ||
type: "audio/wav" | ||
}); | ||
return audioBlob; | ||
} | ||
// 16-bit PCM mono audio @ 16kHz | ||
@@ -1010,3 +1023,2 @@ }, { | ||
}]); | ||
return Streamer; | ||
}(); | ||
@@ -1035,3 +1047,3 @@ | ||
} | ||
_createClass(AugnitoRecorder, [{ | ||
return _createClass(AugnitoRecorder, [{ | ||
key: "togglePauseResumeAudioStream", | ||
@@ -1085,2 +1097,9 @@ value: function togglePauseResumeAudioStream() { | ||
}, { | ||
key: "getBlob", | ||
value: function getBlob() { | ||
var audioBlob = this.streamer.getBlob(); | ||
this.log("Blob Sent..."); | ||
return audioBlob; | ||
} | ||
}, { | ||
key: "log", | ||
@@ -1139,3 +1158,2 @@ value: function log(event) { | ||
}]); | ||
return AugnitoRecorder; | ||
}(); | ||
@@ -1142,0 +1160,0 @@ |
{ | ||
"name": "augnitorecorder", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Audio recorder and streamer compatible with any browser", | ||
@@ -34,3 +34,4 @@ "main": "dist/augnitoRecorder.js", | ||
"rollup-plugin-node-resolve": "^5.2.0", | ||
"tslib": "^2.6.2" | ||
"tslib": "^2.6.2", | ||
"typescript": "5.4.3" | ||
}, | ||
@@ -37,0 +38,0 @@ "files": [ |
@@ -157,2 +157,11 @@ # Async JS Client for Voice Backend | ||
## Compile library | ||
Below steps to compile library and the output is generated in dist folder | ||
```sh | ||
cd AugnitoRecorderJS | ||
npm run build | ||
``` | ||
## Running an Example | ||
@@ -159,0 +168,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
110302
1181
178
8