@libraz/libsonare 1.5.2 → 1.5.3

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.
Files changed (46) hide show
  1. package/README.md +18 -3
  2. package/dist/index.d.ts +1147 -181
  3. package/dist/index.js +4826 -3941
  4. package/dist/index.js.map +1 -1
  5. package/dist/sonare.js +1 -1
  6. package/dist/sonare.wasm +0 -0
  7. package/dist/worklet.d.ts +29 -1
  8. package/dist/worklet.js +1067 -973
  9. package/dist/worklet.js.map +1 -1
  10. package/package.json +2 -1
  11. package/src/_chain_config.ts +46 -0
  12. package/src/audio.ts +24 -4
  13. package/src/effects_mastering.ts +25 -1
  14. package/src/effects_transform.ts +283 -43
  15. package/src/effects_voice_change.ts +46 -53
  16. package/src/feature_core.ts +316 -12
  17. package/src/feature_music.ts +357 -0
  18. package/src/feature_pitch.ts +61 -0
  19. package/src/feature_resample.ts +17 -2
  20. package/src/feature_spectral.ts +349 -2
  21. package/src/feature_spectrogram.ts +336 -0
  22. package/src/index.ts +130 -1
  23. package/src/mastering_chain.ts +305 -50
  24. package/src/mastering_core.ts +232 -16
  25. package/src/mastering_dynamics.ts +66 -10
  26. package/src/mastering_repair.ts +119 -7
  27. package/src/metering.ts +366 -81
  28. package/src/mixer.ts +9 -2
  29. package/src/mixing_oneshot.ts +25 -5
  30. package/src/module_state.ts +1 -1
  31. package/src/project_class.ts +17 -6
  32. package/src/project_internal.ts +10 -2
  33. package/src/project_types.ts +25 -2
  34. package/src/public_types_mastering.ts +114 -4
  35. package/src/public_types_spectral.ts +7 -0
  36. package/src/quick_analysis.ts +325 -117
  37. package/src/realtime_engine.ts +8 -0
  38. package/src/sonare.js.d.ts +31 -0
  39. package/src/stream_analyzer.ts +20 -1
  40. package/src/stream_types.ts +12 -1
  41. package/src/validation.ts +17 -2
  42. package/src/worklet/engine-clips.ts +67 -2
  43. package/src/worklet/engine-processor.ts +33 -5
  44. package/src/worklet/engine.ts +7 -3
  45. package/src/worklet/guards.ts +3 -0
  46. package/src/worklet/messages.ts +27 -0
package/README.md CHANGED
@@ -62,6 +62,18 @@ console.log(`Key: ${audio.detectKey().name}`);
62
62
  const audioKeyWithOptions = audio.detectKey({ useHpss: true, highPassHz: 80 });
63
63
  ```
64
64
 
65
+ ### Request-object calls
66
+
67
+ For top-level one-shot analysis, effects, mastering, metering, and feature APIs, pass one request object. This is the documented form because each input has a name and optional settings can grow without changing argument order. Existing positional calls remain supported for compatibility and produce the same results; stateful `Audio` methods and small scalar conversions retain their natural positional forms.
68
+
69
+ ```typescript
70
+ // Recommended
71
+ detectBpm({ samples, sampleRate: 48_000 });
72
+
73
+ // Still supported for existing applications
74
+ detectBpm(samples, 48_000);
75
+ ```
76
+
65
77
  ### Pitch, timbre, and spectral APIs
66
78
 
67
79
  Pitch tracking keeps unvoiced `f0` frames as `NaN` by default. Pass
@@ -311,9 +323,12 @@ await init();
311
323
 
312
324
  masteringPresetNames(); // ['pop', 'edm', 'acoustic', 'hipHop', 'aiMusic', 'speech', 'streaming', 'youtube', 'broadcast', 'podcast', 'audiobook', 'cinema', 'jpop', 'ambient', 'lofi', 'classical', 'drumAndBass', 'techno', 'metal', 'trap', 'rnb', 'jazz', 'kpop', 'trance', 'gameOst']
313
325
 
314
- const result = masterAudio(samples, sampleRate, 'aiMusic', {
315
- // optional flat overrides applied on top of the preset (dot notation)
316
- 'loudness.targetLufs': -13,
326
+ const result = masterAudio({
327
+ samples,
328
+ sampleRate,
329
+ preset: 'aiMusic',
330
+ // optional overrides applied on top of the preset
331
+ overrides: { loudness: { targetLufs: -13 } },
317
332
  });
318
333
  console.log(result.outputLufs, result.appliedGainDb);
319
334
  ```