agent-voice-audio 0.2.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/audio.darwin-arm64.node +0 -0
- package/index.d.ts +27 -0
- package/index.js +10 -0
- package/package.json +30 -0
|
Binary file
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type AudioEngineOptions = {
|
|
2
|
+
sampleRate?: number;
|
|
3
|
+
channels?: number;
|
|
4
|
+
enableAec?: boolean;
|
|
5
|
+
streamDelayMs?: number;
|
|
6
|
+
maxCaptureFrames?: number;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export type AudioEngineStats = {
|
|
10
|
+
captureFrames: number;
|
|
11
|
+
processedFrames: number;
|
|
12
|
+
playbackUnderruns: number;
|
|
13
|
+
droppedRawFrames: number;
|
|
14
|
+
droppedProcessedFrames: number;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export class AudioEngine {
|
|
18
|
+
constructor(options?: AudioEngineOptions);
|
|
19
|
+
start(): void;
|
|
20
|
+
stop(): void;
|
|
21
|
+
close(): void;
|
|
22
|
+
play(pcm16: Buffer): void;
|
|
23
|
+
readProcessedCapture(maxFrames?: number): Buffer[];
|
|
24
|
+
readRawCapture(maxFrames?: number): Buffer[];
|
|
25
|
+
setStreamDelayMs(delayMs: number): void;
|
|
26
|
+
getStats(): AudioEngineStats;
|
|
27
|
+
}
|
package/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
const { platform, arch } = process;
|
|
3
|
+
|
|
4
|
+
if (platform !== "darwin" || arch !== "arm64") {
|
|
5
|
+
throw new Error(
|
|
6
|
+
`Unsupported platform for agent-voice-audio: ${platform}-${arch}. Supported: darwin-arm64`,
|
|
7
|
+
);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
module.exports = require("./audio.darwin-arm64.node");
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "agent-voice-audio",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Rust full-duplex audio engine with AEC for agent-voice",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"types": "index.d.ts",
|
|
7
|
+
"os": [
|
|
8
|
+
"darwin"
|
|
9
|
+
],
|
|
10
|
+
"cpu": [
|
|
11
|
+
"arm64"
|
|
12
|
+
],
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@napi-rs/cli": "^3.0.0-alpha"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"index.js",
|
|
19
|
+
"index.d.ts",
|
|
20
|
+
"audio.darwin-arm64.node"
|
|
21
|
+
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"artifacts": "napi artifacts",
|
|
24
|
+
"build": "napi build --platform --release --dts index.generated.d.ts",
|
|
25
|
+
"build:debug": "napi build --platform",
|
|
26
|
+
"check": "biome check --write --files-ignore-unknown=true",
|
|
27
|
+
"test": "echo 'no tests yet'",
|
|
28
|
+
"universal": "napi universal -t agent-voice-audio"
|
|
29
|
+
}
|
|
30
|
+
}
|