src/App.js
/* toggleNode: starts and stops audio by sending a boolean via the AudioWorkletProcessor's message port.*/
starts and stops audio by sending a boolean via the AudioWorkletProcessor's message port.
starts and stops audio by sending a boolean via the AudioWorkletProcessor ' s message port .
toggleNode(){
    const { state } = this;
    if(state.isPlaying) {
      console.log(`stopping ${state.processor.module}`)
      state.node.port.postMessage(false)
    } else {
      console.log(`playing ${state.processor.module}`)
      const node = state.processor.cb(this);
      this.setState({ node });
      node.port.postMessage(true);          
    }
    this.setState({isPlaying: !state.isPlaying });    
  }
toggleNode ( ) { const { state } = this ; if ( state . isPlaying ) { console . log ( ` ${ state . processor . module } ` ) state . node . port . postMessage ( false ) } else { console . log ( ` ${ state . processor . module } ` ) const node = state . processor . cb ( this ) ; this . setState ( { node } ) ; node . port . postMessage ( true ) ; } this . setState ( { isPlaying : ! state . isPlaying } ) ; }
toggleNode: starts and stops audio by sending a boolean via the AudioWorkletProcessor's message port.
toggleNode : starts and stops audio by sending a boolean via the AudioWorkletProcessor ' s message port .