Skip to content

Looks like extractWaveformData in WaveformExtractionController gets stuck when using await #433

Open
@MorningStarJ

Description

@MorningStarJ

Describe the bug
The callbacks onCurrentExtractedWaveformData and onExtractionProgress are working as expected, but when using await on extractWaveformData(), it neither throws an error nor returns — it just gets stuck
To Reproduce

final waveformExtraction = WaveformExtractionController();
  final style = PlayerWaveStyle(waveThickness: 0.5, spacing: 1);
  final samples = style.getSamplesForWidth(5 * duration * 2);
  try {
    waveformExtraction.onCurrentExtractedWaveformData.listen((data) {
      debugLog("data: $data");
    }); // Provides latest data while extracting the waveforms.
    waveformExtraction.onExtractionProgress.listen((progress) {
      debugLog("progress: $progress");
    }); // Provides progress of the waveform extractions.

    final waveformData = await waveformExtraction.extractWaveformData(
      path: path,
      noOfSamples: samples,
    );
    debugLog("waveformData: $waveformData");
  } catch (e, stackTrace) {
    debugLog("error: $e");
    debugLog("stackTrace: $stackTrace");
  }

Expected behavior
Make sure extractWaveformData returns correctly after finishing

Smartphone (please complete the following information):

  • Device: [iPhone 16 Pro]
  • OS: [iOS18.4]
  • audio_waveforms branch: main
  • Flutter version 3.29.2 on channel stable
  • Dart version 3.7.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions