import { getInstance } from '../instance' ; import { Filter } from './Filter' ; memberof class StreamFilter extends Filter { private _stream : MediaStream ; constructor ( ) { if ( getInstance ( ) . useLegacy ) { super ( null ) ; return ; } const audioContext = getInstance ( ) . context . audioContext ; const destination = audioContext . createMediaStreamDestination ( ) ; const source = audioContext . createMediaStreamSource ( destination . stream ) ; super ( destination , source ) ; this . _stream = destination . stream ; } public get stream ( ) : MediaStream { return this . _stream ; } public destroy ( ) { this . _stream = null ; super . destroy ( ) ; } } export { StreamFilter } ;