@4players/odin-plugin-web 1.6.6 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { Backend, LogRecord, Logger } from '@4players/odin-common';
1
+ import { Backend, LoggerLike, OnLogMessage } from '@4players/odin-common';
2
2
 
3
- export type OnLogMessage = (formattedString: string, record: LogRecord) => void;
4
3
  export type AudioContextFactory = (sampleRate: number | undefined) => Promise<AudioContext>;
4
+ export type Logger = LoggerLike;
5
5
  export type DeviceInfo = {
6
6
  name: string;
7
7
  deviceId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@4players/odin-plugin-web",
3
- "version": "1.6.6",
3
+ "version": "1.7.1",
4
4
  "description": "A backend plugin providing the custom WebAssembly audio processing module for ODIN web clients",
5
5
  "homepage": "https://www.4players.io",
6
6
  "repository": {
@@ -38,14 +38,14 @@
38
38
  "lint": "eslint . --ext .ts"
39
39
  },
40
40
  "dependencies": {
41
- "@4players/odin-common": "~9.1.0",
41
+ "@4players/odin-common": "~9.5.0",
42
42
  "@4players/voice-filter": "~1.2.0",
43
43
  "@msgpack/msgpack": "3.1.2"
44
44
  },
45
45
  "devDependencies": {
46
- "@types/node": "~22.19.0",
47
- "@typescript-eslint/eslint-plugin": "~8.53.0",
48
- "@typescript-eslint/parser": "~8.53.0",
46
+ "@types/node": "~24.11.0",
47
+ "@typescript-eslint/eslint-plugin": "~8.56.0",
48
+ "@typescript-eslint/parser": "~8.56.0",
49
49
  "dts-bundle-generator": "~9.5.0",
50
50
  "esbuild": "~0.27.0",
51
51
  "eslint": "~8.57.0",
@@ -1,31 +0,0 @@
1
- include(FetchContent)
2
-
3
- ### Opus audio codec
4
-
5
- message(STATUS "Installing Opus audio codec")
6
-
7
- set(OPUS_BUILD_SHARED_LIBRARY CACHE BOOL OFF FORCE)
8
- set(OPUS_BUILD_PROGRAMS CACHE BOOL ON FORCE)
9
- set(OPUS_BUILD_TESTING CACHE BOOL OFF FORCE)
10
- set(BUILD_TESTING CACHE BOOL OFF FORCE)
11
- set(STACK_PROTECTOR_SUPPORTED CACHE BOOL OFF FORCE)
12
- set(FORTIFY_SOURCE_SUPPORTED CACHE BOOL OFF FORCE)
13
-
14
- FetchContent_Declare(
15
- opus
16
- GIT_REPOSITORY https://gitlab.4players.de/odin/deps/opus.git
17
- GIT_TAG v1.6.1
18
- )
19
- FetchContent_MakeAvailable(opus)
20
- target_link_libraries(${CMAKE_EXECUTABLE_NAME} PUBLIC opus)
21
-
22
- ### RNN VAD
23
-
24
- message(STATUS "Installing RNN VAD")
25
-
26
- FetchContent_Declare(
27
- rnn_vad
28
- GIT_REPOSITORY https://gitlab.4players.de/odin/deps/rnn-vad.git
29
- )
30
- FetchContent_MakeAvailable(rnn_vad)
31
- target_link_libraries(${CMAKE_EXECUTABLE_NAME} PUBLIC rnn_vad)
@@ -1,54 +0,0 @@
1
- ### Set global compiler flags
2
-
3
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
4
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
5
-
6
- ### Set compiler flags for the release configuration
7
-
8
- set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
9
- set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3")
10
- set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -O3")
11
-
12
- ### Set compiler flags for the debug configuration
13
-
14
- set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g")
15
- set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g")
16
- set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -g")
17
-
18
- ### Conditional logic to include pthread when SharedArrayBuffer is enabled
19
-
20
- if(NOT DEFINED SHARED_MEMORY)
21
- message(STATUS "Enabling SharedArrayBuffer")
22
-
23
- set(EXPORT_NAME "OdinWasmUnsharedMemory")
24
- set(SHARED_MEMORY 0)
25
- else()
26
- message(STATUS "Disabling SharedArrayBuffer")
27
-
28
- set(EXPORT_NAME "OdinWasmSharedMemory")
29
- set(SHARED_MEMORY 1)
30
-
31
- set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -pthread")
32
- set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -pthread")
33
- set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -pthread")
34
- set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -pthread")
35
- endif()
36
-
37
- ### Set flags for WebAssembly target output
38
-
39
- set_target_properties(${CMAKE_EXECUTABLE_NAME} PROPERTIES
40
- CXX_STANDARD 20
41
- LINK_FLAGS "--bind \
42
- -s SHARED_MEMORY=${SHARED_MEMORY} \
43
- -s EXPORT_NAME=Load${EXPORT_NAME} \
44
- -s MODULARIZE=1 \
45
- -s WASM=1 \
46
- -s SINGLE_FILE=1 \
47
- -s ALLOW_TABLE_GROWTH=1 \
48
- -s BINARYEN_ASYNC_COMPILATION=1 \
49
- -s WASM_ASYNC_COMPILATION=1 \
50
- -s FILESYSTEM=0 \
51
- -s ENVIRONMENT=web,worker \
52
- -s EXPORTED_FUNCTIONS=_malloc,_free \
53
- -s EXPORTED_RUNTIME_METHODS=HEAPU8,HEAPF32,HEAPU32,HEAP32"
54
- )
package/esbuild.config.ts DELETED
@@ -1,49 +0,0 @@
1
- import * as esbuild from 'esbuild';
2
- import type { BuildOptions } from 'esbuild'; // Optional: for type safety
3
-
4
- const packageVersion = process.env.npm_package_version;
5
- const distPath = 'dist/plugin';
6
-
7
- if (!packageVersion) {
8
- console.error(
9
- 'Error: npm_package_version is not set. Please run this script using an npm script (e.g., npm run bundle).'
10
- );
11
- process.exit(1);
12
- }
13
-
14
- const sharedConfig: BuildOptions = {
15
- entryPoints: ['lib/esm/plugin/index.mjs'],
16
- bundle: true,
17
- minify: true,
18
- platform: 'browser',
19
- };
20
-
21
- async function main() {
22
- console.log(`Starting esbuild for version: ${packageVersion}`);
23
- try {
24
- // IIFE Build
25
- let path = `${distPath}/${packageVersion}/odin-plugin.js`;
26
- await esbuild.build({
27
- ...sharedConfig,
28
- format: 'iife',
29
- globalName: 'ODIN_PLUGIN',
30
- outfile: path,
31
- });
32
- console.log(`Successfully built: ${path}`);
33
- path = `${distPath}/${packageVersion}/odin-plugin.esm.js`;
34
- // ESM Build
35
- await esbuild.build({
36
- ...sharedConfig,
37
- format: 'esm',
38
- outfile: path,
39
- });
40
- console.log(`Successfully built: ${path}.js`);
41
- console.log('Build completed successfully.');
42
- } catch (error) {
43
- console.error('Build failed:');
44
- console.error(error);
45
- process.exit(1);
46
- }
47
- }
48
-
49
- main().catch(console.error);