Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
fed31c38
D
Docs
项目概览
OpenHarmony
/
Docs
大约 1 年 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
fed31c38
编写于
9月 15, 2022
作者:
J
jiao_yanlin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Document integrity modification
Signed-off-by:
N
jiao_yanlin
<
jiaoyanlin@huawei.com
>
上级
e0e9e632
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
11 addition
and
2 deletion
+11
-2
zh-cn/application-dev/reference/apis/js-apis-audio.md
zh-cn/application-dev/reference/apis/js-apis-audio.md
+11
-2
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-audio.md
浏览文件 @
fed31c38
...
...
@@ -1898,6 +1898,7 @@ setAudioScene\(scene: AudioScene, callback: AsyncCallback<void\>\): void
**示例:**
```
js
var
audioManager
=
audio
.
getAudioManager
();
audioManager
.
setAudioScene
(
audio
.
AudioScene
.
AUDIO_SCENE_PHONE_CALL
,
(
err
)
=>
{
if
(
err
)
{
console
.
error
(
`Failed to set the audio scene mode.
${
err
}
`
);
...
...
@@ -1932,6 +1933,7 @@ setAudioScene\(scene: AudioScene\): Promise<void\>
**示例:**
```
js
var
audioManager
=
audio
.
getAudioManager
();
audioManager
.
setAudioScene
(
audio
.
AudioScene
.
AUDIO_SCENE_PHONE_CALL
).
then
(()
=>
{
console
.
info
(
'
Promise returned to indicate a successful setting of the audio scene mode.
'
);
}).
catch
((
err
)
=>
{
...
...
@@ -1956,6 +1958,7 @@ getAudioScene\(callback: AsyncCallback<AudioScene\>\): void
**示例:**
```
js
var
audioManager
=
audio
.
getAudioManager
();
audioManager
.
getAudioScene
((
err
,
value
)
=>
{
if
(
err
)
{
console
.
error
(
`Failed to obtain the audio scene mode.
${
err
}
`
);
...
...
@@ -1983,6 +1986,7 @@ getAudioScene\(\): Promise<AudioScene\>
**示例:**
```
js
var
audioManager
=
audio
.
getAudioManager
();
audioManager
.
getAudioScene
().
then
((
value
)
=>
{
console
.
info
(
`Promise returned to indicate that the audio scene mode is obtained
${
value
}
.`
);
}).
catch
((
err
)
=>
{
...
...
@@ -2009,6 +2013,7 @@ getVolumeGroups(networkId: string, callback: AsyncCallback<VolumeGroupInfos\>\):
**示例:**
```
js
var
audioManager
=
audio
.
getAudioManager
();
audioManager
.
getVolumeGroups
(
audio
.
LOCAL_NETWORK_ID
,
(
err
,
value
)
=>
{
if
(
err
)
{
console
.
error
(
`Failed to obtain the volume group infos list.
${
err
}
`
);
...
...
@@ -2069,6 +2074,7 @@ getGroupManager(groupId: number, callback: AsyncCallback<AudioGroupManager\>\):
**示例:**
```
js
var
audioManager
=
audio
.
getAudioManager
();
async
function
getGroupManager
(){
let
value
=
await
audioManager
.
getVolumeGroups
(
audio
.
LOCAL_NETWORK_ID
);
if
(
value
.
length
>
0
)
{
...
...
@@ -2110,6 +2116,7 @@ getGroupManager(groupId: number\): Promise<AudioGroupManager\>
**示例:**
```
js
var
audioManager
=
audio
.
getAudioManager
();
async
function
getGroupManager
(){
let
value
=
await
audioManager
.
getVolumeGroups
(
audio
.
LOCAL_NETWORK_ID
);
if
(
value
.
length
>
0
)
{
...
...
@@ -2137,7 +2144,8 @@ getStreamManager(callback: AsyncCallback\<AudioStreamManager>): void
**示例:**
```
js
audio
.
getStreamManager
((
err
,
data
)
=>
{
var
audioManager
=
audio
.
getAudioManager
();
audioManager
.
getStreamManager
((
err
,
data
)
=>
{
if
(
err
)
{
console
.
error
(
`getStreamManager : Error:
${
err
}
`
);
}
else
{
...
...
@@ -2164,8 +2172,9 @@ getStreamManager(): Promise<AudioStreamManager\>
**示例:**
```
js
var
audioManager
=
audio
.
getAudioManager
();
var
audioStreamManager
;
audio
.
getStreamManager
().
then
((
data
)
=>
{
audio
Manager
.
getStreamManager
().
then
((
data
)
=>
{
audioStreamManager
=
data
;
console
.
info
(
'
getStreamManager: Success!
'
);
}).
catch
((
err
)
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录