VoiceController constructor

VoiceController({
  1. required String audioSrc,
  2. required Duration maxDuration,
  3. required bool isFile,
  4. required dynamic onComplete(),
  5. required dynamic onPause(),
  6. required dynamic onPlaying(),
  7. int noiseCount = 24,
  8. dynamic onError(
    1. Object
    )?,
  9. List<double>? randoms,
  10. String? cacheKey,
})

Creates a new VoiceController instance.

Implementation

VoiceController({
  required this.audioSrc,
  required this.maxDuration,
  required this.isFile,
  required this.onComplete,
  required this.onPause,
  required this.onPlaying,
  this.noiseCount = 24,
  this.onError,
  this.randoms,
  this.cacheKey,
}) {
  if (randoms?.isEmpty ?? true) _setRandoms();
  animController = AnimationController(
    vsync: this,
    upperBound: noiseWidth,
    duration: maxDuration,
  );
  init();
  _listenToRemindingTime();
  _listenToPlayerState();
}