initFlutterSoundPlayer static method

Future<void> initFlutterSoundPlayer()

Implementation

static Future<void> initFlutterSoundPlayer() async {
  await soundPlayer.openPlayer();
  soundPlayer.setVolume(1);
  soundPlayer.setSubscriptionDuration(const Duration(milliseconds: 200));
  Stream<PlaybackDisposition>? playbackDispositionStream=soundPlayer.onProgress;
  if(playbackDispositionStream!=null){
    Log.i(tag, "SoundPlayer:listen");
    playbackDispositionStream.listen((event) async {
      //播放进度监听
    });
  }
}