@mingxy/ocosay 1.0.20 → 1.0.21

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.
@@ -1,25 +1,19 @@
1
1
  /**
2
2
  * StreamPlayer - 真正的边收边播流式音频播放器
3
- * 接收音频 chunk,同时写入临时文件并立即启动播放器播放
3
+ * 使用 AudioBackend 实现真正的流式播放(不写临时文件)
4
4
  */
5
5
  import { EventEmitter } from 'events';
6
- import { spawn } from 'child_process';
7
- import fs from 'fs';
8
- import { createWriteStream } from 'fs';
9
- import { tmpdir } from 'os';
10
- import { join } from 'path';
6
+ import { createBackend, BackendType } from './backends';
11
7
  /**
12
8
  * StreamPlayer - 边收边播的流式音频播放器
13
9
  *
14
10
  * 特性:
15
- * - 写入临时文件的同时立即启动播放器
11
+ * - 使用 AudioBackend 实现真正的边收边播
12
+ * - 不写临时文件,直接流式播放
16
13
  * - 支持 pause/resume/stop 控制
17
- * - 跨平台支持:macOS (afplay), Linux (aplay), Windows (PowerShell)
18
14
  */
19
15
  export class StreamPlayer extends EventEmitter {
20
- tempFile = '';
21
- writeStream;
22
- playerProcess;
16
+ backend = null;
23
17
  _bytesWritten = 0;
24
18
  _started = false;
25
19
  _paused = false;
@@ -30,83 +24,64 @@ export class StreamPlayer extends EventEmitter {
30
24
  super();
31
25
  this.format = options.format || 'mp3';
32
26
  this.events = options.events;
27
+ // 创建音频后端
28
+ const backendType = options.backendType || BackendType.NAUDIODON;
29
+ this.backend = createBackend(backendType, {
30
+ format: this.format,
31
+ events: {
32
+ onStart: () => {
33
+ this.events?.onStart?.();
34
+ this.emit('start');
35
+ },
36
+ onEnd: () => {
37
+ this.events?.onEnd?.();
38
+ this.emit('end');
39
+ },
40
+ onError: (error) => {
41
+ this.handleError(error);
42
+ },
43
+ onPause: () => {
44
+ this._paused = true;
45
+ this.events?.onPause?.();
46
+ this.emit('pause');
47
+ },
48
+ onResume: () => {
49
+ this._paused = false;
50
+ this.events?.onResume?.();
51
+ this.emit('resume');
52
+ },
53
+ onStop: () => {
54
+ this.events?.onStop?.();
55
+ this.emit('stop');
56
+ },
57
+ onProgress: (bytes) => {
58
+ this.events?.onProgress?.(bytes);
59
+ this.emit('progress', bytes);
60
+ }
61
+ }
62
+ });
33
63
  }
34
64
  /**
35
65
  * 开始播放
36
- * 创建临时文件,创建写入流,启动播放器进程
66
+ * 初始化后端,准备接收音频数据
37
67
  */
38
68
  start() {
39
69
  if (this._started) {
40
70
  return;
41
71
  }
42
- // 创建临时文件
43
- this.tempFile = join(tmpdir(), `ocosay-stream-${Date.now()}.${this.format}`);
44
- // 创建写入流
45
- this.writeStream = createWriteStream(this.tempFile, { highWaterMark: 64 * 1024 });
46
- this.writeStream.on('error', (error) => {
47
- this.handleError(error);
48
- });
49
- this.writeStream.on('finish', () => {
50
- // 写入完成,但播放器可能还在播放
51
- });
52
- // 启动播放器进程
53
- this.startPlayer();
54
- this._started = true;
55
- this._stopped = false;
56
- this.events?.onStart?.();
57
- this.emit('start');
58
- }
59
- /**
60
- * 启动播放器进程
61
- */
62
- startPlayer() {
63
- const platform = process.platform;
64
- let command;
65
- let args;
66
- if (platform === 'darwin') {
67
- // macOS
68
- command = 'afplay';
69
- args = [this.tempFile];
70
- }
71
- else if (platform === 'linux') {
72
- // Linux
73
- command = 'aplay';
74
- args = [this.tempFile];
75
- }
76
- else {
77
- // Windows - PlaySync is synchronous and blocks the event loop
78
- // Return error to indicate Windows is not supported for streaming
79
- this.handleError(new Error('Windows platform is not supported for stream playback. PlaySync() blocks the Node.js event loop.'));
72
+ if (!this.backend) {
73
+ this.handleError(new Error('Audio backend not initialized'));
80
74
  return;
81
75
  }
82
- this.playerProcess = spawn(command, args, {
83
- stdio: 'ignore',
84
- detached: false
85
- });
86
- this.playerProcess.on('exit', (code, signal) => {
87
- // 如果是正常结束或被信号终止,不当作错误
88
- if (this._stopped) {
89
- return;
90
- }
91
- if (signal === 'SIGTERM' || signal === 'SIGINT') {
92
- // 被主动停止
93
- return;
94
- }
95
- if (code === 0 || code === null) {
96
- // 正常播放结束
97
- this.events?.onEnd?.();
98
- this.emit('end');
99
- }
100
- else {
101
- this.handleError(new Error(`Player exited with code ${code}`));
102
- }
103
- });
104
- this.playerProcess.on('error', (error) => {
105
- this.handleError(error);
106
- });
76
+ // 初始化后端
77
+ this.backend.start('');
78
+ this._started = true;
79
+ this._stopped = false;
80
+ this._paused = false;
81
+ this._bytesWritten = 0;
107
82
  }
108
83
  /**
109
- * 写入音频数据块(边收边写)
84
+ * 写入音频数据块(边收边播)
110
85
  * 如果尚未 start(),会自动调用
111
86
  */
112
87
  write(chunk) {
@@ -118,15 +93,9 @@ export class StreamPlayer extends EventEmitter {
118
93
  if (!this._started) {
119
94
  this.start();
120
95
  }
121
- // 写入数据到文件
122
- if (this.writeStream) {
123
- const canContinue = this.writeStream.write(chunk);
124
- if (!canContinue) {
125
- // 写入缓冲区满了,等待 drain 事件
126
- this.writeStream.once('drain', () => {
127
- // 可以继续写入
128
- });
129
- }
96
+ // 写入数据到后端
97
+ if (this.backend) {
98
+ this.backend.write(chunk);
130
99
  this._bytesWritten += chunk.length;
131
100
  this.events?.onProgress?.(this._bytesWritten);
132
101
  this.emit('progress', this._bytesWritten);
@@ -134,65 +103,38 @@ export class StreamPlayer extends EventEmitter {
134
103
  }
135
104
  /**
136
105
  * 结束写入
137
- * 关闭写入流,但不杀播放器进程,让它播完
106
+ * 通知后端写入完成,但保持播放直到结束
138
107
  */
139
108
  end() {
140
- if (this.writeStream) {
141
- this.writeStream.end();
142
- this.writeStream = undefined;
109
+ if (this.backend) {
110
+ this.backend.end();
143
111
  }
144
112
  }
145
113
  /**
146
114
  * 停止播放
147
- * 杀死播放器进程,删除临时文件
115
+ * 立即停止播放并释放资源
148
116
  */
149
117
  stop() {
150
118
  this._stopped = true;
151
119
  this._started = false;
152
120
  this._paused = false;
153
- // 杀死播放器进程
154
- if (this.playerProcess) {
155
- try {
156
- this.playerProcess.kill('SIGTERM');
157
- }
158
- catch (e) {
159
- // 忽略错误
160
- }
161
- this.playerProcess = undefined;
121
+ // 停止后端
122
+ if (this.backend) {
123
+ this.backend.stop();
162
124
  }
163
- // 关闭写入流
164
- if (this.writeStream) {
165
- try {
166
- this.writeStream.destroy();
167
- }
168
- catch (e) {
169
- // 忽略错误
170
- }
171
- this.writeStream = undefined;
172
- }
173
- // 删除临时文件
174
- this.deleteTempFile();
125
+ this._bytesWritten = 0;
175
126
  this.events?.onStop?.();
176
127
  this.emit('stop');
177
128
  }
178
129
  /**
179
130
  * 暂停播放
180
- * 使用 SIGSTOP 暂停播放器进程
181
131
  */
182
132
  pause() {
183
133
  if (!this._started || this._paused || this._stopped) {
184
134
  return;
185
135
  }
186
- if (this.playerProcess) {
187
- try {
188
- this.playerProcess.kill('SIGSTOP');
189
- this._paused = true;
190
- this.events?.onPause?.();
191
- this.emit('pause');
192
- }
193
- catch (e) {
194
- // 如果 kill 失败,忽略
195
- }
136
+ if (this.backend) {
137
+ this.backend.pause();
196
138
  }
197
139
  }
198
140
  /**
@@ -202,16 +144,8 @@ export class StreamPlayer extends EventEmitter {
202
144
  if (!this._paused || this._stopped) {
203
145
  return;
204
146
  }
205
- if (this.playerProcess) {
206
- try {
207
- this.playerProcess.kill('SIGCONT');
208
- this._paused = false;
209
- this.events?.onResume?.();
210
- this.emit('resume');
211
- }
212
- catch (e) {
213
- // 如果 kill 失败,忽略
214
- }
147
+ if (this.backend) {
148
+ this.backend.resume();
215
149
  }
216
150
  }
217
151
  /**
@@ -238,12 +172,6 @@ export class StreamPlayer extends EventEmitter {
238
172
  getBytesWritten() {
239
173
  return this._bytesWritten;
240
174
  }
241
- /**
242
- * 获取临时文件路径
243
- */
244
- getTempFile() {
245
- return this.tempFile;
246
- }
247
175
  /**
248
176
  * 处理错误
249
177
  */
@@ -251,22 +179,6 @@ export class StreamPlayer extends EventEmitter {
251
179
  this.events?.onError?.(error);
252
180
  this.emit('error', error);
253
181
  }
254
- /**
255
- * 删除临时文件
256
- */
257
- deleteTempFile() {
258
- if (this.tempFile) {
259
- try {
260
- if (fs.existsSync(this.tempFile)) {
261
- fs.unlinkSync(this.tempFile);
262
- }
263
- }
264
- catch (e) {
265
- // 忽略删除错误
266
- }
267
- this.tempFile = '';
268
- }
269
- }
270
182
  }
271
183
  export default StreamPlayer;
272
184
  //# sourceMappingURL=stream-player.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"stream-player.js","sourceRoot":"","sources":["../../src/core/stream-player.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AACrC,OAAO,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAA;AACnD,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,EAAE,iBAAiB,EAAe,MAAM,IAAI,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAA;AAC3B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAuB3B;;;;;;;GAOG;AACH,MAAM,OAAO,YAAa,SAAQ,YAAY;IACpC,QAAQ,GAAW,EAAE,CAAA;IACrB,WAAW,CAAc;IACzB,aAAa,CAAe;IAC5B,aAAa,GAAG,CAAC,CAAA;IACjB,QAAQ,GAAG,KAAK,CAAA;IAChB,OAAO,GAAG,KAAK,CAAA;IACf,QAAQ,GAAG,KAAK,CAAA;IAChB,MAAM,GAA2B,KAAK,CAAA;IACtC,MAAM,CAAqB;IAEnC,YAAY,UAA+B,EAAE;QAC3C,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,KAAK,CAAA;QACrC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;IAC9B,CAAC;IAED;;;OAGG;IACH,KAAK;QACH,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAM;QACR,CAAC;QAED,SAAS;QACT,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,MA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OAAO,CAAC,MAAM,EAAE,CAAA;QACvB,CAAC;IACH,CAAC;IAED;;OAEG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,QAAQ,CAAA;IACtB,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;IAED;;OAEG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,QAAQ,CAAA;IACtB,CAAC;IAED;;OAEG;IACH,eAAe;QACb,OAAO,IAAI,CAAC,aAAa,CAAA;IAC3B,CAAC;IAED;;OAEG;IACK,WAAW,CAAC,KAAY;QAC9B,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,KAAK,CAAC,CAAA;QAC7B,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;IAC3B,CAAC;CACF;AAED,eAAe,YAAY,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAA8B,MAAM,qBAAqB,CAAA;AAwJ7E,QAAA,MAAM,YAAY,EAAE,MAyInB,CAAA;AAED,eAAO,MAAM,MAAM,QAAe,CAAA;AAClC,eAAe,YAAY,CAAA"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAA8B,MAAM,qBAAqB,CAAA;AA4J7E,QAAA,MAAM,YAAY,EAAE,MAyInB,CAAA;AAED,eAAO,MAAM,MAAM,QAAe,CAAA;AAClC,eAAe,YAAY,CAAA"}