@kuralle-syrinx/studio 4.4.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.
- package/LICENSE +22 -0
- package/README.md +69 -0
- package/dist/assets/index-CE2vN6Fq.css +1 -0
- package/dist/assets/index-DS47JImQ.js +171 -0
- package/dist/assets/lib-CP0Q61Ui.js +1 -0
- package/dist/index.html +13 -0
- package/dist/sample.wav +0 -0
- package/dist-path.js +15 -0
- package/package.json +76 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as D,a as R}from"./index-DS47JImQ.js";const U={},$=Object.freeze(Object.defineProperty({__proto__:null,default:U},Symbol.toStringTag,{value:"Module"})),z=D($);var w,k;function E(){if(k)return w;k=1;let n,r,h,e,c,u;{const a=new WebAssembly.Module(z.readFileSync(z.join(__dirname,`${WebAssembly.validate(Uint8Array.of(0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11))?"simd":"opus"}.wasm`)));r=new WebAssembly.Instance(a,{wasi_snapshot_preview1:{fd_seek(){},fd_write(){},fd_close(){},proc_exit(){}},env:{emscripten_notify_memory_growth(){n=new Uint8Array(r.memory.buffer),c=n.subarray(h,h+2**13),u=n.subarray(e,e+2**15)}}}).exports,h=r.malloc(2**13),e=r.malloc(2**15),n=new Uint8Array(r.memory.buffer),c=n.subarray(h,h+2**13),u=n.subarray(e,e+2**15)}function p(a){if(0>a)throw new Error(`opus: ${t(n,r.opus_strerror(a))}`);return a}function b(a){return"FinalizationRegistry"in globalThis?{r:new FinalizationRegistry(a),delete(s){this.r.unregister(s)},add(s,i){this.r.register(s,i,s)}}:{delete(s){},add(s,i){}}}function t(a,s){let i="";const d=a.length|0;for(let l=s|0;l<d;l++){const m=a[l];if(m===0)break;i+=String.fromCharCode(m)}return i}const _=2**13,o=b(a=>r.free(a));class f{#e=0;constructor({channels:s,sample_rate:i}){o.add(this,this.#e=r.malloc(r.opus_decoder_get_size(this.channels=s||2)));try{p(r.opus_decoder_init(this.#e,i||48e3,this.channels))}catch(d){throw this.drop(),d}}drop(){this.#e&&(o.delete(this),r.free(this.#e),this.#e=0)}ctl(s,i){return i==null?r.opus_decoder_ctl_get(this.#e,s):p(r.opus_decoder_ctl_set(this.#e,s,i))}decode(s){return c.set(s=new Uint8Array(s.buffer,s.byteOffset,s.byteLength)),u.slice(0,2*this.channels*p(r.opus_decode(this.#e,h,s.length,e,5760,0)))}}class g{#e=0;constructor({channels:s,application:i,sample_rate:d}){this.channels=s||2,o.add(this,this.#e=r.malloc(r.opus_encoder_get_size(this.channels))),i={voip:2048,audio:2049,restricted_lowdelay:2051}[i||"audio"];try{p(r.opus_encoder_init(this.#e,d||48e3,this.channels,i))}catch(l){throw this.drop(),l}}drop(){this.#e&&(o.delete(this),r.free(this.#e),this.#e=0)}ctl(s,i){return i==null?r.opus_encoder_ctl_get(this.#e,s):p(r.opus_encoder_ctl_set(this.#e,s,i))}encode(s){return u.set(s=new Uint8Array(s.buffer,s.byteOffset,s.byteLength)),c.slice(0,p(r.opus_encode(this.#e,e,s.length/2/this.channels,h,_)))}}return w={Encoder:g,Decoder:f},w}function O(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var x={exports:{}},q;function j(){return q||(q=1,(function(n){n.exports=O(`./${process.arch}-${process.platform}.node`);const r=n.exports.buffers.encoder();n.exports.Encoder=class extends n.exports.Encoder{encode(c){return r.slice(0,super.encode(c))}};const h=n.exports.buffers.decoder();n.exports.Decoder=class extends n.exports.Decoder{decode(c){return h.slice(0,super.decode(c))}}})(x)),x.exports}var y,A;function S(){if(A)return y;A=1;var n={};let r;if(n.OPUS_FORCE_WASM)r=E();else try{r=j()}catch{r=E()}function h(b,t,_){const o=t<b?b:t;return o>_?_:o}const e={auto:-1e3,bitrate_max:-1,reset_state:4028,signal:{auto:-1e3,voice:3001,music:3002},application:{voip:2048,audio:2049,restricted_lowdelay:2051},bandwidth:{auto:-1e3,wideband:1103,fullband:1105,narrowband:1101,mediumband:1102,superwideband:1104},framesize:{5:5002,10:5003,20:5004,40:5005,60:5006,80:5007,100:5008,120:5009,2.5:5001,arg:5e3},set:{vbr:4006,dtx:4016,gain:4034,signal:4024,bitrate:4002,bandwidth:4008,lsb_depth:4036,complexity:4010,inband_fec:4012,application:4e3,max_bandwidth:4004,vbr_constraint:4020,force_channels:4022,packet_loss_perc:4014,prediction_disabled:4042,expert_frame_duration:4040,phase_inversion_disabled:4046},get:{vbr:4007,dtx:4017,gain:4045,pitch:4033,signal:4025,in_dtx:4049,bitrate:4003,lsb_depth:4037,bandwidth:4009,lookahead:4027,complexity:4011,inband_fec:4013,application:4001,sample_rate:4029,final_range:4031,max_bandwidth:4005,vbr_constraint:4021,force_channels:4023,packet_loss_perc:4015,prediction_disabled:4043,last_packet_duration:4039,expert_frame_duration:4041,phase_inversion_disabled:4047}},c={fc:{1:1,2:2,auto:[e.auto],[e.auto]:"auto"},s:{[e.auto]:"auto",[e.signal.voice]:"voice",[e.signal.music]:"music"},a:{[e.application.voip]:"voip",[e.application.audio]:"audio",[e.application.restricted_lowdelay]:"restricted_lowdelay"},b:{[e.auto]:"auto",[e.bandwidth.wideband]:"wideband",[e.bandwidth.fullband]:"fullband",[e.bandwidth.narrowband]:"narrowband",[e.bandwidth.mediumband]:"mediumband",[e.bandwidth.superwideband]:"superwideband"},efd:{[e.framesize[5]]:5,[e.framesize[10]]:10,[e.framesize[20]]:20,[e.framesize[40]]:40,[e.framesize[60]]:60,[e.framesize[80]]:80,[e.framesize[2.5]]:2.5,[e.framesize[100]]:100,[e.framesize[120]]:120,[e.framesize.arg]:"arg"}};class u extends r.Decoder{constructor({channels:t=2,sample_rate:_=48e3}={}){super({channels:t,sample_rate:_}),this.channels=t}get gain(){return this.ctl(e.get.gain)}set gain(t){this.ctl(e.set.gain,h(-32768,t,32767))}get pitch(){const t=this.ctl(e.get.pitch);return t===0?null:t}get last_packet_duration(){return this.ctl(e.get.last_packet_duration)}reset(){this.ctl(e.reset_state)}get in_dtx(){return!!this.ctl(e.get.in_dtx)}get sample_rate(){return this.ctl(e.get.sample_rate)}get bandwidth(){return c.b[this.ctl(e.get.bandwidth)]}get phase_inversion_disabled(){return!!this.ctl(e.get.phase_inversion_disabled)}set phase_inversion_disabled(t){this.ctl(e.set.phase_inversion_disabled,t?1:0)}}class p extends r.Encoder{constructor({channels:t=2,application:_,sample_rate:o=48e3}={}){super({channels:t,sample_rate:o,application:_||"audio"}),this.channels=t}async*encode_pcm_stream(t,_){let o=0;const f=this,g=2*t*this.channels,a=new Uint8Array(g);function*s(i){let d=0;for(;d<i.length;){const l=i.subarray(d,d+=g);if(g===l.length)yield f.encode(l);else{a.set(l,o),o+=l.length;break}}}for await(const i of _){const d=new Uint8Array(i.buffer,i.byteOffset,i.byteLength);if(o===0)for(const l of s(d))yield l;else{const l=g-o;if(l>d.length)a.set(d,o),o+=d.length;else{a.set(d.subarray(0,l),o),yield(o=0,f.encode(a));for(const m of s(d.subarray(l)))yield m}}}}reset(){this.ctl(e.reset_state)}get in_dtx(){return!!this.ctl(e.get.in_dtx)}get sample_rate(){return this.ctl(e.get.sample_rate)}get bandwidth(){return c.b[this.ctl(e.get.bandwidth)]}get phase_inversion_disabled(){return!!this.ctl(e.get.phase_inversion_disabled)}set phase_inversion_disabled(t){this.ctl(e.set.phase_inversion_disabled,t?1:0)}get vbr(){return!!this.ctl(e.get.vbr)}get dtx(){return!!this.ctl(e.get.dtx)}get bitrate(){return this.ctl(e.get.bitrate)}get lookahead(){return this.ctl(e.get.lookahead)}get lsb_depth(){return this.ctl(e.get.lsb_depth)}get complexity(){return this.ctl(e.get.complexity)}get inband_fec(){return!!this.ctl(e.get.inband_fec)}get signal(){return c.s[this.ctl(e.get.signal)]}get packet_loss(){return this.ctl(e.get.packet_loss_perc)}get vbr_constraint(){return!!this.ctl(e.get.vbr_constraint)}get application(){return c.a[this.ctl(e.get.application)]}get max_bandwidth(){return c.b[this.ctl(e.get.max_bandwidth)]}get force_channels(){return c.fc[this.ctl(e.get.force_channels)]}get prediction_disabled(){return!!this.ctl(e.get.prediction_disabled)}get expert_frame_duration(){return covert.efd[this.ctl(e.get.expert_frame_duration)]}set vbr(t){this.ctl(e.set.vbr,t?1:0)}set dtx(t){this.ctl(e.set.dtx,t?1:0)}set signal(t){this.ctl(e.set.signal,e.signal[t])}set inband_fec(t){this.ctl(e.set.inband_fec,t?1:0)}set lsb_depth(t){this.ctl(e.set.lsb_depth,h(8,t,24))}set bandwidth(t){this.ctl(e.set.bandwidth,e.bandwidth[t])}set complexity(t){this.ctl(e.set.complexity,h(0,t,10))}set vbr_constraint(t){this.ctl(e.set.vbr_constraint,t?1:0)}set application(t){this.ctl(e.set.application,e.application[t])}set force_channels(t){this.ctl(e.set.force_channels,c.fc[t])}set packet_loss(t){this.ctl(e.set.packet_loss_perc,h(0,t,100))}set prediction_disabled(t){this.ctl(e.set.prediction_disabled,t?1:0)}set expert_frame_duration(t){this.ctl(e.set.expert_frame_duration,e.framesize[t])}set max_bandwidth(t){this.ctl(e.set.max_bandwidth,e.bandwidth[t==="auto"?"fullband":t])}set bitrate(t){this.ctl(e.set.bitrate,t==="max"?e.bitrate_max:t==="auto"?e.auto:h(500,t|0,512e3))}}return y={ctl:e,Encoder:p,Decoder:u},y}var W=S();const v=R(W),M=v.ctl,N=v.Encoder,P=v.Decoder;export{P as Decoder,N as Encoder,M as ctl};
|
package/dist/index.html
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>Syrinx Studio</title>
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-DS47JImQ.js"></script>
|
|
8
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CE2vN6Fq.css">
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<div id="root"></div>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
package/dist/sample.wav
ADDED
|
Binary file
|
package/dist-path.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
//
|
|
3
|
+
// Resolving a *directory* inside a package is awkward in ESM — there is no
|
|
4
|
+
// `require.resolve` for a folder, and `import.meta.resolve` needs a file. So the
|
|
5
|
+
// package exports this tiny module and consumers resolve the folder relative to
|
|
6
|
+
// it. That keeps working under pnpm's symlinked store and under hoisting.
|
|
7
|
+
//
|
|
8
|
+
// import { studioDistPath } from "@kuralle-syrinx/studio/dist-path";
|
|
9
|
+
// server.use(serveStatic(studioDistPath));
|
|
10
|
+
|
|
11
|
+
import { dirname, join } from "node:path";
|
|
12
|
+
import { fileURLToPath } from "node:url";
|
|
13
|
+
|
|
14
|
+
/** Absolute path to the built studio assets (index.html + assets/). */
|
|
15
|
+
export const studioDistPath = join(dirname(fileURLToPath(import.meta.url)), "dist");
|
package/package.json
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kuralle-syrinx/studio",
|
|
3
|
+
"version": "4.4.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "Syrinx Studio — browser voice studio for local development: mic capture, live transcript, and session debugging over the Syrinx WebSocket protocol",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"voice",
|
|
9
|
+
"voice-agent",
|
|
10
|
+
"speech",
|
|
11
|
+
"syrinx",
|
|
12
|
+
"studio",
|
|
13
|
+
"devtools"
|
|
14
|
+
],
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"homepage": "https://github.com/kuralle/syrinx#readme",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/kuralle/syrinx.git",
|
|
20
|
+
"directory": "apps/studio"
|
|
21
|
+
},
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/kuralle/syrinx/issues"
|
|
24
|
+
},
|
|
25
|
+
"exports": {
|
|
26
|
+
"./dist-path": "./dist-path.js",
|
|
27
|
+
"./dist/*": "./dist/*"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"dist",
|
|
31
|
+
"dist-path.js"
|
|
32
|
+
],
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@playwright/test": "^1.61.1",
|
|
38
|
+
"@radix-ui/react-label": "^2.1.7",
|
|
39
|
+
"@radix-ui/react-select": "^2.2.6",
|
|
40
|
+
"@radix-ui/react-slot": "^1.2.3",
|
|
41
|
+
"@tailwindcss/vite": "^4.1.12",
|
|
42
|
+
"@tanstack/react-router": "^1.131.2",
|
|
43
|
+
"@testing-library/jest-dom": "^6.8.0",
|
|
44
|
+
"@testing-library/react": "^16.3.0",
|
|
45
|
+
"@types/node": "^22.18.0",
|
|
46
|
+
"@types/react": "^19.1.12",
|
|
47
|
+
"@types/react-dom": "^19.1.9",
|
|
48
|
+
"@types/ws": "^8.18.1",
|
|
49
|
+
"@vitejs/plugin-react": "^5.0.2",
|
|
50
|
+
"class-variance-authority": "^0.7.1",
|
|
51
|
+
"clsx": "^2.1.1",
|
|
52
|
+
"jsdom": "^26.1.0",
|
|
53
|
+
"lucide-react": "^0.544.0",
|
|
54
|
+
"react": "^19.1.1",
|
|
55
|
+
"react-dom": "^19.1.1",
|
|
56
|
+
"tailwind-merge": "^3.3.1",
|
|
57
|
+
"tailwindcss": "^4.1.12",
|
|
58
|
+
"tsx": "^4.20.5",
|
|
59
|
+
"typescript": "^6.0.3",
|
|
60
|
+
"vite": "^6.4.3",
|
|
61
|
+
"vitest": "^3.2.6",
|
|
62
|
+
"wrangler": "^4.34.0",
|
|
63
|
+
"ws": "^8.21.0",
|
|
64
|
+
"@kuralle-syrinx/browser-client": "4.4.0"
|
|
65
|
+
},
|
|
66
|
+
"scripts": {
|
|
67
|
+
"dev": "vite",
|
|
68
|
+
"build": "vite build",
|
|
69
|
+
"preview": "vite preview",
|
|
70
|
+
"deploy": "vite build && wrangler deploy",
|
|
71
|
+
"hosted-test": "tsx scripts/hosted-test.ts",
|
|
72
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
73
|
+
"test": "vitest run",
|
|
74
|
+
"test:e2e": "playwright test"
|
|
75
|
+
}
|
|
76
|
+
}
|