提交 2818adec 编写于 作者: J jiao_yanlin

Sample code and interface consistency check

Signed-off-by: Njiao_yanlin <jiaoyanlin@huawei.com>
上级 405fc817
...@@ -2445,10 +2445,10 @@ selectInputDevice(inputAudioDevices: AudioDeviceDescriptors, callback: AsyncCall ...@@ -2445,10 +2445,10 @@ selectInputDevice(inputAudioDevices: AudioDeviceDescriptors, callback: AsyncCall
**示例:** **示例:**
```js ```js
let inputAudioDeviceDescriptor = [{ let inputAudioDeviceDescriptor = [{
"deviceRole":audio.DeviceRole.INPUT_DEVICE, deviceRole : audio.DeviceRole.INPUT_DEVICE,
"networkId":audio.LOCAL_NETWORK_ID, networkId : audio.LOCAL_NETWORK_ID,
"interruptGroupId":1, interruptGroupId : 1,
"volumeGroupId":1 }]; volumeGroupId : 1 }];
async function selectInputDevice(){ async function selectInputDevice(){
audioRoutingManager.selectInputDevice(inputAudioDeviceDescriptor, (err) => { audioRoutingManager.selectInputDevice(inputAudioDeviceDescriptor, (err) => {
...@@ -2486,10 +2486,10 @@ selectInputDevice(inputAudioDevices: AudioDeviceDescriptors): Promise&lt;void&gt ...@@ -2486,10 +2486,10 @@ selectInputDevice(inputAudioDevices: AudioDeviceDescriptors): Promise&lt;void&gt
```js ```js
let inputAudioDeviceDescriptor =[{ let inputAudioDeviceDescriptor =[{
"deviceRole":audio.DeviceRole.INPUT_DEVICE, deviceRole : audio.DeviceRole.INPUT_DEVICE,
"networkId":audio.LOCAL_NETWORK_ID, networkId : audio.LOCAL_NETWORK_ID,
"interruptGroupId":1, interruptGroupId : 1,
"volumeGroupId":1 }]; volumeGroupId : 1 }];
async function getRoutingManager(){ async function getRoutingManager(){
audioRoutingManager.selectInputDevice(inputAudioDeviceDescriptor).then(() => { audioRoutingManager.selectInputDevice(inputAudioDeviceDescriptor).then(() => {
...@@ -2632,10 +2632,10 @@ selectOutputDevice(outputAudioDevices: AudioDeviceDescriptors, callback: AsyncCa ...@@ -2632,10 +2632,10 @@ selectOutputDevice(outputAudioDevices: AudioDeviceDescriptors, callback: AsyncCa
**示例:** **示例:**
```js ```js
let outputAudioDeviceDescriptor = [{ let outputAudioDeviceDescriptor = [{
"deviceRole":audio.DeviceRole.OUTPUT_DEVICE, deviceRole : audio.DeviceRole.OUTPUT_DEVICE,
"networkId":audio.LOCAL_NETWORK_ID, networkId : audio.LOCAL_NETWORK_ID,
"interruptGroupId":1, interruptGroupId : 1,
"volumeGroupId":1 }]; volumeGroupId : 1 }];
async function selectOutputDevice(){ async function selectOutputDevice(){
audioRoutingManager.selectOutputDevice(outputAudioDeviceDescriptor, (err) => { audioRoutingManager.selectOutputDevice(outputAudioDeviceDescriptor, (err) => {
if (err) { if (err) {
...@@ -2672,10 +2672,10 @@ selectOutputDevice(outputAudioDevices: AudioDeviceDescriptors): Promise&lt;void& ...@@ -2672,10 +2672,10 @@ selectOutputDevice(outputAudioDevices: AudioDeviceDescriptors): Promise&lt;void&
```js ```js
let outputAudioDeviceDescriptor =[{ let outputAudioDeviceDescriptor =[{
"deviceRole":audio.DeviceRole.OUTPUT_DEVICE, deviceRole : audio.DeviceRole.OUTPUT_DEVICE,
"networkId":audio.LOCAL_NETWORK_ID, networkId : audio.LOCAL_NETWORK_ID,
"interruptGroupId":1, interruptGroupId : 1,
"volumeGroupId":1 }]; volumeGroupId : 1 }];
async function selectOutputDevice(){ async function selectOutputDevice(){
audioRoutingManager.selectOutputDevice(outputAudioDeviceDescriptor).then(() => { audioRoutingManager.selectOutputDevice(outputAudioDeviceDescriptor).then(() => {
...@@ -2707,17 +2707,17 @@ selectOutputDeviceByFilter(filter: AudioRendererFilter, outputAudioDevices: Audi ...@@ -2707,17 +2707,17 @@ selectOutputDeviceByFilter(filter: AudioRendererFilter, outputAudioDevices: Audi
**示例:** **示例:**
```js ```js
let outputAudioRendererFilter = { let outputAudioRendererFilter = {
"uid":20010041, uid : 20010041,
"rendererInfo": { rendererInfo : {
"contentType":audio.ContentType.CONTENT_TYPE_MUSIC, contentType : audio.ContentType.CONTENT_TYPE_MUSIC,
"streamUsage":audio.StreamUsage.STREAM_USAGE_MEDIA, streamUsage : audio.StreamUsage.STREAM_USAGE_MEDIA,
"rendererFlags":0 }, rendererFlags : 0 },
"rendererId":0 }; rendererId : 0 };
let outputAudioDeviceDescriptor = [{ let outputAudioDeviceDescriptor = [{
"deviceRole":audio.DeviceRole.OUTPUT_DEVICE, deviceRole : audio.DeviceRole.OUTPUT_DEVICE,
"networkId":audio.LOCAL_NETWORK_ID, networkId : audio.LOCAL_NETWORK_ID,
"interruptGroupId":1, interruptGroupId : 1,
"volumeGroupId":1 }]; volumeGroupId : 1 }];
async function selectOutputDeviceByFilter(){ async function selectOutputDeviceByFilter(){
audioRoutingManager.selectOutputDeviceByFilter(outputAudioRendererFilter, outputAudioDeviceDescriptor, (err) => { audioRoutingManager.selectOutputDeviceByFilter(outputAudioRendererFilter, outputAudioDeviceDescriptor, (err) => {
...@@ -2756,17 +2756,17 @@ selectOutputDeviceByFilter(filter: AudioRendererFilter, outputAudioDevices: Audi ...@@ -2756,17 +2756,17 @@ selectOutputDeviceByFilter(filter: AudioRendererFilter, outputAudioDevices: Audi
```js ```js
let outputAudioRendererFilter = { let outputAudioRendererFilter = {
"uid":20010041, uid : 20010041,
"rendererInfo": { rendererInfo : {
"contentType":audio.ContentType.CONTENT_TYPE_MUSIC, contentType : audio.ContentType.CONTENT_TYPE_MUSIC,
"streamUsage":audio.StreamUsage.STREAM_USAGE_MEDIA, streamUsage : audio.StreamUsage.STREAM_USAGE_MEDIA,
"rendererFlags":0 }, rendererFlags : 0 },
"rendererId":0 }; rendererId : 0 };
let outputAudioDeviceDescriptor = [{ let outputAudioDeviceDescriptor = [{
"deviceRole":audio.DeviceRole.OUTPUT_DEVICE, deviceRole : audio.DeviceRole.OUTPUT_DEVICE,
"networkId":audio.LOCAL_NETWORK_ID, networkId : audio.LOCAL_NETWORK_ID,
"interruptGroupId":1, interruptGroupId : 1,
"volumeGroupId":1 }]; volumeGroupId : 1 }];
async function selectOutputDeviceByFilter(){ async function selectOutputDeviceByFilter(){
audioRoutingManager.selectOutputDeviceByFilter(outputAudioRendererFilter, outputAudioDeviceDescriptor).then(() => { audioRoutingManager.selectOutputDeviceByFilter(outputAudioRendererFilter, outputAudioDeviceDescriptor).then(() => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册