@moolam/bindings-speech 1.0.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.
Files changed (52) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +41 -0
  3. package/bin/speech-cert.mjs +11 -0
  4. package/certification/README.md +18 -0
  5. package/certification/device-profiles/mid-range-android.json +12 -0
  6. package/certification/profile.json +33 -0
  7. package/certification/prove-speech-cert.mjs +11 -0
  8. package/certification/reports/prove.green1.speech.cert.json +92 -0
  9. package/certification/reports/prove.seeded-red.speech.cert.json +70 -0
  10. package/certification/reports/speech.cert.json +92 -0
  11. package/certification/run-speech-cert.mjs +11 -0
  12. package/certification/schemas/speech.cert.report.schema.json +149 -0
  13. package/certification/voice-rtt.baseline.json +12 -0
  14. package/dist/edge_stt_harness.d.ts +86 -0
  15. package/dist/edge_stt_harness.d.ts.map +1 -0
  16. package/dist/edge_stt_harness.js +311 -0
  17. package/dist/edge_stt_harness.js.map +1 -0
  18. package/dist/index.d.ts +10 -0
  19. package/dist/index.d.ts.map +1 -0
  20. package/dist/index.js +10 -0
  21. package/dist/index.js.map +1 -0
  22. package/dist/speech_certification.d.ts +149 -0
  23. package/dist/speech_certification.d.ts.map +1 -0
  24. package/dist/speech_certification.js +490 -0
  25. package/dist/speech_certification.js.map +1 -0
  26. package/dist/stt_binding.d.ts +148 -0
  27. package/dist/stt_binding.d.ts.map +1 -0
  28. package/dist/stt_binding.js +400 -0
  29. package/dist/stt_binding.js.map +1 -0
  30. package/dist/tts_binding.d.ts +187 -0
  31. package/dist/tts_binding.d.ts.map +1 -0
  32. package/dist/tts_binding.js +565 -0
  33. package/dist/tts_binding.js.map +1 -0
  34. package/dist/voice_rtt_proof.d.ts +112 -0
  35. package/dist/voice_rtt_proof.d.ts.map +1 -0
  36. package/dist/voice_rtt_proof.js +241 -0
  37. package/dist/voice_rtt_proof.js.map +1 -0
  38. package/dist/whisper_ffi.d.ts +44 -0
  39. package/dist/whisper_ffi.d.ts.map +1 -0
  40. package/dist/whisper_ffi.js +104 -0
  41. package/dist/whisper_ffi.js.map +1 -0
  42. package/fixtures/indic/audio/en-classroom.pcm +0 -0
  43. package/fixtures/indic/audio/hi-classroom-noise.pcm +0 -0
  44. package/fixtures/indic/audio/hi-en-codeswitch.pcm +0 -0
  45. package/fixtures/indic/audio/hi-greeting.pcm +0 -0
  46. package/fixtures/indic/audio/short-hi.pcm +0 -0
  47. package/fixtures/indic/audio/ta-greeting.pcm +0 -0
  48. package/fixtures/indic/catalog.json +75 -0
  49. package/fixtures/indic/supported-languages.json +8 -0
  50. package/fixtures/tts/tts-voices.model-card.json +41 -0
  51. package/fixtures/tts/voices.json +24 -0
  52. package/package.json +55 -0
