StreamingAudioPlayer

基本信息

属性 值
类名 pl.asie.lib.audio.StreamingAudioPlayer
类型 class extends DFPWM
方法数 10
源码规模 219 行
启用版本 1.7.10

功能

流式音频播放器:按「音源 ID」维护多个 SourceEntry(各自的 IntBuffer 缓冲与 已收包数),把收到的 PCM 块按时序推给 OpenAL 播放。

实现要点

  • 内部类 SourceEntry(第 23 行)持有 id(String)、src(IntBuffer)与 receivedPackets(int)。
  • 构造器 StreamingAudioPlayer(boolean sixteenBit, boolean stereo, int bufferPackets) 决定采样格式与缓冲深度。
  • setHearing(float dist, float vol) / setSampleRate(int) / updatePosition(String id, float x, float y, float z) / push(byte[] data) 是对外的主要入口。
  • 本 mod 不播放任何音频——整套音频栈供 asie 内容 mod 使用。

相关条目