import { getInstance } from '../instance' ; import { Filter } from './Filter' ; memberof class MonoFilter extends Filter { /** Merger node */ private _merger : ChannelMergerNode ; constructor ( ) { if ( getInstance ( ) . useLegacy ) { super ( null ) ; return ; } const audioContext = getInstance ( ) . context . audioContext ; const splitter = audioContext . createChannelSplitter ( ) ; const merger = audioContext . createChannelMerger ( ) ; merger . connect ( splitter ) ; super ( merger , splitter ) ; this . _merger = merger ; } public destroy ( ) { this . _merger . disconnect ( ) ; this . _merger = null ; super . destroy ( ) ; } } export { MonoFilter } ;