Class ZegoPlayAudioRecorder
- java.lang.Object
-
- com.zego.zegoavkit2.playaudiorecorder.ZegoPlayAudioRecorder
-
- All Implemented Interfaces:
IZegoPlayAudioRecorderCallback
public class ZegoPlayAudioRecorder extends java.lang.Object implements IZegoPlayAudioRecorderCallback
Copyright © 2017 Zego. All rights reserved.
-
-
Constructor Summary
Constructors Constructor Description ZegoPlayAudioRecorder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
enablePlayAudioRecorder(boolean enable, int sampleRate, int channels)
设置是否开启拉流音频数据回调void
onPlayAudioRecorder(java.lang.String streamID, ZegoAudioFrame audioFrame)
当前播放流的音频数据void
setPlayAudioRecorderCallback(IZegoPlayAudioRecorderCallback callback)
设置音频数据的回调
-
-
-
Method Detail
-
enablePlayAudioRecorder
public static void enablePlayAudioRecorder(boolean enable, int sampleRate, int channels)
设置是否开启拉流音频数据回调- Parameters:
enable
- 开启sampleRate
- 数据采样率,取值 0, 16000, 32000, 44100, 48000,0表示使用原数据采样率,不做采样转换channels
- 数据通道数,取值0,1,2,0表示使用原数据通道数
-
setPlayAudioRecorderCallback
public void setPlayAudioRecorderCallback(IZegoPlayAudioRecorderCallback callback)
设置音频数据的回调注意:未设置回调,不会有音频数据回调。
- Parameters:
callback
- 音频数据回调
-
onPlayAudioRecorder
public void onPlayAudioRecorder(java.lang.String streamID, ZegoAudioFrame audioFrame)
Description copied from interface:IZegoPlayAudioRecorderCallback
当前播放流的音频数据注意:音频数据在拉流线程回调,如果开发者自己渲染,需要立即执行选择; 如果开发者对数据处理,拷贝到其他线程处理,占用大量时间会导致拉流线程等待。
- Specified by:
onPlayAudioRecorder
in interfaceIZegoPlayAudioRecorderCallback
- Parameters:
streamID
- 流 ID;audioFrame
- 音频数据
-
-