接口 WlOnPcmDataListener


public interface WlOnPcmDataListener
Created by ywl5320 on 2019/01/02
  • 方法概要

    修饰符和类型 方法 说明
    void onPcmData​(int size, byte[] data)
    回调pcm数据 注:此接口和音频播放位于同一线程,尽量不要做耗时操作 如果需要耗时操作,建议使用队列缓存后处理!
    void onPcmInfo​(int bit, int channel, int samplerate)
    回调pcm信息
  • 方法详细资料

    • onPcmInfo

      void onPcmInfo​(int bit, int channel, int samplerate)
      回调pcm信息
      参数:
      bit - 采样位数
      channel - 声道数
      samplerate - 采样率
    • onPcmData

      void onPcmData​(int size, byte[] data)
      回调pcm数据 注:此接口和音频播放位于同一线程,尽量不要做耗时操作 如果需要耗时操作,建议使用队列缓存后处理!
      参数:
      size - pcm数据大小
      data - pcm数据 (播放时间计算:double time = size / (samplerate * 2 * 2))