AudioNode: channelInterpretation プロパティ

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since April 2021.

AudioNode インターフェイスの channelInterpretation プロパティは、入力と出力の数が違う場合に入力のチャンネルを出力のチャンネルに対応付ける方法を表す列挙値です。たとえば、これによりモノラルの入力をステレオや 5.1 チャンネルの出力にアップミキシングする方法や、クアッドチャンネルの入力をステレオやモノラルの出力にダウンミキシングする方法が決まります。

このプロパティには、speakersdiscrete の 2 個の選択肢があります。これらの説明は、Basic concepts behind Web Audio API > アップミキシングとダウンミキシングにあります。

値の説明は、Basic concepts behind Web Audio API > アップミキシングとダウンミキシングにあります。

簡単にいうと:

speakers

一般的なスピーカーの入力と出力の設計の組み合わせ (モノラル、ステレオ、クアッド、5.1) 用の「通常の」対応付けを使用します。たとえば、この設定では、モノラルの入力はステレオの出力の両方のチャンネルに出力されます。

discrete

入力のチャンネルは順に出力のチャンネルに対応付けられます。出力より入力が多い場合は、余った入力は捨てられます。入力の方が少ない場合は、余った出力は無音になります。

js
const audioCtx = new AudioContext();

const oscillator = audioCtx.createOscillator();
const gainNode = audioCtx.createGain();

oscillator.connect(gainNode);
gainNode.connect(audioCtx.destination);

oscillator.channelInterpretation = "discrete";

仕様書

Specification
Web Audio API
# dom-audionode-channelinterpretation

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
channelInterpretation

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

関連情報