AudioNode.context

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 인터페이스의 읽기 전용 context 속성은 연관된 BaseAudioContext를 반환하는데, BaseAudioContext는 이 노드가 관여하고 있는 프로세싱 그래프를 나타내는 객체입니다.

구문

js
var aContext = anAudioNode.context;

AudioNode 를 생성하기 위해 사용된 AudioContext 또는 OfflineAudioContext 객체.

예제

js
const AudioContext = window.AudioContext || window.webkitAudioContext;
const audioCtx = new AudioContext();

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

console.log(oscillator.context); // AudioContext
console.log(oscillator.context === audioCtx); // true

명세서

Specification
Web Audio API
# dom-audionode-context

브라우저 호환성

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
context

Legend

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

Full support
Full support

같이 보기