Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
0245d5ae
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
12 个月 前同步成功
通知
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
0245d5ae
编写于
6月 09, 2022
作者:
O
openharmony_ci
提交者:
Gitee
6月 09, 2022
浏览文件
操作
浏览文件
下载
差异文件
!3478 修改audioRecorder 参数赋值方式,使用枚举值赋值
Merge pull request !3478 from FULIZHONG/OpenHarmony-3.1-Release
上级
e34986ef
24eaf7e0
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
28 addition
and
37 deletion
+28
-37
multimedia/media/media_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioAPI.test.js
...corder/src/main/js/test/RecorderLocalTestAudioAPI.test.js
+2
-6
multimedia/media/media_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioFUNC.test.js
...order/src/main/js/test/RecorderLocalTestAudioFUNC.test.js
+26
-31
未找到文件。
multimedia/media/media_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioAPI.test.js
浏览文件 @
0245d5ae
...
...
@@ -28,21 +28,17 @@ describe('RecorderLocalTestAudioAPI', function () {
const
RESET_STATE
=
6
;
const
RELEASE_STATE
=
7
;
const
ERROR_STATE
=
8
;
const
FORMAT_M4A
=
6
;
const
SOURCE_TYPE
=
1
;
const
ENCORDER_AACLC
=
3
;
const
CHANNEL_TWO
=
2
;
const
RECORDER_TIME
=
1000
;
let
fdPath
;
let
fileAsset
;
let
fdNumber
;
let
audioConfig
=
{
audioSourceType
:
SOURCE_TYPE
,
audioEncoder
:
ENCORDER_AACLC
,
audioEncoder
:
media
.
AudioEncoder
.
AAC_LC
,
audioEncodeBitRate
:
22050
,
audioSampleRate
:
22050
,
numberOfChannels
:
CHANNEL_TWO
,
format
:
FORMAT_M4A
,
format
:
media
.
AudioOutputFormat
.
AAC_ADTS
,
uri
:
'
file:///data/accounts/account_0/appdata/recorder/testAPI.m4a
'
,
location
:
{
latitude
:
1
,
longitude
:
1
},
}
...
...
multimedia/media/media_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioFUNC.test.js
浏览文件 @
0245d5ae
...
...
@@ -21,7 +21,6 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
describe
(
'
RecorderLocalTestAudioFUNC
'
,
function
()
{
let
audioRecorder
=
media
.
createAudioRecorder
();
const
BASIC_PATH
=
'
file:///data/accounts/account_0/appdata/recorder/
'
const
END_STATE
=
0
;
const
PRE_STATE
=
1
;
const
START_STATE
=
2
;
...
...
@@ -34,15 +33,13 @@ describe('RecorderLocalTestAudioFUNC', function () {
const
RECORDER_TIME
=
1000
;
const
CHANNEL_ONE
=
1
;
const
CHANNEL_TWO
=
2
;
const
FORMAT_MP4
=
2
;
const
FORMAT_M4A
=
6
;
const
SOURCE_TYPE
=
1
;
const
ENCORDER_AACLC
=
3
;
const
FORMAT_MP4
=
media
.
AudioOutputFormat
.
MPEG_4
;
const
FORMAT_M4A
=
media
.
AudioOutputFormat
.
AAC_ADTS
;
const
ENCORDER_AACLC
=
media
.
AudioEncoder
.
AAC_LC
;
let
fdPath
;
let
fileAsset
;
let
fdNumber
;
let
audioConfig
=
{
audioSourceType
:
SOURCE_TYPE
,
audioEncoder
:
ENCORDER_AACLC
,
audioEncodeBitRate
:
22050
,
audioSampleRate
:
22050
,
...
...
@@ -333,7 +330,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
audioConfig
.
uri
=
fdPath
;
audioConfig
.
audioSampleRate
=
32000
;
// samplerate 32000
audioConfig
.
numberOfChannels
=
CHANNEL_ONE
;
audioConfig
.
f
ileF
ormat
=
FORMAT_MP4
;
audioConfig
.
format
=
FORMAT_MP4
;
initAudioRecorder
();
let
mySteps
=
new
Array
(
PRE_STATE
,
START_STATE
,
STOP_STATE
,
RELEASE_STATE
,
END_STATE
);
setCallback
(
mySteps
,
done
);
...
...
@@ -353,7 +350,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
audioConfig
.
uri
=
fdPath
;
audioConfig
.
audioSampleRate
=
44100
;
// samplerate 44100
audioConfig
.
numberOfChannels
=
CHANNEL_TWO
;
audioConfig
.
f
ileF
ormat
=
FORMAT_MP4
;
audioConfig
.
format
=
FORMAT_MP4
;
initAudioRecorder
();
let
mySteps
=
new
Array
(
PRE_STATE
,
START_STATE
,
STOP_STATE
,
RELEASE_STATE
,
END_STATE
);
setCallback
(
mySteps
,
done
);
...
...
@@ -373,7 +370,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
audioConfig
.
uri
=
fdPath
;
audioConfig
.
audioSampleRate
=
64000
;
// samplerate 64000
audioConfig
.
numberOfChannels
=
CHANNEL_ONE
;
audioConfig
.
f
ileF
ormat
=
FORMAT_M4A
;
audioConfig
.
format
=
FORMAT_M4A
;
initAudioRecorder
();
let
mySteps
=
new
Array
(
PRE_STATE
,
START_STATE
,
STOP_STATE
,
RELEASE_STATE
,
END_STATE
);
setCallback
(
mySteps
,
done
);
...
...
@@ -393,7 +390,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
audioConfig
.
uri
=
fdPath
;
audioConfig
.
audioSampleRate
=
96000
;
// samplerate 96000
audioConfig
.
numberOfChannels
=
CHANNEL_TWO
;
audioConfig
.
f
ileF
ormat
=
FORMAT_M4A
;
audioConfig
.
format
=
FORMAT_M4A
;
initAudioRecorder
();
let
mySteps
=
new
Array
(
PRE_STATE
,
START_STATE
,
STOP_STATE
,
RELEASE_STATE
,
END_STATE
);
setCallback
(
mySteps
,
done
);
...
...
@@ -414,7 +411,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
audioConfig
.
audioSampleRate
=
22050
;
// samplerate 22050
audioConfig
.
audioEncodeBitRate
=
8000
;
// encodeBitrate 8000
audioConfig
.
numberOfChannels
=
CHANNEL_TWO
;
audioConfig
.
f
ileF
ormat
=
FORMAT_MP4
;
audioConfig
.
format
=
FORMAT_MP4
;
initAudioRecorder
();
let
mySteps
=
new
Array
(
PRE_STATE
,
START_STATE
,
STOP_STATE
,
RELEASE_STATE
,
END_STATE
);
setCallback
(
mySteps
,
done
);
...
...
@@ -435,7 +432,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
audioConfig
.
audioSampleRate
=
44100
;
// samplerate 44100
audioConfig
.
audioEncodeBitRate
=
16000
;
// encodeBitrate 16000
audioConfig
.
numberOfChannels
=
CHANNEL_ONE
;
audioConfig
.
f
ileF
ormat
=
FORMAT_MP4
;
audioConfig
.
format
=
FORMAT_MP4
;
initAudioRecorder
();
let
mySteps
=
new
Array
(
PRE_STATE
,
START_STATE
,
STOP_STATE
,
RELEASE_STATE
,
END_STATE
);
setCallback
(
mySteps
,
done
);
...
...
@@ -456,7 +453,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
audioConfig
.
audioSampleRate
=
44100
;
// samplerate 44100
audioConfig
.
audioEncodeBitRate
=
32000
;
// encodeBitrate 32000
audioConfig
.
numberOfChannels
=
CHANNEL_ONE
;
audioConfig
.
f
ileF
ormat
=
FORMAT_M4A
;
audioConfig
.
format
=
FORMAT_M4A
;
initAudioRecorder
();
let
mySteps
=
new
Array
(
PRE_STATE
,
START_STATE
,
STOP_STATE
,
RELEASE_STATE
,
END_STATE
);
setCallback
(
mySteps
,
done
);
...
...
@@ -477,7 +474,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
audioConfig
.
audioSampleRate
=
44100
;
// samplerate 44100
audioConfig
.
audioEncodeBitRate
=
64000
;
// encodeBitrate 64000
audioConfig
.
numberOfChannels
=
CHANNEL_TWO
;
audioConfig
.
f
ileF
ormat
=
FORMAT_M4A
;
audioConfig
.
format
=
FORMAT_M4A
;
initAudioRecorder
();
let
mySteps
=
new
Array
(
PRE_STATE
,
START_STATE
,
STOP_STATE
,
RELEASE_STATE
,
END_STATE
);
setCallback
(
mySteps
,
done
);
...
...
@@ -498,7 +495,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
audioConfig
.
audioSampleRate
=
44100
;
// samplerate 44100
audioConfig
.
audioEncodeBitRate
=
112000
;
// encodeBitrate 112000
audioConfig
.
numberOfChannels
=
CHANNEL_TWO
;
audioConfig
.
f
ileF
ormat
=
FORMAT_M4A
;
audioConfig
.
format
=
FORMAT_M4A
;
initAudioRecorder
();
let
mySteps
=
new
Array
(
PRE_STATE
,
START_STATE
,
STOP_STATE
,
RELEASE_STATE
,
END_STATE
);
setCallback
(
mySteps
,
done
);
...
...
@@ -518,7 +515,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
audioConfig
.
uri
=
fdPath
;
audioConfig
.
audioEncodeBitRate
=
22050
;
// samplerate 22050
audioConfig
.
audioSampleRate
=
22050
;
// encodeBitrate 22050
audioConfig
.
f
ileF
ormat
=
FORMAT_MP4
;
audioConfig
.
format
=
FORMAT_MP4
;
audioConfig
.
numberOfChannels
=
CHANNEL_TWO
;
initAudioRecorder
();
let
mySteps
=
new
Array
(
PRE_STATE
,
START_STATE
,
STOP_STATE
,
RELEASE_STATE
,
END_STATE
);
...
...
@@ -539,7 +536,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
audioConfig
.
uri
=
fdPath
;
audioConfig
.
audioEncodeBitRate
=
22050
;
// samplerate 22050
audioConfig
.
audioSampleRate
=
22050
;
// encodeBitrate 22050
audioConfig
.
f
ileF
ormat
=
FORMAT_M4A
;
audioConfig
.
format
=
FORMAT_M4A
;
audioConfig
.
numberOfChannels
=
CHANNEL_TWO
;
initAudioRecorder
();
let
mySteps
=
new
Array
(
PRE_STATE
,
START_STATE
,
STOP_STATE
,
RELEASE_STATE
,
END_STATE
);
...
...
@@ -558,7 +555,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
it
(
'
SUB_MEDIA_RECORDER_AUDIO_FUNCTION_06_0100
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test16.m4a
'
);
audioConfig
.
uri
=
fdPath
;
audioConfig
.
f
ileF
ormat
=
FORMAT_M4A
;
audioConfig
.
format
=
FORMAT_M4A
;
initAudioRecorder
();
let
mySteps
=
new
Array
(
PRE_STATE
,
START_STATE
,
STOP_STATE
,
RELEASE_STATE
,
END_STATE
);
setCallback
(
mySteps
,
done
);
...
...
@@ -576,7 +573,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
it
(
'
SUB_MEDIA_RECORDER_AUDIO_FUNCTION_06_0200
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test17.m4a
'
);
audioConfig
.
uri
=
fdPath
;
audioConfig
.
f
ileF
ormat
=
FORMAT_M4A
;
audioConfig
.
format
=
FORMAT_M4A
;
initAudioRecorder
();
let
mySteps
=
new
Array
(
PRE_STATE
,
START_STATE
,
PAUSE_STATE
,
STOP_STATE
,
RELEASE_STATE
,
END_STATE
);
setCallback
(
mySteps
,
done
);
...
...
@@ -594,7 +591,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
it
(
'
SUB_MEDIA_RECORDER_AUDIO_FUNCTION_06_0300
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test18.m4a
'
);
audioConfig
.
uri
=
fdPath
;
audioConfig
.
f
ileF
ormat
=
FORMAT_M4A
;
audioConfig
.
format
=
FORMAT_M4A
;
initAudioRecorder
();
let
mySteps
=
new
Array
(
PRE_STATE
,
START_STATE
,
PAUSE_STATE
,
RESUME_STATE
,
STOP_STATE
,
RELEASE_STATE
,
END_STATE
);
...
...
@@ -613,7 +610,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
it
(
'
SUB_MEDIA_RECORDER_AUDIO_FUNCTION_06_0500
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test19.m4a
'
);
audioConfig
.
uri
=
fdPath
;
audioConfig
.
f
ileF
ormat
=
FORMAT_M4A
;
audioConfig
.
format
=
FORMAT_M4A
;
initAudioRecorder
();
let
mySteps
=
new
Array
(
PRE_STATE
,
START_STATE
,
RESET_STATE
,
RELEASE_STATE
,
END_STATE
);
setCallback
(
mySteps
,
done
);
...
...
@@ -631,7 +628,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
it
(
'
SUB_MEDIA_RECORDER_AUDIO_FUNCTION_06_0600
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test20.m4a
'
);
audioConfig
.
uri
=
fdPath
;
audioConfig
.
f
ileF
ormat
=
FORMAT_M4A
;
audioConfig
.
format
=
FORMAT_M4A
;
initAudioRecorder
();
let
mySteps
=
new
Array
(
PRE_STATE
,
START_STATE
,
PAUSE_STATE
,
RESUME_STATE
,
PAUSE_STATE
,
STOP_STATE
,
RELEASE_STATE
,
END_STATE
);
...
...
@@ -650,7 +647,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
it
(
'
SUB_MEDIA_RECORDER_AUDIO_FUNCTION_06_0700
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test21.m4a
'
);
audioConfig
.
uri
=
fdPath
;
audioConfig
.
f
ileF
ormat
=
FORMAT_M4A
;
audioConfig
.
format
=
FORMAT_M4A
;
initAudioRecorder
();
let
mySteps
=
new
Array
(
PRE_STATE
,
START_STATE
,
PAUSE_STATE
,
STOP_STATE
,
RESET_STATE
,
RELEASE_STATE
,
END_STATE
);
...
...
@@ -669,7 +666,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
it
(
'
SUB_MEDIA_RECORDER_AUDIO_FUNCTION_06_0800
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test22.m4a
'
);
audioConfig
.
uri
=
fdPath
;
audioConfig
.
f
ileF
ormat
=
FORMAT_M4A
;
audioConfig
.
format
=
FORMAT_M4A
;
initAudioRecorder
();
let
mySteps
=
new
Array
(
PRE_STATE
,
START_STATE
,
PAUSE_STATE
,
RESUME_STATE
,
STOP_STATE
,
RESET_STATE
,
RELEASE_STATE
,
END_STATE
);
...
...
@@ -688,7 +685,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
it
(
'
SUB_MEDIA_RECORDER_AUDIO_FUNCTION_06_0900
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test23.m4a
'
);
audioConfig
.
uri
=
fdPath
;
audioConfig
.
f
ileF
ormat
=
FORMAT_M4A
;
audioConfig
.
format
=
FORMAT_M4A
;
initAudioRecorder
();
let
mySteps
=
new
Array
(
PRE_STATE
,
START_STATE
,
RESET_STATE
,
PRE_STATE
,
START_STATE
,
PAUSE_STATE
,
RESUME_STATE
,
STOP_STATE
,
RESET_STATE
,
RELEASE_STATE
,
END_STATE
);
...
...
@@ -707,7 +704,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
it
(
'
SUB_MEDIA_RECORDER_AUDIO_FUNCTION_06_1000
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test24.m4a
'
);
audioConfig
.
uri
=
fdPath
;
audioConfig
.
f
ileF
ormat
=
FORMAT_M4A
;
audioConfig
.
format
=
FORMAT_M4A
;
initAudioRecorder
();
let
mySteps
=
new
Array
(
PRE_STATE
,
START_STATE
,
RESET_STATE
,
PRE_STATE
,
START_STATE
,
PAUSE_STATE
,
STOP_STATE
,
RESET_STATE
,
RELEASE_STATE
,
END_STATE
);
...
...
@@ -726,7 +723,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
it
(
'
SUB_MEDIA_RECORDER_AUDIO_FUNCTION_06_1100
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test25.mp4
'
);
audioConfig
.
uri
=
fdPath
;
audioConfig
.
f
ileF
ormat
=
FORMAT_MP4
;
audioConfig
.
format
=
FORMAT_MP4
;
initAudioRecorder
();
let
mySteps
=
new
Array
(
PRE_STATE
,
START_STATE
,
RESET_STATE
,
PRE_STATE
,
START_STATE
,
STOP_STATE
,
RELEASE_STATE
,
END_STATE
);
...
...
@@ -745,7 +742,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
it
(
'
SUB_MEDIA_RECORDER_AUDIO_FUNCTION_06_1200
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test26.mp4
'
);
audioConfig
.
uri
=
fdPath
;
audioConfig
.
f
ileF
ormat
=
FORMAT_MP4
;
audioConfig
.
format
=
FORMAT_MP4
;
initAudioRecorder
();
let
mySteps
=
new
Array
(
PRE_STATE
,
START_STATE
,
PAUSE_STATE
,
START_STATE
,
ERROR_STATE
,
STOP_STATE
,
RELEASE_STATE
,
END_STATE
);
...
...
@@ -764,7 +761,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
it
(
'
SUB_MEDIA_RECORDER_AUDIO_FUNCTION_06_1300
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test27.mp4
'
);
audioConfig
.
uri
=
fdPath
;
audioConfig
.
f
ileF
ormat
=
FORMAT_MP4
;
audioConfig
.
format
=
FORMAT_MP4
;
initAudioRecorder
();
let
mySteps
=
new
Array
(
PRE_STATE
,
START_STATE
,
STOP_STATE
,
PAUSE_STATE
,
ERROR_STATE
,
RELEASE_STATE
,
END_STATE
);
...
...
@@ -784,7 +781,6 @@ describe('RecorderLocalTestAudioFUNC', function () {
it
(
'
SUB_MEDIA_RECORDER_AUDIO_FUNCTION_06_1400
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test28.mp4
'
);
let
newAudioConfig
=
{
audioSourceType
:
SOURCE_TYPE
,
audioEncodeBitRate
:
22050
,
audioSampleRate
:
22050
,
numberOfChannels
:
CHANNEL_TWO
,
...
...
@@ -812,7 +808,6 @@ describe('RecorderLocalTestAudioFUNC', function () {
it
(
'
SUB_MEDIA_RECORDER_AUDIO_FUNCTION_06_1500
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test29.mp4
'
);
let
newAudioConfig
=
{
audioSourceType
:
SOURCE_TYPE
,
audioEncodeBitRate
:
22050
,
audioSampleRate
:
22050
,
numberOfChannels
:
CHANNEL_TWO
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录