未验证 提交 75fb1cca 编写于 作者: O openharmony_ci 提交者: Gitee

!14531 audio-capturer.md

Merge pull request !14531 from li-yifan2/master
...@@ -72,7 +72,7 @@ AudioCapturer提供了用于获取原始音频文件的方法。开发者可以 ...@@ -72,7 +72,7 @@ AudioCapturer提供了用于获取原始音频文件的方法。开发者可以
} }
await audioCapturer.start(); await audioCapturer.start();
let state = audioCapturer.state; state = audioCapturer.state;
if (state == audio.AudioState.STATE_RUNNING) { if (state == audio.AudioState.STATE_RUNNING) {
console.info('AudioRecLog: Capturer started'); console.info('AudioRecLog: Capturer started');
} else { } else {
...@@ -112,6 +112,7 @@ AudioCapturer提供了用于获取原始音频文件的方法。开发者可以 ...@@ -112,6 +112,7 @@ AudioCapturer提供了用于获取原始音频文件的方法。开发者可以
let numBuffersToCapture = 150; // 循环写入150次 let numBuffersToCapture = 150; // 循环写入150次
while (numBuffersToCapture) { while (numBuffersToCapture) {
let bufferSize = await audioCapturer.getBuffersize();
let buffer = await audioCapturer.read(bufferSize, true); let buffer = await audioCapturer.read(bufferSize, true);
if (typeof(buffer) == undefined) { if (typeof(buffer) == undefined) {
console.info('AudioRecLog: read buffer failed'); console.info('AudioRecLog: read buffer failed');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册