Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
053f448d
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
053f448d
编写于
9月 09, 2022
作者:
O
openharmony_ci
提交者:
Gitee
9月 09, 2022
浏览文件
操作
浏览文件
下载
差异文件
!5428 【媒体子系统】audio部件规范性整改
Merge pull request !5428 from liuxueqi/master
上级
d001e084
b1d3d4b3
变更
14
展开全部
隐藏空白更改
内联
并排
Showing
14 changed file
with
1526 addition
and
1742 deletion
+1526
-1742
multimedia/audio/audio_js_standard/AudioCapturer/Test.json
multimedia/audio/audio_js_standard/AudioCapturer/Test.json
+1
-1
multimedia/audio/audio_js_standard/AudioCapturer/src/main/js/test/AudioCapturer.test.js
...dard/AudioCapturer/src/main/js/test/AudioCapturer.test.js
+421
-423
multimedia/audio/audio_js_standard/AudioCapturerChangeInfo/Test.json
...audio/audio_js_standard/AudioCapturerChangeInfo/Test.json
+1
-1
multimedia/audio/audio_js_standard/AudioCapturerChangeInfo/src/main/js/test/AudioCapturerChangeInfo.test.js
...angeInfo/src/main/js/test/AudioCapturerChangeInfo.test.js
+153
-153
multimedia/audio/audio_js_standard/AudioEventManagement/Test.json
...ia/audio/audio_js_standard/AudioEventManagement/Test.json
+1
-1
multimedia/audio/audio_js_standard/AudioEventManagement/src/main/js/test/AudioEventManagement.test.js
...tManagement/src/main/js/test/AudioEventManagement.test.js
+22
-49
multimedia/audio/audio_js_standard/AudioRendererChangeInfo/Test.json
...audio/audio_js_standard/AudioRendererChangeInfo/Test.json
+1
-1
multimedia/audio/audio_js_standard/AudioRendererChangeInfo/src/main/js/test/AudioRendererChangeInfo.test.js
...angeInfo/src/main/js/test/AudioRendererChangeInfo.test.js
+227
-227
multimedia/audio/audio_js_standard/audioManager/Test.json
multimedia/audio/audio_js_standard/audioManager/Test.json
+1
-1
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioFramework.test.js
...dard/audioManager/src/main/js/test/AudioFramework.test.js
+191
-378
multimedia/audio/audio_js_standard/audioRenderer/Test.json
multimedia/audio/audio_js_standard/audioRenderer/Test.json
+1
-1
multimedia/audio/audio_js_standard/audioRenderer/src/main/js/test/AudioRenderer.test.js
...dard/audioRenderer/src/main/js/test/AudioRenderer.test.js
+477
-477
multimedia/audio/audio_js_standard/audioVoip/Test.json
multimedia/audio/audio_js_standard/audioVoip/Test.json
+1
-1
multimedia/audio/audio_js_standard/audioVoip/src/main/js/test/AudioVOIP.test.js
..._js_standard/audioVoip/src/main/js/test/AudioVOIP.test.js
+28
-28
未找到文件。
multimedia/audio/audio_js_standard/AudioCapturer/Test.json
浏览文件 @
053f448d
...
...
@@ -2,7 +2,7 @@
"description"
:
"Configuration for audio manager Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"
5
500000"
,
"test-timeout"
:
"
1
500000"
,
"package"
:
"ohos.acts.multimedia.audio.audiocapturer"
,
"shell-timeout"
:
"60000"
},
...
...
multimedia/audio/audio_js_standard/AudioCapturer/src/main/js/test/AudioCapturer.test.js
浏览文件 @
053f448d
此差异已折叠。
点击以展开。
multimedia/audio/audio_js_standard/AudioCapturerChangeInfo/Test.json
浏览文件 @
053f448d
...
...
@@ -2,7 +2,7 @@
"description"
:
"Configuration for audio manager Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"
5
500000"
,
"test-timeout"
:
"
1
500000"
,
"package"
:
"ohos.acts.multimedia.audio.audiocapturerchangeInfo"
,
"shell-timeout"
:
"60000"
},
...
...
multimedia/audio/audio_js_standard/AudioCapturerChangeInfo/src/main/js/test/AudioCapturerChangeInfo.test.js
浏览文件 @
053f448d
此差异已折叠。
点击以展开。
multimedia/audio/audio_js_standard/AudioEventManagement/Test.json
浏览文件 @
053f448d
...
...
@@ -2,7 +2,7 @@
"description"
:
"Configuration for audio manager Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"
5
500000"
,
"test-timeout"
:
"
1
500000"
,
"package"
:
"ohos.acts.multimedia.audio.audioeventmanagement"
,
"shell-timeout"
:
"60000"
},
...
...
multimedia/audio/audio_js_standard/AudioEventManagement/src/main/js/test/AudioEventManagement.test.js
浏览文件 @
053f448d
...
...
@@ -19,8 +19,8 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
describe
(
'
audioEventManagement
'
,
function
()
{
console
.
info
(
'
AudioFrameworkTest: Create AudioManger Object JS Framework
'
);
let
audioManager
=
null
;
var
deviceRoleValue
=
null
;
var
deviceTypeValue
=
null
;
let
deviceRoleValue
=
null
;
let
deviceTypeValue
=
null
;
function
sleep
(
ms
)
{
return
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
ms
));
}
...
...
@@ -34,8 +34,8 @@ describe('audioEventManagement', function () {
}
}
function
displayDeviceProp
(
value
,
index
,
array
)
{
var
devRoleName
;
var
devTypeName
;
let
devRoleName
;
let
devTypeName
;
if
(
value
.
deviceRole
==
1
)
{
devRoleName
=
'
INPUT_DEVICE
'
;
}
...
...
@@ -100,10 +100,8 @@ describe('audioEventManagement', function () {
*@tc.level : Level 0
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_MANAGER_GETDEVICES_0100
'
,
0
,
async
function
(
done
)
{
deviceRoleValue
=
null
;
deviceTypeValue
=
null
;
const
promise
=
audioManager
.
getDevices
(
audio
.
DeviceFlag
.
OUTPUT_DEVICES_FLAG
)
promise
.
then
(
function
(
value
)
{
const
PROMISE
=
audioManager
.
getDevices
(
audio
.
DeviceFlag
.
OUTPUT_DEVICES_FLAG
)
PROMISE
.
then
(
function
(
value
)
{
console
.
info
(
'
AudioFrameworkTest: Promise: getDevices OUTPUT_DEVICES_FLAG
'
);
value
.
forEach
(
displayDeviceProp
);
...
...
@@ -116,7 +114,7 @@ describe('audioEventManagement', function () {
expect
(
false
).
assertTrue
();
}
});
await
promise
;
await
PROMISE
;
done
();
})
...
...
@@ -129,11 +127,8 @@ describe('audioEventManagement', function () {
*@tc.level : Level 0
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_PR_GETDEVICES_OUTPUT_ENUM_0100
'
,
0
,
async
function
(
done
)
{
deviceRoleValue
=
null
;
deviceTypeValue
=
null
;
const
promise
=
audioManager
.
getDevices
(
1
)
promise
.
then
(
function
(
value
)
{
const
PROMISE
=
audioManager
.
getDevices
(
1
)
PROMISE
.
then
(
function
(
value
)
{
console
.
info
(
'
AudioFrameworkTest: Promise: getDevices OUTPUT_DEVICES_FLAG
'
);
value
.
forEach
(
displayDeviceProp
);
if
(
deviceTypeValue
!=
null
&&
deviceRoleValue
!=
null
)
{
...
...
@@ -145,7 +140,7 @@ describe('audioEventManagement', function () {
expect
(
false
).
assertTrue
();
}
});
await
promise
;
await
PROMISE
;
done
();
})
...
...
@@ -158,10 +153,8 @@ describe('audioEventManagement', function () {
*@tc.level : Level 0
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_PR_GETDEVICES_INPUT_0100
'
,
0
,
async
function
(
done
)
{
deviceRoleValue
=
null
;
deviceTypeValue
=
null
;
const
promise
=
audioManager
.
getDevices
(
audio
.
DeviceFlag
.
INPUT_DEVICES_FLAG
);
promise
.
then
(
function
(
value
)
{
const
PROMISE
=
audioManager
.
getDevices
(
audio
.
DeviceFlag
.
INPUT_DEVICES_FLAG
);
PROMISE
.
then
(
function
(
value
)
{
console
.
info
(
'
AudioFrameworkTest: Promise: getDevices INPUT_DEVICES_FLAG
'
);
value
.
forEach
(
displayDeviceProp
);
if
(
deviceTypeValue
!=
null
&&
deviceRoleValue
!=
null
)
{
...
...
@@ -173,7 +166,7 @@ describe('audioEventManagement', function () {
expect
(
false
).
assertTrue
();
}
});
await
promise
;
await
PROMISE
;
done
();
})
...
...
@@ -186,10 +179,8 @@ describe('audioEventManagement', function () {
*@tc.level : Level 0
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_PR_GETDEVICES_INTPUT_ENUM_0100
'
,
0
,
async
function
(
done
)
{
deviceRoleValue
=
null
;
deviceTypeValue
=
null
;
const
promise
=
audioManager
.
getDevices
(
2
);
promise
.
then
(
function
(
value
)
{
const
PROMISE
=
audioManager
.
getDevices
(
2
);
PROMISE
.
then
(
function
(
value
)
{
console
.
info
(
'
AudioFrameworkTest: Promise: getDevices INPUT_DEVICES_FLAG
'
);
value
.
forEach
(
displayDeviceProp
);
...
...
@@ -202,7 +193,7 @@ describe('audioEventManagement', function () {
expect
(
false
).
assertTrue
();
}
});
await
promise
;
await
PROMISE
;
done
();
})
...
...
@@ -215,10 +206,8 @@ describe('audioEventManagement', function () {
*@tc.level : Level 0
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_PR_GETDEVICES_ALL_0100
'
,
0
,
async
function
(
done
)
{
deviceRoleValue
=
null
;
deviceTypeValue
=
null
;
const
promise
=
audioManager
.
getDevices
(
audio
.
DeviceFlag
.
ALL_DEVICES_FLAG
);
promise
.
then
(
function
(
value
)
{
const
PROMISE
=
audioManager
.
getDevices
(
audio
.
DeviceFlag
.
ALL_DEVICES_FLAG
);
PROMISE
.
then
(
function
(
value
)
{
console
.
info
(
'
AudioFrameworkTest: Promise: getDevices ALL_DEVICES_FLAG
'
);
value
.
forEach
(
displayDeviceProp
);
...
...
@@ -231,7 +220,7 @@ describe('audioEventManagement', function () {
expect
(
false
).
assertTrue
();
}
});
await
promise
;
await
PROMISE
;
done
();
})
...
...
@@ -244,10 +233,8 @@ describe('audioEventManagement', function () {
*@tc.level : Level 0
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_PR_GETDEVICES_ALL_ENUM_0100
'
,
0
,
async
function
(
done
)
{
deviceRoleValue
=
null
;
deviceTypeValue
=
null
;
const
promise
=
audioManager
.
getDevices
(
3
);
promise
.
then
(
function
(
value
)
{
const
PROMISE
=
audioManager
.
getDevices
(
3
);
PROMISE
.
then
(
function
(
value
)
{
console
.
info
(
'
AudioFrameworkTest: Promise: getDevices ALL_DEVICES_FLAG
'
);
value
.
forEach
(
displayDeviceProp
);
...
...
@@ -260,7 +247,7 @@ describe('audioEventManagement', function () {
expect
(
false
).
assertTrue
();
}
});
await
promise
;
await
PROMISE
;
done
();
})
...
...
@@ -273,8 +260,6 @@ describe('audioEventManagement', function () {
*@tc.level : Level 0
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_OUTPUT_0100
'
,
0
,
async
function
(
done
)
{
deviceRoleValue
=
null
;
deviceTypeValue
=
null
;
audioManager
.
getDevices
(
audio
.
DeviceFlag
.
OUTPUT_DEVICES_FLAG
,
(
err
,
value
)
=>
{
console
.
info
(
'
AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG
'
);
if
(
err
)
{
...
...
@@ -306,8 +291,6 @@ describe('audioEventManagement', function () {
*@tc.level : Level 2
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_OUTPUT_ENUM_0100
'
,
2
,
async
function
(
done
)
{
deviceRoleValue
=
null
;
deviceTypeValue
=
null
;
audioManager
.
getDevices
(
1
,
(
err
,
value
)
=>
{
console
.
info
(
'
AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG
'
);
if
(
err
)
{
...
...
@@ -339,8 +322,6 @@ describe('audioEventManagement', function () {
*@tc.level : Level 0
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_INPUT_0100
'
,
0
,
async
function
(
done
)
{
deviceRoleValue
=
null
;
deviceTypeValue
=
null
;
audioManager
.
getDevices
(
audio
.
DeviceFlag
.
INPUT_DEVICES_FLAG
,
(
err
,
value
)
=>
{
console
.
info
(
'
AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG
'
);
if
(
err
)
{
...
...
@@ -373,8 +354,6 @@ describe('audioEventManagement', function () {
*@tc.level : Level 0
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_INPUT_ENUM_0100
'
,
0
,
async
function
(
done
)
{
deviceRoleValue
=
null
;
deviceTypeValue
=
null
;
audioManager
.
getDevices
(
2
,
(
err
,
value
)
=>
{
console
.
info
(
'
AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG
'
);
if
(
err
)
{
...
...
@@ -407,8 +386,6 @@ describe('audioEventManagement', function () {
*@tc.level : Level 0
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_ALL_0100
'
,
0
,
async
function
(
done
)
{
deviceRoleValue
=
null
;
deviceTypeValue
=
null
;
audioManager
.
getDevices
(
audio
.
DeviceFlag
.
ALL_DEVICES_FLAG
,
(
err
,
value
)
=>
{
console
.
info
(
'
AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG
'
);
if
(
err
)
{
...
...
@@ -440,8 +417,6 @@ describe('audioEventManagement', function () {
*@tc.level : Level 2
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_ALL_ENUM_0100
'
,
2
,
async
function
(
done
)
{
deviceRoleValue
=
null
;
deviceTypeValue
=
null
;
audioManager
.
getDevices
(
3
,
(
err
,
value
)
=>
{
console
.
info
(
'
AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG
'
);
if
(
err
)
{
...
...
@@ -756,6 +731,4 @@ describe('audioEventManagement', function () {
await
sleep
(
50
);
done
();
})
})
\ No newline at end of file
multimedia/audio/audio_js_standard/AudioRendererChangeInfo/Test.json
浏览文件 @
053f448d
...
...
@@ -2,7 +2,7 @@
"description"
:
"Configuration for audio manager Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"
5
500000"
,
"test-timeout"
:
"
1
500000"
,
"package"
:
"ohos.acts.multimedia.audio.audiorendererchangeInfo"
,
"shell-timeout"
:
"60000"
},
...
...
multimedia/audio/audio_js_standard/AudioRendererChangeInfo/src/main/js/test/AudioRendererChangeInfo.test.js
浏览文件 @
053f448d
此差异已折叠。
点击以展开。
multimedia/audio/audio_js_standard/audioManager/Test.json
浏览文件 @
053f448d
...
...
@@ -2,7 +2,7 @@
"description"
:
"Configuration for audio manager Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"
5
500000"
,
"test-timeout"
:
"
1
500000"
,
"package"
:
"ohos.acts.multimedia.audio.audiomanager"
,
"shell-timeout"
:
"60000"
},
...
...
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioFramework.test.js
浏览文件 @
053f448d
此差异已折叠。
点击以展开。
multimedia/audio/audio_js_standard/audioRenderer/Test.json
浏览文件 @
053f448d
...
...
@@ -2,7 +2,7 @@
"description"
:
"Configuration for audio manager Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"
5
500000"
,
"test-timeout"
:
"
1
500000"
,
"package"
:
"ohos.acts.multimedia.audio.audiorenderer"
,
"shell-timeout"
:
"60000"
},
...
...
multimedia/audio/audio_js_standard/audioRenderer/src/main/js/test/AudioRenderer.test.js
浏览文件 @
053f448d
此差异已折叠。
点击以展开。
multimedia/audio/audio_js_standard/audioVoip/Test.json
浏览文件 @
053f448d
...
...
@@ -2,7 +2,7 @@
"description"
:
"Configuration for audio manager Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"550000
0
"
,
"test-timeout"
:
"550000"
,
"package"
:
"ohos.acts.multimedia.audio.audiovoip"
,
"shell-timeout"
:
"60000"
},
...
...
multimedia/audio/audio_js_standard/audioVoip/src/main/js/test/AudioVOIP.test.js
浏览文件 @
053f448d
...
...
@@ -22,12 +22,12 @@ import * as audioTestBase from '../../../../../AudioTestBase'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
;
describe
(
'
audioVoip
'
,
function
()
{
var
mediaDir
;
let
mediaDir
;
let
fdRead
;
let
readpath
;
let
fdPath
;
let
filePath
;
const
audioManager
=
audio
.
getAudioManager
();
const
AUDIOMANAGER
=
audio
.
getAudioManager
();
console
.
info
(
'
AudioFrameworkRenderLog: Create AudioManger Object JS Framework
'
);
beforeAll
(
async
function
()
{
...
...
@@ -99,10 +99,10 @@ describe('audioVoip', function () {
}
async
function
playbackPromise
(
AudioRendererOptions
,
pathName
)
{
var
resultFlag
=
'
new
'
;
let
resultFlag
=
'
new
'
;
console
.
info
(
'
AudioFrameworkRenderLog: Promise : Audio Playback Function
'
);
var
audioRen
;
let
audioRen
;
await
audio
.
createAudioRenderer
(
AudioRendererOptions
).
then
(
async
function
(
data
)
{
audioRen
=
data
;
console
.
info
(
'
AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS
'
);
...
...
@@ -157,7 +157,7 @@ describe('audioVoip', function () {
console
.
info
(
'
AudioFrameworkRenderLog: AudioRenderer : STATE :
'
+
audioRen
.
state
);
var
bufferSize
;
let
bufferSize
;
await
audioRen
.
getBufferSize
().
then
(
async
function
(
data
)
{
console
.
info
(
'
AudioFrameworkRenderLog: getBufferSize :SUCCESS
'
+
data
);
bufferSize
=
data
;
...
...
@@ -185,7 +185,7 @@ describe('audioVoip', function () {
console
.
info
(
'
AudioFrameworkRenderLog:BufferAudioFramework: bytes read from file:
'
+
rlen
);
await
audioRen
.
write
(
buf
);
if
(
rlen
>
(
totalSize
/
2
))
{
await
audioManager
.
getAudioScene
().
then
(
async
function
(
data
)
{
await
AUDIOMANAGER
.
getAudioScene
().
then
(
async
function
(
data
)
{
console
.
info
(
'
AudioFrameworkRenderLog:AudioFrameworkAudioScene: getAudioScene : Value :
'
+
data
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
AudioFrameworkRenderLog:AudioFrameworkAudioScene: getAudioScene : ERROR :
'
+
err
.
message
);
...
...
@@ -235,10 +235,10 @@ describe('audioVoip', function () {
async
function
recPromise
(
AudioCapturerOptions
,
fpath
)
{
var
resultFlag
=
'
new
'
;
let
resultFlag
=
'
new
'
;
console
.
info
(
'
AudioFrameworkRecLog: Promise : Audio Recording Function
'
);
var
audioCap
;
let
audioCap
;
await
audio
.
createAudioCapturer
(
AudioCapturerOptions
).
then
(
async
function
(
data
)
{
audioCap
=
data
;
...
...
@@ -305,10 +305,10 @@ describe('audioVoip', function () {
console
.
info
(
'
AudioFrameworkRecLog: AudioCapturer : STATE :
'
+
audioCap
.
state
);
var
bufferSize
=
await
audioCap
.
getBufferSize
();
let
bufferSize
=
await
audioCap
.
getBufferSize
();
console
.
info
(
'
AudioFrameworkRecLog: buffer size:
'
+
bufferSize
);
var
fd
=
fileio
.
openSync
(
fpath
,
0o102
,
0o777
);
let
fd
=
fileio
.
openSync
(
fpath
,
0o102
,
0o777
);
if
(
fd
!==
null
)
{
console
.
info
(
'
AudioFrameworkRecLog: file fd created
'
);
}
...
...
@@ -328,13 +328,13 @@ describe('audioVoip', function () {
return
resultFlag
;
}
await
sleep
(
100
);
var
numBuffersToCapture
=
45
;
let
numBuffersToCapture
=
45
;
while
(
numBuffersToCapture
)
{
console
.
info
(
'
AudioFrameworkRecLog: ---------READ BUFFER---------
'
);
var
buffer
=
await
audioCap
.
read
(
bufferSize
,
true
);
let
buffer
=
await
audioCap
.
read
(
bufferSize
,
true
);
await
sleep
(
50
);
console
.
info
(
'
AudioFrameworkRecLog: ---------WRITE BUFFER---------
'
);
var
number
=
fileio
.
writeSync
(
fd
,
buffer
);
let
number
=
fileio
.
writeSync
(
fd
,
buffer
);
console
.
info
(
'
AudioFrameworkRecLog:BufferRecLog: data written:
'
+
number
);
await
sleep
(
50
);
numBuffersToCapture
--
;
...
...
@@ -376,26 +376,26 @@ describe('audioVoip', function () {
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_VOIP_PLAY_0100
'
,
2
,
async
function
(
done
)
{
var
AudioStreamInfo
=
{
let
AudioStreamInfo
=
{
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_44100
,
channels
:
audio
.
AudioChannel
.
CHANNEL_1
,
sampleFormat
:
audio
.
AudioSampleFormat
.
SAMPLE_FORMAT_S16LE
,
encodingType
:
audio
.
AudioEncodingType
.
ENCODING_TYPE_RAW
}
var
AudioRendererInfo
=
{
let
AudioRendererInfo
=
{
content
:
audio
.
ContentType
.
CONTENT_TYPE_SPEECH
,
usage
:
audio
.
StreamUsage
.
STREAM_USAGE_VOICE_COMMUNICATION
,
rendererFlags
:
0
}
var
AudioRendererOptions
=
{
let
AudioRendererOptions
=
{
streamInfo
:
AudioStreamInfo
,
rendererInfo
:
AudioRendererInfo
}
await
getFdRead
(
"
StarWars10s-1C-44100-2SW.wav
"
);
var
resultFlag
=
await
playbackPromise
(
AudioRendererOptions
,
filePath
,
audio
.
AudioScene
.
AUDIO_SCENE_VOICE_CHAT
);
let
resultFlag
=
await
playbackPromise
(
AudioRendererOptions
,
filePath
,
audio
.
AudioScene
.
AUDIO_SCENE_VOICE_CHAT
);
await
sleep
(
100
);
console
.
info
(
'
AudioFrameworkRenderLog: resultFlag :
'
+
resultFlag
);
expect
(
resultFlag
).
assertTrue
();
...
...
@@ -413,25 +413,25 @@ describe('audioVoip', function () {
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_VOIP_REC_0100
'
,
2
,
async
function
(
done
)
{
var
AudioStreamInfo
=
{
let
AudioStreamInfo
=
{
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_44100
,
channels
:
audio
.
AudioChannel
.
CHANNEL_2
,
sampleFormat
:
audio
.
AudioSampleFormat
.
SAMPLE_FORMAT_S16LE
,
encodingType
:
audio
.
AudioEncodingType
.
ENCODING_TYPE_RAW
}
var
AudioCapturerInfo
=
{
let
AudioCapturerInfo
=
{
source
:
audio
.
SourceType
.
SOURCE_TYPE_VOICE_COMMUNICATION
,
capturerFlags
:
0
}
var
AudioCapturerOptions
=
{
let
AudioCapturerOptions
=
{
streamInfo
:
AudioStreamInfo
,
capturerInfo
:
AudioCapturerInfo
}
await
getAbilityInfo
(
"
capture_js-44100-2C-16B.pcm
"
);
var
resultFlag
=
await
recPromise
(
AudioCapturerOptions
,
mediaDir
);
let
resultFlag
=
await
recPromise
(
AudioCapturerOptions
,
mediaDir
);
await
sleep
(
100
);
console
.
info
(
'
AudioFrameworkRenderLog: resultFlag :
'
+
resultFlag
);
expect
(
resultFlag
).
assertTrue
();
...
...
@@ -448,37 +448,37 @@ describe('audioVoip', function () {
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_VOIP_RECPLAY_0100
'
,
2
,
async
function
(
done
)
{
var
AudioStreamInfoCap
=
{
let
AudioStreamInfoCap
=
{
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_44100
,
channels
:
audio
.
AudioChannel
.
CHANNEL_2
,
sampleFormat
:
audio
.
AudioSampleFormat
.
SAMPLE_FORMAT_S16LE
,
encodingType
:
audio
.
AudioEncodingType
.
ENCODING_TYPE_RAW
}
var
AudioCapturerInfo
=
{
let
AudioCapturerInfo
=
{
source
:
audio
.
SourceType
.
SOURCE_TYPE_VOICE_COMMUNICATION
,
capturerFlags
:
0
}
var
AudioCapturerOptions
=
{
let
AudioCapturerOptions
=
{
streamInfo
:
AudioStreamInfoCap
,
capturerInfo
:
AudioCapturerInfo
}
var
AudioStreamInfoRen
=
{
let
AudioStreamInfoRen
=
{
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_44100
,
channels
:
audio
.
AudioChannel
.
CHANNEL_1
,
sampleFormat
:
audio
.
AudioSampleFormat
.
SAMPLE_FORMAT_S16LE
,
encodingType
:
audio
.
AudioEncodingType
.
ENCODING_TYPE_RAW
}
var
AudioRendererInfo
=
{
let
AudioRendererInfo
=
{
content
:
audio
.
ContentType
.
CONTENT_TYPE_SPEECH
,
usage
:
audio
.
StreamUsage
.
STREAM_USAGE_VOICE_COMMUNICATION
,
rendererFlags
:
0
}
var
AudioRendererOptions
=
{
let
AudioRendererOptions
=
{
streamInfo
:
AudioStreamInfoRen
,
rendererInfo
:
AudioRendererInfo
}
...
...
@@ -489,7 +489,7 @@ describe('audioVoip', function () {
readpath
=
'
StarWars10s-1C-44100-2SW.wav
'
;
await
getFdRead
(
readpath
);
var
resultFlag
=
await
playbackPromise
(
AudioRendererOptions
,
readpath
);
let
resultFlag
=
await
playbackPromise
(
AudioRendererOptions
,
readpath
);
await
sleep
(
100
);
console
.
info
(
'
AudioFrameworkRenderLog: resultFlag :
'
+
resultFlag
);
expect
(
resultFlag
).
assertTrue
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录