reki2000 / mp-audio-stream

Flutter plug-in for multi platform simple audio stream playback with real-time generated audio data streams
MIT License
9 stars 4 forks source link

getting scratch sound in windows dev build #10

Closed xenSlayer closed 1 year ago

xenSlayer commented 1 year ago

I am getting scratch irritating sound when I try to use your package for flutter windows dev build. I am not sure how exactly your package works but so far this is what I have implemented based on your docs example.

late final AudioStream audioStream;

  @override
  void initState() {
    super.initState();
    audioStream = getAudioStream();
    audioStream.init();
    search();
  }

  @override
  void dispose() {
    audioStream.uninit();
    super.dispose();
  }

void play() {
    // video.audioData is a Stream<List<int>> contains the stream of audio data obtained from youtube download in List<int> 
    // format
    video.audioData.listen((data) {
     // my audio data is in List<int> which I converted into Float32List.
    // The audio data is downloaded from youtube which I want to stream as it downloads
        var ld = data.map((i) => i.toDouble()).toList();
        int i = audioStream.push(Float32List.fromList(ld));
},
);
}
reki2000 commented 1 year ago

@xenSlayer Thanks. Is it possilble to show me any complete example which reproduces your situatilon? Anyway when input data stream speed is not enough (-1.0 to 1.0 float32 x 44100 in a second) , output sound will have some click noises.