@convis/audio-native 0.0.3 → 0.0.5

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/dist/index.js CHANGED
@@ -8,8 +8,11 @@ const loadErrors = [];
8
8
  function requireNative() {
9
9
  try {
10
10
  // the locally-build module overrides all others. (generated in dev mode)
11
- return require("./audio.node");
11
+ const module = require("./audio.node");
12
+ console.log("!! Running @convis/audio-native in dev mode.");
13
+ return module;
12
14
  } catch (e) {
15
+ console.error(e);
13
16
  loadErrors.push(e);
14
17
  }
15
18
  if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@convis/audio-native",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "Native Node (N-API) module for @convis/audio",
5
5
  "homepage": "https://github.com/k2d222/convis-audio",
6
6
  "bugs": "https://github.com/k2d222/convis-audio/issues",
@@ -12,7 +12,7 @@
12
12
  "./dist/index.js",
13
13
  "./src/*"
14
14
  ],
15
- "type": "module",
15
+ "type": "commonjs",
16
16
  "exports": {
17
17
  "types": "./dist/index.d.ts",
18
18
  "node": "./dist/index.js"
@@ -22,12 +22,12 @@
22
22
  "@types/node": "^25.6.2"
23
23
  },
24
24
  "optionalDependencies": {
25
- "@convis/audio-aarch64-apple-darwin": "0.0.3",
26
- "@convis/audio-x86_64-apple-darwin": "0.0.3",
27
- "@convis/audio-x86_64-pc-windows-msvc": "0.0.3",
28
- "@convis/audio-aarch64-unknown-linux-gnu": "0.0.3",
29
- "@convis/audio-aarch64-pc-windows-msvc": "0.0.3",
30
- "@convis/audio-x86_64-unknown-linux-gnu": "0.0.3"
25
+ "@convis/audio-aarch64-apple-darwin": "0.0.5",
26
+ "@convis/audio-aarch64-pc-windows-msvc": "0.0.5",
27
+ "@convis/audio-x86_64-pc-windows-msvc": "0.0.5",
28
+ "@convis/audio-x86_64-apple-darwin": "0.0.5",
29
+ "@convis/audio-x86_64-unknown-linux-gnu": "0.0.5",
30
+ "@convis/audio-aarch64-unknown-linux-gnu": "0.0.5"
31
31
  },
32
32
  "napi": {
33
33
  "npmClient": "pnpm",
package/src/lib.rs CHANGED
@@ -22,7 +22,7 @@ use sonora::AudioProcessing;
22
22
  const SAMPLE_RATE: u32 = 24_000;
23
23
  const NUM_CHANNELS: u16 = 1;
24
24
  const FRAME_SIZE: usize = (SAMPLE_RATE / 100) as usize; // 10 ms
25
- const RING_SIZE: usize = FRAME_SIZE * 1024;
25
+ const RING_SIZE: usize = FRAME_SIZE * 10000; // number of frames to store in the buffer. Corresponds to 100s of audio.
26
26
 
27
27
  #[napi]
28
28
  pub struct AudioHardware {