Skip to content

Commit

Permalink
0.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
arseneyr committed Nov 6, 2020
1 parent 10b0013 commit af46a16
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.6.1] - 2020-11-05

### Changed

- Browsers will now use `WebAssembly.instantiateStreaming()` for data URIs as well (if available).

### Removed

- `fetch()`ing from non-data URL in Node

### Fixed

- Issue in browser where creating encoder would throw `Cannot destructure property 'memory' of '(B.instance || B).exports' as it is undefined.`

## [0.6.0] - 2020-11-04

### Added
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ This package aims to fill the gap by compiling the reference LAME and Ogg Vorbis

| Encoder | JS | WASM | Combined + Gzipped |
| ---------- | ------- | ------- | ------------------ |
| MP3 | 3.5 KiB | 130 KiB | **66 KiB** |
| Ogg Vorbis | 3.5 KiB | 440 KiB | **158 KiB** |
| MP3 | 3.3 KiB | 130 KiB | **66 KiB** |
| Ogg Vorbis | 3.3 KiB | 440 KiB | **158 KiB** |

## Installation

Expand Down Expand Up @@ -174,11 +174,11 @@ createEncoder(
The first two named exports use inline base-64 encoded WASM binaries (or `fetch()` from unpkg.com in the case of UMD). Tree-shaking on webpack should prevent unused encoders from being included in the final bundle.
| Parameter | Type | Description |
| ----------------- | ----------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `mimeType` | `String` | The MIME type of the encoder to create. Supported values are `'audio/mpeg'` (MP3) or `'audio/ogg'` (Ogg Vorbis) |
| `wasm` | `String \| ArrayBuffer \| Uint8Array \| WebAssembly.Module` | A URL, [base64 data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs), buffer, or compiled `WebAssembly.Module` representing the WASM binary for the specific `mimeType`. The WASM binaries are included in the package under `wasm-media-encoders/wasm/(mp3\|ogg).wasm`. |
| `moduleCallback?` | `((module: WebAssembly.Module) => void) \| undefined` | Optionally, a callback that will be called with the compiled WebAssembly module. You can cache this module client-side and pass it as the `wasm` parameter to avoid fetching and compiling it every time. |
| Parameter | Type | Description |
| ---------------- | ----------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `mimeType` | `String` | The MIME type of the encoder to create. Supported values are `'audio/mpeg'` (MP3) or `'audio/ogg'` (Ogg Vorbis) |
| `wasm` | `String \| ArrayBuffer \| Uint8Array \| WebAssembly.Module` | A URL, [base64 data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs), buffer, or compiled `WebAssembly.Module` representing the WASM binary for the specific `mimeType`. The WASM binaries are included in the package under `wasm-media-encoders/wasm/(mp3\|ogg).wasm`. Non-data URLs are not supported in Node; use [`node-fetch`](https://github.com/node-fetch/node-fetch) if this is something you need. |
| `moduleCallback` | `((module: WebAssembly.Module) => void) \| undefined` | Optionally, a callback that will be called with the compiled WebAssembly module. You can cache this module client-side and pass it as the `wasm` parameter to avoid fetching and compiling it every time. |
## `WasmMediaEncoder`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wasm-media-encoders",
"version": "0.6.0",
"version": "0.6.1",
"main": "dist/index.js",
"module": "dist/es/index.js",
"browser": "dist/browser/index.js",
Expand Down

0 comments on commit af46a16

Please sign in to comment.