Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@diffusionstudio/core",
"private": false,
"version": "1.0.0-rc.5",
"version": "1.0.0-rc.6",
"type": "module",
"description": "Build bleeding edge video processing applications",
"files": [
Expand Down
6 changes: 3 additions & 3 deletions src/encoders/opus/opus.encoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
* Public License, v. 2.0 that can be found in the LICENSE file.
*/

import createModule from './opus';
import { createOpusHead } from './opus.utils';
import { OPUS_WASM_PATH, SUPPORTED_RATES } from './opus.fixtures';
import { OPUS_WASM_PATH, OPUS_JS_PATH, SUPPORTED_RATES } from './opus.fixtures';
import { EncoderError } from '../../errors';

import type {
Expand Down Expand Up @@ -40,6 +39,7 @@ export class OpusEncoder {
* @param config The sample rate and channel count to use
*/
public async configure(config: OpusEncoderConfig): Promise<void> {
const opusModule = await import(/* @vite-ignore *//* webpackIgnore: true */OPUS_JS_PATH);
const { numberOfChannels, sampleRate } = this.config = config;

if (!SUPPORTED_RATES.includes(sampleRate)) {
Expand All @@ -50,7 +50,7 @@ export class OpusEncoder {
}

// create new wasm module
this.opus = await createModule({
this.opus = await opusModule.default({
locateFile(path: string, scriptDirectory: string) {
if (path.endsWith('.wasm')) {
return OPUS_WASM_PATH;
Expand Down
1 change: 1 addition & 0 deletions src/encoders/opus/opus.fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
*/
export const SUPPORTED_RATES = [8000, 12000, 16000, 24000, 48000];
export const OPUS_WASM_PATH = 'https://cdn.jsdelivr.net/npm/@diffusionstudio/libopus-wasm@1.0.0/dist/opus.wasm';
export const OPUS_JS_PATH = 'https://cdn.jsdelivr.net/npm/@diffusionstudio/libopus-wasm@1.0.0/dist/opus.js';
1 change: 0 additions & 1 deletion src/encoders/opus/opus.js

This file was deleted.