Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
8fc35029
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看板
提交
8fc35029
编写于
10月 10, 2022
作者:
L
lwx1121892
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify
Signed-off-by:
N
lwx1121892
<
liuxueqi3@huawei.com
>
上级
28506824
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
39 addition
and
39 deletion
+39
-39
multimedia/audio/audio_js_standard/AudioCapturer/src/main/js/test/AudioCapturer.test.js
...dard/AudioCapturer/src/main/js/test/AudioCapturer.test.js
+15
-15
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioFramework.test.js
...dard/audioManager/src/main/js/test/AudioFramework.test.js
+7
-7
multimedia/audio/audio_js_standard/audioRenderer/src/main/js/test/AudioRenderer.test.js
...dard/audioRenderer/src/main/js/test/AudioRenderer.test.js
+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
+16
-16
未找到文件。
multimedia/audio/audio_js_standard/AudioCapturer/src/main/js/test/AudioCapturer.test.js
浏览文件 @
8fc35029
...
@@ -77,7 +77,7 @@ describe('audioCapturer', function () {
...
@@ -77,7 +77,7 @@ describe('audioCapturer', function () {
eventEmitter
.
on
(
CREATE_EVENT
,
(
audioCap
,
steps
,
done
)
=>
{
eventEmitter
.
on
(
CREATE_EVENT
,
(
audioCap
,
steps
,
done
)
=>
{
console
.
log
(
`
${
Tag
}
emit:
${
JSON
.
stringify
(
CREATE_EVENT
)}
`
);
console
.
log
(
`
${
Tag
}
emit:
${
JSON
.
stringify
(
CREATE_EVENT
)}
`
);
steps
.
shift
();
steps
.
shift
();
audio
.
createAudioCapturer
(
steps
[
0
],
async
(
err
,
data
)
=>
{
audio
.
createAudioCapturer
(
steps
[
0
],
(
err
,
data
)
=>
{
console
.
log
(
`
${
Tag
}
enter createAudioCapturer`
);
console
.
log
(
`
${
Tag
}
enter createAudioCapturer`
);
steps
.
shift
();
steps
.
shift
();
if
(
err
&&
steps
[
0
]
==
ERROR_EVENT
)
{
if
(
err
&&
steps
[
0
]
==
ERROR_EVENT
)
{
...
@@ -167,7 +167,7 @@ describe('audioCapturer', function () {
...
@@ -167,7 +167,7 @@ describe('audioCapturer', function () {
while
(
numBuffersToCapture
)
{
while
(
numBuffersToCapture
)
{
try
{
try
{
await
new
Promise
((
resolve
,
reject
)
=>
{
await
new
Promise
((
resolve
,
reject
)
=>
{
audioCap
.
read
(
bufferSize
,
true
,
async
(
err
,
buffer
)
=>
{
audioCap
.
read
(
bufferSize
,
true
,
(
err
,
buffer
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
info
(
`
${
Tag
}
AudioFrameworkRecLog: Capturer release :ERROR :
${
JSON
.
stringify
(
err
.
message
)}
`
);
console
.
info
(
`
${
Tag
}
AudioFrameworkRecLog: Capturer release :ERROR :
${
JSON
.
stringify
(
err
.
message
)}
`
);
reject
(
err
);
reject
(
err
);
...
@@ -436,7 +436,7 @@ describe('audioCapturer', function () {
...
@@ -436,7 +436,7 @@ describe('audioCapturer', function () {
console
.
info
(
`
${
Tag
}
AudioFrameworkTest: afterEach: Test case-level clearance conditions`
);
console
.
info
(
`
${
Tag
}
AudioFrameworkTest: afterEach: Test case-level clearance conditions`
);
})
})
afterAll
(
async
function
()
{
afterAll
(
function
()
{
console
.
info
(
`
${
Tag
}
AudioFrameworkTest: afterAll: Test suite-level cleanup condition`
);
console
.
info
(
`
${
Tag
}
AudioFrameworkTest: afterAll: Test suite-level cleanup condition`
);
})
})
...
@@ -547,7 +547,7 @@ describe('audioCapturer', function () {
...
@@ -547,7 +547,7 @@ describe('audioCapturer', function () {
*@tc.type : Function
*@tc.type : Function
*@tc.level : Level 1
*@tc.level : Level 1
*/
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_PREPARED_STATE_0100
'
,
1
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_PREPARED_STATE_0100
'
,
1
,
function
(
done
)
{
let
AudioStreamInfo
=
{
let
AudioStreamInfo
=
{
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_44100
,
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_44100
,
channels
:
audio
.
AudioChannel
.
CHANNEL_2
,
channels
:
audio
.
AudioChannel
.
CHANNEL_2
,
...
@@ -577,7 +577,7 @@ describe('audioCapturer', function () {
...
@@ -577,7 +577,7 @@ describe('audioCapturer', function () {
*@tc.type : Function
*@tc.type : Function
*@tc.level : Level 1
*@tc.level : Level 1
*/
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_RUNNING_STATE_0100
'
,
1
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_RUNNING_STATE_0100
'
,
1
,
function
(
done
)
{
let
AudioStreamInfo
=
{
let
AudioStreamInfo
=
{
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_44100
,
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_44100
,
channels
:
audio
.
AudioChannel
.
CHANNEL_2
,
channels
:
audio
.
AudioChannel
.
CHANNEL_2
,
...
@@ -606,7 +606,7 @@ describe('audioCapturer', function () {
...
@@ -606,7 +606,7 @@ describe('audioCapturer', function () {
*@tc.type : Function
*@tc.type : Function
*@tc.level : Level 1
*@tc.level : Level 1
*/
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_STOPPED_STATE_0100
'
,
1
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_STOPPED_STATE_0100
'
,
1
,
function
(
done
)
{
let
AudioStreamInfo
=
{
let
AudioStreamInfo
=
{
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_44100
,
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_44100
,
channels
:
audio
.
AudioChannel
.
CHANNEL_2
,
channels
:
audio
.
AudioChannel
.
CHANNEL_2
,
...
@@ -635,7 +635,7 @@ describe('audioCapturer', function () {
...
@@ -635,7 +635,7 @@ describe('audioCapturer', function () {
*@tc.type : Function
*@tc.type : Function
*@tc.level : Level 1
*@tc.level : Level 1
*/
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_GET_BUFFER_SIZE_0100
'
,
1
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_GET_BUFFER_SIZE_0100
'
,
1
,
function
(
done
)
{
let
AudioStreamInfo
=
{
let
AudioStreamInfo
=
{
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_44100
,
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_44100
,
channels
:
audio
.
AudioChannel
.
CHANNEL_2
,
channels
:
audio
.
AudioChannel
.
CHANNEL_2
,
...
@@ -710,7 +710,7 @@ describe('audioCapturer', function () {
...
@@ -710,7 +710,7 @@ describe('audioCapturer', function () {
capturerInfo
:
AudioCapturerInfo
capturerInfo
:
AudioCapturerInfo
}
}
let
audioCapPromise
;
let
audioCapPromise
;
await
audio
.
createAudioCapturer
(
AudioCapturerOptions
).
then
(
async
function
(
data
)
{
await
audio
.
createAudioCapturer
(
AudioCapturerOptions
).
then
(
function
(
data
)
{
audioCapPromise
=
data
;
audioCapPromise
=
data
;
console
.
info
(
`
${
Tag
}
AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: success`
);
console
.
info
(
`
${
Tag
}
AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: success`
);
expect
(
audioCapPromise
.
state
).
assertEqual
(
audio
.
AudioState
.
STATE_PREPARED
);
expect
(
audioCapPromise
.
state
).
assertEqual
(
audio
.
AudioState
.
STATE_PREPARED
);
...
@@ -2077,7 +2077,7 @@ describe('audioCapturer', function () {
...
@@ -2077,7 +2077,7 @@ describe('audioCapturer', function () {
console
.
log
(
`
${
Tag
}
stop ok`
);
console
.
log
(
`
${
Tag
}
stop ok`
);
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
log
(
`
${
Tag
}
stop err:
${
JSON
.
stringify
(
err
)}
`
);
console
.
log
(
`
${
Tag
}
stop err:
${
JSON
.
stringify
(
err
)}
`
);
expect
(
err
.
code
).
assertEqual
(
200
);
expect
(
false
).
assertTrue
(
);
}
}
done
();
done
();
})
})
...
@@ -2410,7 +2410,7 @@ describe('audioCapturer', function () {
...
@@ -2410,7 +2410,7 @@ describe('audioCapturer', function () {
streamInfo
:
audioStreamInfo44100
,
streamInfo
:
audioStreamInfo44100
,
capturerInfo
:
audioCapturerInfo44100
,
capturerInfo
:
audioCapturerInfo44100
,
}
}
await
audio
.
createAudioCapturer
(
AudioCapturerOptionsInvalid
).
then
(
async
function
(
data
)
{
await
audio
.
createAudioCapturer
(
AudioCapturerOptionsInvalid
).
then
(
function
(
data
)
{
if
(
data
==
undefined
)
{
if
(
data
==
undefined
)
{
console
.
info
(
`
${
Tag
}
AudioFrameworkRecLog: AudioCapturer Created : Unsuccess :
${
JSON
.
stringify
(
data
)}
`
);
console
.
info
(
`
${
Tag
}
AudioFrameworkRecLog: AudioCapturer Created : Unsuccess :
${
JSON
.
stringify
(
data
)}
`
);
expect
(
true
).
assertTrue
();
expect
(
true
).
assertTrue
();
...
@@ -2449,7 +2449,7 @@ describe('audioCapturer', function () {
...
@@ -2449,7 +2449,7 @@ describe('audioCapturer', function () {
capturerInfo
:
audioCapturerInfo44100
,
capturerInfo
:
audioCapturerInfo44100
,
}
}
await
audio
.
createAudioCapturer
(
AudioCapturerOptionsInvalid
).
then
(
async
function
(
data
)
{
await
audio
.
createAudioCapturer
(
AudioCapturerOptionsInvalid
).
then
(
function
(
data
)
{
if
(
data
==
undefined
)
{
if
(
data
==
undefined
)
{
console
.
info
(
`
${
Tag
}
AudioFrameworkRecLog: AudioCapturer Created : Unsuccess :
${
JSON
.
stringify
(
data
)}
`
);
console
.
info
(
`
${
Tag
}
AudioFrameworkRecLog: AudioCapturer Created : Unsuccess :
${
JSON
.
stringify
(
data
)}
`
);
expect
(
true
).
assertTrue
();
expect
(
true
).
assertTrue
();
...
@@ -2473,7 +2473,7 @@ describe('audioCapturer', function () {
...
@@ -2473,7 +2473,7 @@ describe('audioCapturer', function () {
*@tc.type : Function
*@tc.type : Function
*@tc.level : Level 2
*@tc.level : Level 2
*/
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_ON_0100
'
,
2
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_ON_0100
'
,
2
,
function
(
done
)
{
let
AudioStreamInfo
=
{
let
AudioStreamInfo
=
{
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_44100
,
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_44100
,
channels
:
audio
.
AudioChannel
.
CHANNEL_2
,
channels
:
audio
.
AudioChannel
.
CHANNEL_2
,
...
@@ -2502,7 +2502,7 @@ describe('audioCapturer', function () {
...
@@ -2502,7 +2502,7 @@ describe('audioCapturer', function () {
*@tc.type : Function
*@tc.type : Function
*@tc.level : Level 2
*@tc.level : Level 2
*/
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_ON_0200
'
,
2
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_ON_0200
'
,
2
,
function
(
done
)
{
let
AudioStreamInfo
=
{
let
AudioStreamInfo
=
{
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_44100
,
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_44100
,
channels
:
audio
.
AudioChannel
.
CHANNEL_2
,
channels
:
audio
.
AudioChannel
.
CHANNEL_2
,
...
@@ -2531,7 +2531,7 @@ describe('audioCapturer', function () {
...
@@ -2531,7 +2531,7 @@ describe('audioCapturer', function () {
*@tc.type : Function
*@tc.type : Function
*@tc.level : Level 2
*@tc.level : Level 2
*/
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_ON_0300
'
,
2
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_ON_0300
'
,
2
,
function
(
done
)
{
let
AudioStreamInfo
=
{
let
AudioStreamInfo
=
{
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_44100
,
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_44100
,
channels
:
audio
.
AudioChannel
.
CHANNEL_2
,
channels
:
audio
.
AudioChannel
.
CHANNEL_2
,
...
@@ -2560,7 +2560,7 @@ describe('audioCapturer', function () {
...
@@ -2560,7 +2560,7 @@ describe('audioCapturer', function () {
*@tc.type : Function
*@tc.type : Function
*@tc.level : Level 2
*@tc.level : Level 2
*/
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_ON_0400
'
,
2
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_ON_0400
'
,
2
,
function
(
done
)
{
let
AudioStreamInfo
=
{
let
AudioStreamInfo
=
{
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_44100
,
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_44100
,
channels
:
audio
.
AudioChannel
.
CHANNEL_2
,
channels
:
audio
.
AudioChannel
.
CHANNEL_2
,
...
...
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioFramework.test.js
浏览文件 @
8fc35029
...
@@ -2906,20 +2906,20 @@ describe('audioFramework', function () {
...
@@ -2906,20 +2906,20 @@ describe('audioFramework', function () {
*/
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_MANAGER_MUTE_1400
'
,
2
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AUDIO_MANAGER_MUTE_1400
'
,
2
,
async
function
(
done
)
{
await
audioManager
.
setVolume
(
audioMedia
,
lowVol
);
await
audioManager
.
setVolume
(
audioMedia
,
lowVol
);
audioManager
.
mute
(
audioMedia
,
true
,
async
(
err
)
=>
{
audioManager
.
mute
(
audioMedia
,
true
,
(
err
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`
${
TagFrmwk
}
: Callback : SetVolume: Media : failed to set Mute Status
${
err
.
message
}
`
);
console
.
error
(
`
${
TagFrmwk
}
: Callback : SetVolume: Media : failed to set Mute Status
${
err
.
message
}
`
);
expect
().
assertFail
();
expect
().
assertFail
();
done
();
done
();
}
else
{
}
else
{
console
.
log
(
`
${
TagFrmwk
}
: Set Stream Mute: Media: Callback : TRUE`
);
console
.
log
(
`
${
TagFrmwk
}
: Set Stream Mute: Media: Callback : TRUE`
);
audioManager
.
getVolume
(
audioMedia
,
async
(
err
,
value
)
=>
{
audioManager
.
getVolume
(
audioMedia
,
(
err
,
value
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Failed to obtain the volume.
${
err
.
message
}
`
);
console
.
error
(
`Failed to obtain the volume.
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
done
();
done
();
}
else
if
(
value
==
0
)
{
}
else
if
(
value
==
0
)
{
a
wait
a
udioManager
.
setVolume
(
audioMedia
,
highVol
,
(
err
)
=>
{
audioManager
.
setVolume
(
audioMedia
,
highVol
,
(
err
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Failed to obtain the volume.
${
err
.
message
}
`
);
console
.
error
(
`Failed to obtain the volume.
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
...
@@ -2996,7 +2996,7 @@ describe('audioFramework', function () {
...
@@ -2996,7 +2996,7 @@ describe('audioFramework', function () {
*/
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_MANAGER_MUTE_1600
'
,
2
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AUDIO_MANAGER_MUTE_1600
'
,
2
,
async
function
(
done
)
{
await
audioManager
.
setVolume
(
audioRingtone
,
highVol
);
await
audioManager
.
setVolume
(
audioRingtone
,
highVol
);
audioManager
.
mute
(
audioRingtone
,
true
,
async
(
err
)
=>
{
audioManager
.
mute
(
audioRingtone
,
true
,
(
err
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`
${
TagFrmwk
}
: Callback : SetVolume: Ringtone : failed to set Mute Status
${
err
.
message
}
`
);
console
.
error
(
`
${
TagFrmwk
}
: Callback : SetVolume: Ringtone : failed to set Mute Status
${
err
.
message
}
`
);
expect
().
assertFail
();
expect
().
assertFail
();
...
@@ -3082,7 +3082,7 @@ describe('audioFramework', function () {
...
@@ -3082,7 +3082,7 @@ describe('audioFramework', function () {
done
();
done
();
return
;
return
;
}
}
audioManager
.
mute
(
audio
.
AudioVolumeType
.
VOICE_CALL
,
true
,
async
(
err
)
=>
{
audioManager
.
mute
(
audio
.
AudioVolumeType
.
VOICE_CALL
,
true
,
(
err
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`
${
TagFrmwk
}
: Callback : SetVolume: VOICE_CALL : failed to set Mute Status
${
err
.
message
}
`
);
console
.
error
(
`
${
TagFrmwk
}
: Callback : SetVolume: VOICE_CALL : failed to set Mute Status
${
err
.
message
}
`
);
expect
().
assertFail
();
expect
().
assertFail
();
...
@@ -5119,7 +5119,7 @@ describe('audioFramework', function () {
...
@@ -5119,7 +5119,7 @@ describe('audioFramework', function () {
*@tc.type : Function
*@tc.type : Function
*@tc.level : Level 2
*@tc.level : Level 2
*/
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0800
'
,
2
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0800
'
,
2
,
function
(
done
)
{
audioManager
.
getRoutingManager
(
async
(
err
,
AudioRoutingManager
)
=>
{
audioManager
.
getRoutingManager
(
async
(
err
,
AudioRoutingManager
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`
${
TagFrmwk
}
: Callback: failed to get RoutingManager
${
err
.
message
}
`
);
console
.
error
(
`
${
TagFrmwk
}
: Callback: failed to get RoutingManager
${
err
.
message
}
`
);
...
@@ -5150,7 +5150,7 @@ describe('audioFramework', function () {
...
@@ -5150,7 +5150,7 @@ describe('audioFramework', function () {
*@tc.type : Function
*@tc.type : Function
*@tc.level : Level 2
*@tc.level : Level 2
*/
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0900
'
,
2
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0900
'
,
2
,
function
(
done
)
{
audioManager
.
getRoutingManager
(
async
(
err
,
AudioRoutingManager
)
=>
{
audioManager
.
getRoutingManager
(
async
(
err
,
AudioRoutingManager
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`
${
TagFrmwk
}
:Callback:failed to get RoutingManager
${
err
.
message
}
`
);
console
.
error
(
`
${
TagFrmwk
}
:Callback:failed to get RoutingManager
${
err
.
message
}
`
);
...
...
multimedia/audio/audio_js_standard/audioRenderer/src/main/js/test/AudioRenderer.test.js
浏览文件 @
8fc35029
...
@@ -1068,7 +1068,7 @@ describe('audioRenderer', function () {
...
@@ -1068,7 +1068,7 @@ describe('audioRenderer', function () {
resultFlag
=
true
;
resultFlag
=
true
;
audioRen
.
on
(
'
periodReach
'
,
73
,
(
position
)
=>
{
audioRen
.
on
(
'
periodReach
'
,
73
,
(
position
)
=>
{
console
.
log
(
`
${
TagFrmwk
}
: periodReach Event is called :
${
position
}
`
);
console
.
log
(
`
${
TagFrmwk
}
: periodReach Event is called :
${
position
}
`
);
resultFlag
=
fals
e
;
resultFlag
=
tru
e
;
});
});
});
});
...
...
multimedia/audio/audio_js_standard/audioVoip/src/main/js/test/AudioVOIP.test.js
浏览文件 @
8fc35029
...
@@ -51,7 +51,7 @@ describe('audioVoip', function () {
...
@@ -51,7 +51,7 @@ describe('audioVoip', function () {
console
.
info
(
`AudioFrameworkTest: afterEach: Test case-level clearance conditions`
);
console
.
info
(
`AudioFrameworkTest: afterEach: Test case-level clearance conditions`
);
})
})
afterAll
(
async
function
()
{
afterAll
(
function
()
{
console
.
info
(
`AudioFrameworkTest: afterAll: Test suite-level cleanup condition`
);
console
.
info
(
`AudioFrameworkTest: afterAll: Test suite-level cleanup condition`
);
})
})
...
@@ -111,7 +111,7 @@ describe('audioVoip', function () {
...
@@ -111,7 +111,7 @@ describe('audioVoip', function () {
console
.
info
(
`
${
TagRender
}
: Promise : Audio Playback Function`
);
console
.
info
(
`
${
TagRender
}
: Promise : Audio Playback Function`
);
let
audioRen
;
let
audioRen
;
await
audio
.
createAudioRenderer
(
AudioRendererOptions
).
then
(
async
function
(
data
)
{
await
audio
.
createAudioRenderer
(
AudioRendererOptions
).
then
(
(
data
)
=>
{
audioRen
=
data
;
audioRen
=
data
;
console
.
info
(
`
${
TagRender
}
: AudioRender Created : Success : Stream Type: SUCCESS`
);
console
.
info
(
`
${
TagRender
}
: AudioRender Created : Success : Stream Type: SUCCESS`
);
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
...
@@ -123,7 +123,7 @@ describe('audioVoip', function () {
...
@@ -123,7 +123,7 @@ describe('audioVoip', function () {
console
.
info
(
`
${
TagRender
}
: AudioRenderer : STATE :
${
audioRen
.
state
}
`
);
console
.
info
(
`
${
TagRender
}
: AudioRenderer : STATE :
${
audioRen
.
state
}
`
);
await
audioRen
.
getStreamInfo
().
then
(
async
function
(
audioParamsGet
)
{
await
audioRen
.
getStreamInfo
().
then
(
(
audioParamsGet
)
=>
{
console
.
info
(
`
${
TagRender
}
: Renderer getStreamInfo:`
);
console
.
info
(
`
${
TagRender
}
: Renderer getStreamInfo:`
);
console
.
info
(
`
${
TagRender
}
: Renderer sampleFormat:
${
audioParamsGet
.
sampleFormat
}
`
);
console
.
info
(
`
${
TagRender
}
: Renderer sampleFormat:
${
audioParamsGet
.
sampleFormat
}
`
);
console
.
info
(
`
${
TagRender
}
: Renderer samplingRate:
${
audioParamsGet
.
samplingRate
}
`
);
console
.
info
(
`
${
TagRender
}
: Renderer samplingRate:
${
audioParamsGet
.
samplingRate
}
`
);
...
@@ -138,7 +138,7 @@ describe('audioVoip', function () {
...
@@ -138,7 +138,7 @@ describe('audioVoip', function () {
return
resultFlag
;
return
resultFlag
;
}
}
await
audioRen
.
getRendererInfo
().
then
(
async
function
(
audioParamsGet
)
{
await
audioRen
.
getRendererInfo
().
then
(
(
audioParamsGet
)
=>
{
console
.
info
(
`
${
TagRender
}
: Renderer RendererInfo:`
);
console
.
info
(
`
${
TagRender
}
: Renderer RendererInfo:`
);
console
.
info
(
`
${
TagRender
}
: Renderer content type:
${
audioParamsGet
.
content
}
`
);
console
.
info
(
`
${
TagRender
}
: Renderer content type:
${
audioParamsGet
.
content
}
`
);
console
.
info
(
`
${
TagRender
}
: Renderer usage:
${
audioParamsGet
.
usage
}
`
);
console
.
info
(
`
${
TagRender
}
: Renderer usage:
${
audioParamsGet
.
usage
}
`
);
...
@@ -152,7 +152,7 @@ describe('audioVoip', function () {
...
@@ -152,7 +152,7 @@ describe('audioVoip', function () {
return
resultFlag
;
return
resultFlag
;
}
}
await
audioRen
.
start
().
then
(
async
function
()
{
await
audioRen
.
start
().
then
(
()
=>
{
console
.
info
(
`
${
TagRender
}
: renderInstant started :SUCCESS `
);
console
.
info
(
`
${
TagRender
}
: renderInstant started :SUCCESS `
);
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TagRender
}
: renderInstant start :ERROR :
${
err
.
message
}
`
);
console
.
info
(
`
${
TagRender
}
: renderInstant start :ERROR :
${
err
.
message
}
`
);
...
@@ -166,7 +166,7 @@ describe('audioVoip', function () {
...
@@ -166,7 +166,7 @@ describe('audioVoip', function () {
console
.
info
(
`
${
TagRender
}
: AudioRenderer : STATE :
${
audioRen
.
state
}
`
);
console
.
info
(
`
${
TagRender
}
: AudioRenderer : STATE :
${
audioRen
.
state
}
`
);
let
bufferSize
;
let
bufferSize
;
await
audioRen
.
getBufferSize
().
then
(
async
function
(
data
)
{
await
audioRen
.
getBufferSize
().
then
(
(
data
)
=>
{
console
.
info
(
`
${
TagRender
}
: getBufferSize :SUCCESS
${
data
}
`
);
console
.
info
(
`
${
TagRender
}
: getBufferSize :SUCCESS
${
data
}
`
);
bufferSize
=
data
;
bufferSize
=
data
;
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
...
@@ -193,7 +193,7 @@ describe('audioVoip', function () {
...
@@ -193,7 +193,7 @@ describe('audioVoip', function () {
console
.
info
(
`
${
TagRender
}
: BufferAudioFramework: bytes read from file:
${
rlen
}
`
);
console
.
info
(
`
${
TagRender
}
: BufferAudioFramework: bytes read from file:
${
rlen
}
`
);
await
audioRen
.
write
(
buf
);
await
audioRen
.
write
(
buf
);
if
(
rlen
>
(
totalSize
/
2
))
{
if
(
rlen
>
(
totalSize
/
2
))
{
await
AUDIOMANAGER
.
getAudioScene
().
then
(
async
function
(
data
)
{
await
AUDIOMANAGER
.
getAudioScene
().
then
(
(
data
)
=>
{
console
.
info
(
`
${
TagRender
}
:AudioFrameworkAudioScene: getAudioScene : Value :
${
data
}
`
);
console
.
info
(
`
${
TagRender
}
:AudioFrameworkAudioScene: getAudioScene : Value :
${
data
}
`
);
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TagRender
}
:AudioFrameworkAudioScene: getAudioScene : ERROR :
${
err
.
message
}
`
);
console
.
info
(
`
${
TagRender
}
:AudioFrameworkAudioScene: getAudioScene : ERROR :
${
err
.
message
}
`
);
...
@@ -203,7 +203,7 @@ describe('audioVoip', function () {
...
@@ -203,7 +203,7 @@ describe('audioVoip', function () {
}
}
console
.
info
(
`
${
TagRender
}
: Renderer after read`
);
console
.
info
(
`
${
TagRender
}
: Renderer after read`
);
await
audioRen
.
drain
().
then
(
async
function
()
{
await
audioRen
.
drain
().
then
(
()
=>
{
console
.
info
(
`
${
TagRender
}
: Renderer drained : SUCCESS`
);
console
.
info
(
`
${
TagRender
}
: Renderer drained : SUCCESS`
);
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
error
(
`
${
TagRender
}
: Renderer drain: ERROR :
${
err
.
message
}
`
);
console
.
error
(
`
${
TagRender
}
: Renderer drain: ERROR :
${
err
.
message
}
`
);
...
@@ -216,7 +216,7 @@ describe('audioVoip', function () {
...
@@ -216,7 +216,7 @@ describe('audioVoip', function () {
console
.
info
(
`
${
TagRender
}
: AudioRenderer : STATE :
${
audioRen
.
state
}
`
);
console
.
info
(
`
${
TagRender
}
: AudioRenderer : STATE :
${
audioRen
.
state
}
`
);
await
audioRen
.
stop
().
then
(
async
function
()
{
await
audioRen
.
stop
().
then
(
()
=>
{
console
.
info
(
`
${
TagRender
}
: Renderer stopped : SUCCESS`
);
console
.
info
(
`
${
TagRender
}
: Renderer stopped : SUCCESS`
);
resultFlag
=
true
;
resultFlag
=
true
;
console
.
info
(
`
${
TagRender
}
: resultFlagRen :
${
resultFlag
}
`
);
console
.
info
(
`
${
TagRender
}
: resultFlagRen :
${
resultFlag
}
`
);
...
@@ -227,7 +227,7 @@ describe('audioVoip', function () {
...
@@ -227,7 +227,7 @@ describe('audioVoip', function () {
console
.
info
(
`
${
TagRender
}
: AudioRenderer : STATE :
${
audioRen
.
state
}
`
);
console
.
info
(
`
${
TagRender
}
: AudioRenderer : STATE :
${
audioRen
.
state
}
`
);
await
audioRen
.
release
().
then
(
async
function
()
{
await
audioRen
.
release
().
then
(
()
=>
{
console
.
info
(
`
${
TagRender
}
: Renderer release : SUCCESS`
);
console
.
info
(
`
${
TagRender
}
: Renderer release : SUCCESS`
);
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TagRender
}
: Renderer release :ERROR :
${
err
.
message
}
`
);
console
.
info
(
`
${
TagRender
}
: Renderer release :ERROR :
${
err
.
message
}
`
);
...
@@ -247,7 +247,7 @@ describe('audioVoip', function () {
...
@@ -247,7 +247,7 @@ describe('audioVoip', function () {
let
audioCap
;
let
audioCap
;
await
audio
.
createAudioCapturer
(
AudioCapturerOptions
).
then
(
async
function
(
data
)
{
await
audio
.
createAudioCapturer
(
AudioCapturerOptions
).
then
(
(
data
)
=>
{
audioCap
=
data
;
audioCap
=
data
;
console
.
info
(
`
${
TagRec
}
: AudioCapturer Created : Success : Stream Type: SUCCESS`
);
console
.
info
(
`
${
TagRec
}
: AudioCapturer Created : Success : Stream Type: SUCCESS`
);
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
...
@@ -259,7 +259,7 @@ describe('audioVoip', function () {
...
@@ -259,7 +259,7 @@ describe('audioVoip', function () {
console
.
info
(
`
${
TagRec
}
: AudioCapturer : STATE :
${
audioCap
.
state
}
`
);
console
.
info
(
`
${
TagRec
}
: AudioCapturer : STATE :
${
audioCap
.
state
}
`
);
await
audioCap
.
getStreamInfo
().
then
(
async
function
(
audioParamsGet
)
{
await
audioCap
.
getStreamInfo
().
then
(
(
audioParamsGet
)
=>
{
if
(
audioParamsGet
!=
undefined
)
{
if
(
audioParamsGet
!=
undefined
)
{
console
.
info
(
`
${
TagRec
}
: Capturer getStreamInfo:`
);
console
.
info
(
`
${
TagRec
}
: Capturer getStreamInfo:`
);
console
.
info
(
`
${
TagRec
}
: Capturer sampleFormat:
${
audioParamsGet
.
sampleFormat
}
`
);
console
.
info
(
`
${
TagRec
}
: Capturer sampleFormat:
${
audioParamsGet
.
sampleFormat
}
`
);
...
@@ -280,7 +280,7 @@ describe('audioVoip', function () {
...
@@ -280,7 +280,7 @@ describe('audioVoip', function () {
return
resultFlag
;
return
resultFlag
;
}
}
await
audioCap
.
getCapturerInfo
().
then
(
async
function
(
audioParamsGet
)
{
await
audioCap
.
getCapturerInfo
().
then
(
(
audioParamsGet
)
=>
{
if
(
audioParamsGet
!=
undefined
)
{
if
(
audioParamsGet
!=
undefined
)
{
console
.
info
(
`
${
TagRec
}
: Capturer CapturerInfo:`
);
console
.
info
(
`
${
TagRec
}
: Capturer CapturerInfo:`
);
console
.
info
(
`
${
TagRec
}
: Capturer SourceType:
${
audioParamsGet
.
source
}
`
);
console
.
info
(
`
${
TagRec
}
: Capturer SourceType:
${
audioParamsGet
.
source
}
`
);
...
@@ -299,7 +299,7 @@ describe('audioVoip', function () {
...
@@ -299,7 +299,7 @@ describe('audioVoip', function () {
return
resultFlag
;
return
resultFlag
;
}
}
await
audioCap
.
start
().
then
(
async
function
()
{
await
audioCap
.
start
().
then
(
()
=>
{
console
.
info
(
`
${
TagRec
}
: Capturer started :SUCCESS`
);
console
.
info
(
`
${
TagRec
}
: Capturer started :SUCCESS`
);
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TagRec
}
: Capturer start :ERROR :
${
err
.
message
}
`
);
console
.
info
(
`
${
TagRec
}
: Capturer start :ERROR :
${
err
.
message
}
`
);
...
@@ -349,7 +349,7 @@ describe('audioVoip', function () {
...
@@ -349,7 +349,7 @@ describe('audioVoip', function () {
await
sleep
(
1000
);
await
sleep
(
1000
);
console
.
info
(
`
${
TagRec
}
: AudioCapturer : STATE :
${
audioCap
.
state
}
`
);
console
.
info
(
`
${
TagRec
}
: AudioCapturer : STATE :
${
audioCap
.
state
}
`
);
await
audioCap
.
stop
().
then
(
async
function
()
{
await
audioCap
.
stop
().
then
(
()
=>
{
console
.
info
(
`
${
TagRec
}
: Capturer stopped : SUCCESS`
);
console
.
info
(
`
${
TagRec
}
: Capturer stopped : SUCCESS`
);
resultFlag
=
true
;
resultFlag
=
true
;
console
.
info
(
`
${
TagRec
}
: resultFlag :
${
resultFlag
}
`
);
console
.
info
(
`
${
TagRec
}
: resultFlag :
${
resultFlag
}
`
);
...
@@ -360,7 +360,7 @@ describe('audioVoip', function () {
...
@@ -360,7 +360,7 @@ describe('audioVoip', function () {
console
.
info
(
`
${
TagRec
}
: AudioCapturer : STATE :
${
audioCap
.
state
}
`
);
console
.
info
(
`
${
TagRec
}
: AudioCapturer : STATE :
${
audioCap
.
state
}
`
);
await
audioCap
.
release
().
then
(
async
function
()
{
await
audioCap
.
release
().
then
(
()
=>
{
console
.
info
(
`
${
TagRec
}
: Capturer release : SUCCESS`
);
console
.
info
(
`
${
TagRec
}
: Capturer release : SUCCESS`
);
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TagRec
}
: Capturer release :ERROR :
${
err
.
message
}
`
);
console
.
info
(
`
${
TagRec
}
: Capturer release :ERROR :
${
err
.
message
}
`
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录