Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * 构造 PLShortAudioRecorder 对象
- */
- public PLShortAudioRecorder();
- /**
- * 使 PLShortAudioRecorder 暂停工作,通常在 Activity#onPause 中调用
- */
- public pause();
- /**
- * 使 PLShortAudioRecorder 恢复工作,通常在 Activity#onResume 中调用
- */
- public resume();
- /**
- * 销毁 PLShortAudioRecorder 对象,通常在 Activity#onDestroy 中调用
- * 将删除已录制的片段
- */
- public destory();
- /**
- * 销毁 PLShortAudioRecorder 对象,通常在 Activity#onDestroy 中调用
- * @param clearSections 是否删除已录制的片段
- */
- public destory(boolean clearSections);
- /**
- * Prepare the recorder
- *
- * @param context Context 对象
- * @param microphoneSetting PLMicrophoneSetting 对象
- * @param audioEncodeSetting PLAudioEncodeSetting 对象
- * @param recordSetting PLRecordSetting 对象
- */
- public void prepare(Context context,
- PLMicrophoneSetting microphoneSetting,
- PLAudioEncodeSetting audioEncodeSetting,
- PLRecordSetting recordSetting);
- /**
- * 开始录制音频片段,需要收到 `onReady` 回调之后执行
- */
- public boolean beginSection();
- /**
- * 开始录制音频片段,需要收到 `onReady` 回调之后执行
- * @param 指定片段文件名
- */
- public boolean beginSection(String sectionFileName);
- /**
- * 停止录制当前音频片段
- */
- public boolean endSection();
- /**
- * 删除上一个录制的音频片段
- */
- public boolean deleteLastSection();
- /**
- * 删除所有录制的音频片段
- */
- public boolean deleteAllSections();
- /**
- * 合并录制的音频片段,SDK 将会在缓存目录中临时创建对应文件
- * @param 用于接收合并回调的 listener
- */
- public void concatSections(PLVideoSaveListener listener);
- /**
- * 取消进行中的音频片段合并,会清理已生成的文件
- */
- public void cancelConcat();
- /**
- * 注册音频帧监听器
- * @param 监听器对象
- */
- public final void setAudioFrameListener(PLAudioFrameListener listener);
- /**
- * 注册录制状态监听器
- * @param 监听器对象
- */
- public final void setRecordStateListener(PLRecordStateListener listener);
- /**
- * 将当前录制的片段与设置项存入草稿箱
- * @param 草稿标签,不同草稿需要有不同的标签,否则保存时会覆盖相同标签的草稿
- */
- public boolean saveToDraftBox(String tag) {
- return mShortAudioRecorderCore.saveToDraftBox(tag);
- }
- /**
- * 从草稿恢复
- * @param context context 对象
- * @param draft 草稿对象
- */
- public boolean recoverFromDraft(Context context, PLDraft draft);
Add Comment
Please, Sign In to add comment