initializeStreamController method

void initializeStreamController()

Implementation

void initializeStreamController(){
  _audioStreamController = StreamController<Uint8List>();
  _audioStreamController!.stream.listen((audioData) async {

    double freqPitch = await getPitchFromAudioData(audioData);
    if(freqPitch > NeomGeneratorConstants.frequencyMin && freqPitch < NeomGeneratorConstants.frequencyMax) {
      AppConfig.logger.d("Pitch: $freqPitch Hz");
      detectedFrequency = freqPitch;
      detectedPitches.add(freqPitch);
    }

    update([AppPageIdConstants.generator]);
  });
}