@@ -0,0 +1,41 @@
1
+ {
2
+ "schemaVersion": "bindings-speech.tts-model-card.v1",
3
+ "engine": "local-tts-v1",
4
+ "locality": "on-device",
5
+ "description": "Indic TTS voice coverage model card. Language → voice mapping is authoritative for SpeechInterface.supportedLanguages; aspirational languages are forbidden.",
6
+ "fallbackLanguage": "en-IN",
7
+ "fallbackPolicy": {
8
+ "unsupportedBcp47": "Route to fallbackLanguage; emit telemetry outcome=fallback and usedFallback=true. Never throw when fallback is declared. Never silently substitute English without that signal.",
9
+ "emptyText": "Typed LocalTtsError (validation) before synthesis starts.",
10
+ "mixedScript": "Devanagari+Latin (and other mixed-script) input synthesizes on the effective voice without crash; language selection still follows requested BCP-47 with declared fallback — it does not auto-switch mid-utterance."
11
+ },
12
+ "coverage": [
13
+ {
14
+ "language": "hi-IN",
15
+ "voiceId": "indic-hi-f1",
16
+ "sampleRateHz": 16000,
17
+ "script": "Devanagari",
18
+ "role": "primary-indic"
19
+ },
20
+ {
21
+ "language": "en-IN",
22
+ "voiceId": "indic-en-f1",
23
+ "sampleRateHz": 16000,
24
+ "script": "Latin",
25
+ "role": "fallback-english"
26
+ },
27
+ {
28
+ "language": "ta-IN",
29
+ "voiceId": "indic-ta-f1",
30
+ "sampleRateHz": 16000,
31
+ "script": "Tamil",
32
+ "role": "additional-indic"
33
+ }
34
+ ],
35
+ "observability": {
36
+ "event": "bindings_speech.tts",
37
+ "neverEmit": "raw synthesis text bodies",
38
+ "requiredFields": ["subjectId", "deviceId", "outcome"]
39
+ },
40
+ "voicesManifestRelpath": "fixtures/tts/voices.json"
41
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "schemaVersion": "bindings-speech.tts-voices.v1",
3
+ "engine": "local-tts-v1",
4
+ "description": "Voice models actually loaded for local TTS. supportedLanguages is derived only from this set — never aspirational. Fallback language is used when the requested BCP-47 tag is absent (CK-05.2); hosts observe outcome=fallback telemetry — no silent English substitution.",
5
+ "fallbackLanguage": "en-IN",
6
+ "voices": [
7
+ {
8
+ "voiceId": "indic-hi-f1",
9
+ "language": "hi-IN",
10
+ "sampleRateHz": 16000
11
+ },
12
+ {
13
+ "voiceId": "indic-en-f1",
14
+ "language": "en-IN",
15
+ "sampleRateHz": 16000
16
+ },
17
+ {
18
+ "voiceId": "indic-ta-f1",
19
+ "language": "ta-IN",
20
+ "sampleRateHz": 16000
21
+ }
22
+ ],
23
+ "mixedScriptPolicy": "Devanagari+Latin (and other mixed-script) input synthesizes on the effective voice without crash; language selection still follows requested BCP-47 with declared fallback — it does not auto-switch mid-utterance."
24
+ }
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@moolam/bindings-speech",
3
+ "version": "1.0.0",
4
+ "description": "Local Indic speech bindings (whisper.cpp-class STT + local TTS) behind SpeechInterface.",
5
+ "license": "Apache-2.0",
6
+ "homepage": "https://github.com/moolamai/sutra/tree/main/packages/bindings-speech#readme",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/moolamai/sutra.git",
10
+ "directory": "packages/bindings-speech"
11
+ },
12
+ "publishConfig": {
13
+ "access": "public"
14
+ },
15
+ "type": "module",
16
+ "main": "./dist/index.js",
17
+ "types": "./dist/index.d.ts",
18
+ "exports": {
19
+ ".": {
20
+ "types": "./dist/index.d.ts",
21
+ "import": "./dist/index.js"
22
+ }
23
+ },
24
+ "bin": {
25
+ "speech-cert": "./bin/speech-cert.mjs"
26
+ },
27
+ "files": [
28
+ "dist",
29
+ "fixtures",
30
+ "certification",
31
+ "bin"
32
+ ],
33
+ "dependencies": {
34
+ "@moolam/cognitive-core": "1.0.0",
35
+ "@moolam/contract-conformance": "1.0.0",
36
+ "@moolam/contracts": "1.0.0",
37
+ "@moolam/edge-agent": "1.0.0",
38
+ "@moolam/sync-protocol": "1.0.0"
39
+ },
40
+ "devDependencies": {
41
+ "@types/node": "^22.20.0",
42
+ "typescript": "^5.8.0"
43
+ },
44
+ "scripts": {
45
+ "build": "tsc -p tsconfig.json",
46
+ "typecheck": "tsc -p tsconfig.json --noEmit",
47
+ "test": "pnpm run build && node --test tests/stt_binding.test.mjs tests/indic_fixtures.test.mjs tests/fp002_classroom_noise.test.mjs tests/edge_stt_harness.test.mjs tests/tts_binding.test.mjs tests/tts_voice_coverage.test.mjs tests/speech_cert_ci.test.mjs tests/voice_rtt.test.mjs",
48
+ "certify:speech": "pnpm run build && node ./certification/run-speech-cert.mjs",
49
+ "ci:certify:speech": "node ./certification/run-speech-cert.mjs --report-out ../../artifacts/speech-conformance-cert/speech.cert.json",
50
+ "prove:speech-cert": "pnpm run build && node ./certification/prove-speech-cert.mjs",
51
+ "ci:prove:speech-cert": "node ./certification/prove-speech-cert.mjs",
52
+ "fixtures:indic": "node ./scripts/generate-indic-fixtures.mjs",
53
+ "clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\""
54
+ }
55
+ }