提交 84877ed7 编写于 作者: J jiao_yanlin

Sample code modification

Signed-off-by: Njiao_yanlin <jiaoyanlin@huawei.com>
上级 1f80c6c3
......@@ -2452,10 +2452,18 @@ selectInputDevice(inputAudioDevices: AudioDeviceDescriptors, callback: AsyncCall
**示例:**
```js
let inputAudioDeviceDescriptor = [{
deviceRole : audio.DeviceRole.INPUT_DEVICE,
networkId : audio.LOCAL_NETWORK_ID,
interruptGroupId : 1,
volumeGroupId : 1 }];
deviceRole : audio.DeviceRole.INPUT_DEVICE,
deviceType : audio.DeviceType.EARPIECE,
id : 1,
name : "",
address : "",
sampleRates : [44100],
channelCounts : [2],
channelMasks : 0,
networkId : audio.LOCAL_NETWORK_ID,
interruptGroupId : 1,
volumeGroupId : 1,
}];
async function selectInputDevice(){
audioRoutingManager.selectInputDevice(inputAudioDeviceDescriptor, (err) => {
......@@ -2492,11 +2500,19 @@ selectInputDevice(inputAudioDevices: AudioDeviceDescriptors): Promise&lt;void&gt
**示例:**
```js
let inputAudioDeviceDescriptor =[{
deviceRole : audio.DeviceRole.INPUT_DEVICE,
networkId : audio.LOCAL_NETWORK_ID,
interruptGroupId : 1,
volumeGroupId : 1 }];
let inputAudioDeviceDescriptor = [{
deviceRole : audio.DeviceRole.INPUT_DEVICE,
deviceType : audio.DeviceType.EARPIECE,
id : 1,
name : "",
address : "",
sampleRates : [44100],
channelCounts : [2],
channelMasks : 0,
networkId : audio.LOCAL_NETWORK_ID,
interruptGroupId : 1,
volumeGroupId : 1,
}];
async function getRoutingManager(){
audioRoutingManager.selectInputDevice(inputAudioDeviceDescriptor).then(() => {
......@@ -2639,10 +2655,19 @@ selectOutputDevice(outputAudioDevices: AudioDeviceDescriptors, callback: AsyncCa
**示例:**
```js
let outputAudioDeviceDescriptor = [{
deviceRole : audio.DeviceRole.OUTPUT_DEVICE,
networkId : audio.LOCAL_NETWORK_ID,
interruptGroupId : 1,
volumeGroupId : 1 }];
deviceRole : audio.DeviceRole.OUTPUT_DEVICE,
deviceType : audio.DeviceType.SPEAKER,
id : 1,
name : "",
address : "",
sampleRates : [44100],
channelCounts : [2],
channelMasks : 0,
networkId : audio.LOCAL_NETWORK_ID,
interruptGroupId : 1,
volumeGroupId : 1,
}];
async function selectOutputDevice(){
audioRoutingManager.selectOutputDevice(outputAudioDeviceDescriptor, (err) => {
if (err) {
......@@ -2678,11 +2703,19 @@ selectOutputDevice(outputAudioDevices: AudioDeviceDescriptors): Promise&lt;void&
**示例:**
```js
let outputAudioDeviceDescriptor =[{
deviceRole : audio.DeviceRole.OUTPUT_DEVICE,
networkId : audio.LOCAL_NETWORK_ID,
interruptGroupId : 1,
volumeGroupId : 1 }];
let outputAudioDeviceDescriptor = [{
deviceRole : audio.DeviceRole.OUTPUT_DEVICE,
deviceType : audio.DeviceType.SPEAKER,
id : 1,
name : "",
address : "",
sampleRates : [44100],
channelCounts : [2],
channelMasks : 0,
networkId : audio.LOCAL_NETWORK_ID,
interruptGroupId : 1,
volumeGroupId : 1,
}];
async function selectOutputDevice(){
audioRoutingManager.selectOutputDevice(outputAudioDeviceDescriptor).then(() => {
......@@ -2720,11 +2753,20 @@ let outputAudioRendererFilter = {
streamUsage : audio.StreamUsage.STREAM_USAGE_MEDIA,
rendererFlags : 0 },
rendererId : 0 };
let outputAudioDeviceDescriptor = [{
deviceRole : audio.DeviceRole.OUTPUT_DEVICE,
networkId : audio.LOCAL_NETWORK_ID,
interruptGroupId : 1,
volumeGroupId : 1 }];
deviceRole : audio.DeviceRole.OUTPUT_DEVICE,
deviceType : audio.DeviceType.SPEAKER,
id : 1,
name : "",
address : "",
sampleRates : [44100],
channelCounts : [2],
channelMasks : 0,
networkId : audio.LOCAL_NETWORK_ID,
interruptGroupId : 1,
volumeGroupId : 1,
}];
async function selectOutputDeviceByFilter(){
audioRoutingManager.selectOutputDeviceByFilter(outputAudioRendererFilter, outputAudioDeviceDescriptor, (err) => {
......@@ -2769,11 +2811,20 @@ let outputAudioRendererFilter = {
streamUsage : audio.StreamUsage.STREAM_USAGE_MEDIA,
rendererFlags : 0 },
rendererId : 0 };
let outputAudioDeviceDescriptor = [{
deviceRole : audio.DeviceRole.OUTPUT_DEVICE,
networkId : audio.LOCAL_NETWORK_ID,
interruptGroupId : 1,
volumeGroupId : 1 }];
deviceRole : audio.DeviceRole.OUTPUT_DEVICE,
deviceType : audio.DeviceType.SPEAKER,
id : 1,
name : "",
address : "",
sampleRates : [44100],
channelCounts : [2],
channelMasks : 0,
networkId : audio.LOCAL_NETWORK_ID,
interruptGroupId : 1,
volumeGroupId : 1,
}];
async function selectOutputDeviceByFilter(){
audioRoutingManager.selectOutputDeviceByFilter(outputAudioRendererFilter, outputAudioDeviceDescriptor).then(() => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册