@sudobility/music_types 0.9.0 → 0.10.0

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.
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Platform-bound audio decoding and encoding.
3
+ *
4
+ * Web uses Web Audio, which already understands wav and mp3 (and therefore
5
+ * `.mpa`, which is the same MPEG audio) — React Native will need something
6
+ * else entirely, which is why this is an interface rather than a function.
7
+ *
8
+ * The *analysis* is deliberately not here: pitch tracking, segmentation and
9
+ * tempo detection are pure functions over samples and live in music_lib, where
10
+ * they can be tested with a synthesised tone and no browser.
11
+ */
12
+ export type DecodedAudio = {
13
+ samples: Float32Array;
14
+ sampleRate: number;
15
+ };
16
+ export interface AudioCodec {
17
+ /**
18
+ * Decode `.wav`/`.mp3`/`.mpa` to **mono** PCM.
19
+ *
20
+ * Channels are mixed down rather than preserved: the analysis is monophonic,
21
+ * so stereo would double the work for nothing.
22
+ */
23
+ decode(bytes: ArrayBuffer): Promise<DecodedAudio>;
24
+ encodeWav(audio: DecodedAudio): ArrayBuffer;
25
+ encodeMp3(audio: DecodedAudio): ArrayBuffer;
26
+ }
27
+ //# sourceMappingURL=audio.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audio.d.ts","sourceRoot":"","sources":["../../src/platform/audio.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,MAAM,YAAY,GAAG;IAAE,OAAO,EAAE,YAAY,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzE,MAAM,WAAW,UAAU;IACzB;;;;;OAKG;IACH,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAClD,SAAS,CAAC,KAAK,EAAE,YAAY,GAAG,WAAW,CAAC;IAC5C,SAAS,CAAC,KAAK,EAAE,YAAY,GAAG,WAAW,CAAC;CAC7C"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Platform-bound audio decoding and encoding.
3
+ *
4
+ * Web uses Web Audio, which already understands wav and mp3 (and therefore
5
+ * `.mpa`, which is the same MPEG audio) — React Native will need something
6
+ * else entirely, which is why this is an interface rather than a function.
7
+ *
8
+ * The *analysis* is deliberately not here: pitch tracking, segmentation and
9
+ * tempo detection are pure functions over samples and live in music_lib, where
10
+ * they can be tested with a synthesised tone and no browser.
11
+ */
12
+ export {};
13
+ //# sourceMappingURL=audio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audio.js","sourceRoot":"","sources":["../../src/platform/audio.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG"}
@@ -1,3 +1,4 @@
1
+ export * from './audio.js';
1
2
  /**
2
3
  * Platform interfaces. Type-only contracts whose implementations live in
3
4
  * `@sudobility/music_io`, which serves web and React Native from one import
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/platform/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/platform/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B;;;;GAIG;AACH,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}
@@ -1,3 +1,4 @@
1
+ export * from './audio.js';
1
2
  /**
2
3
  * Platform interfaces. Type-only contracts whose implementations live in
3
4
  * `@sudobility/music_io`, which serves web and React Native from one import
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/platform/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/platform/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B;;;;GAIG;AACH,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sudobility/music_types",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "TypeScript types and Zod schemas for the ScoreSmith music API - scores, generation contracts, project payloads",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",