stopPlayer method

Future<int> stopPlayer()

Implementation

Future<int> stopPlayer() async {
  //recordedChunks = [];
  //streamSink = null;
  //mediaRecorder = null;
  // mic.disconnect();
  //streamNode?.stop();
  //streamNode?.disconnect();
  streamNode!.disconnect();
  await audioCtx?.close().toDart;
  streamNode = null;
  audioCtx = null;
  //streamNode = null;
  callback!.log(Level.debug, 'stop');
  callback!.stopPlayerCompleted(0, true);
  return 0; // PlayerState.stopped.index; // PlayerState.isStopped;
}