AudioNode.channelInterpretation

AudioNode.channelInterpretation - як відбудеться переміщення аудіо.

Синтаксис:

AudioNode.channelInterpretation;

Параметри:

AudioNode - об'єкт AudioNode.

Опис:

channelInterpretation властивість об'єкту AudioNode яка повертає/задає значення яке описує як відбудеться переміщення аудіо.

Можливими значеннями є "speakers" або "discrete".

Коли кількість каналів не співпадає між входом і виходом, переміщення вгору або вниз відбувається відповідно до наступних правил. Цю ситуацію можна дещо контролювати, встановлюючи властивість AudioNode.channelInterpretation.

Приклад:

if(window.AudioContext){ var audioCtx = new AudioContext(); var oscillator = audioCtx.createOscillator(); var gainNode = audioCtx.createGain(); oscillator.connect(gainNode); gainNode.connect(audioCtx.destination); alert( oscillator.channelInterpretation ); }else alert('Ваш браузер не підтримує Web Audio'); var audioCtx = new AudioContext(); var oscillator = audioCtx.createOscillator(); var gainNode = audioCtx.createGain(); oscillator.connect(gainNode); gainNode.connect(audioCtx.destination); oscillator.channelInterpretation='discrete'; oscillator.start(); oscillator.stop(2);