opus-decoder
Advanced tools
Comparing version 0.3.1 to 0.3.2
{ | ||
"name": "opus-decoder", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Web Assembly streaming Opus decoder", | ||
@@ -34,3 +34,6 @@ "main": "dist/opus-decoder.min.js", | ||
], | ||
"author": "Ethan Halsall", | ||
"author": { | ||
"name": "Ethan Halsall", | ||
"email": "ethanhalsall@pm.me" | ||
}, | ||
"license": "MIT", | ||
@@ -40,3 +43,3 @@ "bugs": { | ||
}, | ||
"homepage": "https://github.com/eshaz/wasm-audio-decoders/src/opus-decoder#readme", | ||
"homepage": "https://github.com/eshaz/wasm-audio-decoders/tree/master/src/opus-decoder", | ||
"dependencies": { | ||
@@ -43,0 +46,0 @@ "web-worker": "^1.1.0" |
@@ -11,6 +11,8 @@ # `opus-decoder` | ||
### [Checkout the demo here](https://eshaz.github.io/wasm-audio-decoders/) | ||
## Installing | ||
* Install from [NPM](https://www.npmjs.com/package/opus-decoder). | ||
Run `npm i mpg123-decoder` | ||
Run `npm i opus-decoder` | ||
@@ -27,3 +29,3 @@ ```javascript | ||
<script> | ||
const decoder = new OpusDecoder(); | ||
const decoder = new window["opus-decoder"].OpusDecoder(); | ||
</script> | ||
@@ -30,0 +32,0 @@ ``` |
@@ -6,2 +6,4 @@ import Worker from "web-worker"; | ||
let sourceURL; | ||
export default class OpusDecoderWebWorker extends Worker { | ||
@@ -67,15 +69,15 @@ constructor() { | ||
const type = "text/javascript"; | ||
let sourceURL; | ||
try { | ||
// browser | ||
sourceURL = URL.createObjectURL( | ||
new Blob([webworkerSourceCode], { type }) | ||
); | ||
} catch { | ||
// nodejs | ||
sourceURL = `data:${type};base64,${Buffer.from( | ||
webworkerSourceCode | ||
).toString("base64")}`; | ||
if (!sourceURL) { | ||
const type = "text/javascript"; | ||
try { | ||
// browser | ||
sourceURL = URL.createObjectURL( | ||
new Blob([webworkerSourceCode], { type }) | ||
); | ||
} catch { | ||
// nodejs | ||
sourceURL = `data:${type};base64,${Buffer.from( | ||
webworkerSourceCode | ||
).toString("base64")}`; | ||
} | ||
} | ||
@@ -82,0 +84,0 @@ |
Sorry, the diff of this file is too big to display
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
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
212912
1314
2
166