MCPcopy Create free account
hub / github.com/FunAudioLLM/Fun-Audio-Chat / asMs

Function asMs

web_demo/client/src/audio-processor.ts:12–14  ·  view source on GitHub ↗

* 音频队列播放器 - 优化网络抖动处理 * * 设计思路: * 1. 所有收到的音频帧按顺序入队 * 2. 使用较大的初始缓冲区减少网络抖动影响 * 3. 不丢弃任何音频帧,确保完整播放 * 4. Buffer underrun 时快速恢复

(samples)

Source from the content-addressed store, hash-verified

10 */
11
12function asMs(samples) {
13 return (samples * 1000 / sampleRate).toFixed(1);
14}
15
16function asSamples(mili) {
17 return Math.round(mili * sampleRate / 1000);

Callers 3

constructorMethod · 0.85
startPlaybackMethod · 0.85
processMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected