Guest User

Untitled

a guest
Jul 18th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.53 KB | None | 0 0
  1. /**
  2. * 构造 PLShortAudioRecorder 对象
  3. */
  4. public PLShortAudioRecorder();
  5.  
  6. /**
  7. * 使 PLShortAudioRecorder 暂停工作,通常在 Activity#onPause 中调用
  8. */
  9. public pause();
  10.  
  11. /**
  12. * 使 PLShortAudioRecorder 恢复工作,通常在 Activity#onResume 中调用
  13. */
  14. public resume();
  15.  
  16. /**
  17. * 销毁 PLShortAudioRecorder 对象,通常在 Activity#onDestroy 中调用
  18. * 将删除已录制的片段
  19. */
  20. public destory();
  21.  
  22. /**
  23. * 销毁 PLShortAudioRecorder 对象,通常在 Activity#onDestroy 中调用
  24. * @param clearSections 是否删除已录制的片段
  25. */
  26. public destory(boolean clearSections);
  27.  
  28. /**
  29. * Prepare the recorder
  30. *
  31. * @param context Context 对象
  32. * @param microphoneSetting PLMicrophoneSetting 对象
  33. * @param audioEncodeSetting PLAudioEncodeSetting 对象
  34. * @param recordSetting PLRecordSetting 对象
  35. */
  36. public void prepare(Context context,
  37. PLMicrophoneSetting microphoneSetting,
  38. PLAudioEncodeSetting audioEncodeSetting,
  39. PLRecordSetting recordSetting);
  40.  
  41. /**
  42. * 开始录制音频片段,需要收到 `onReady` 回调之后执行
  43. */
  44. public boolean beginSection();
  45.  
  46. /**
  47. * 开始录制音频片段,需要收到 `onReady` 回调之后执行
  48. * @param 指定片段文件名
  49. */
  50. public boolean beginSection(String sectionFileName);
  51.  
  52. /**
  53. * 停止录制当前音频片段
  54. */
  55. public boolean endSection();
  56.  
  57. /**
  58. * 删除上一个录制的音频片段
  59. */
  60. public boolean deleteLastSection();
  61.  
  62. /**
  63. * 删除所有录制的音频片段
  64. */
  65. public boolean deleteAllSections();
  66.  
  67. /**
  68. * 合并录制的音频片段,SDK 将会在缓存目录中临时创建对应文件
  69. * @param 用于接收合并回调的 listener
  70. */
  71. public void concatSections(PLVideoSaveListener listener);
  72.  
  73. /**
  74. * 取消进行中的音频片段合并,会清理已生成的文件
  75. */
  76. public void cancelConcat();
  77.  
  78. /**
  79. * 注册音频帧监听器
  80. * @param 监听器对象
  81. */
  82. public final void setAudioFrameListener(PLAudioFrameListener listener);
  83.  
  84. /**
  85. * 注册录制状态监听器
  86. * @param 监听器对象
  87. */
  88. public final void setRecordStateListener(PLRecordStateListener listener);
  89.  
  90. /**
  91. * 将当前录制的片段与设置项存入草稿箱
  92. * @param 草稿标签,不同草稿需要有不同的标签,否则保存时会覆盖相同标签的草稿
  93. */
  94. public boolean saveToDraftBox(String tag) {
  95. return mShortAudioRecorderCore.saveToDraftBox(tag);
  96. }
  97.  
  98. /**
  99. * 从草稿恢复
  100. * @param context context 对象
  101. * @param draft 草稿对象
  102. */
  103. public boolean recoverFromDraft(Context context, PLDraft draft);
Add Comment
Please, Sign In to add comment