Closed baigua closed 9 months ago
thanks
if we already check mSamplesIsEmpty why do we also need another null check?
please open a PR
it's strange that after I modified that part, my program don't corrupts again. but it was also probably because I rebuilt my program.
to get each note listen clearly, I have them apply memory every 100 milliseconds like this:
var timer = Timer.periodic(const Duration(milliseconds: 100), (timer) {
_feedAudioData();
});
void _feedAudioData() {
ArrayInt16 buffer =
ArrayInt16.zeros(numShorts: sampleRate ~/ 10);
_synth!.renderMonoInt16(buffer);
FlutterPcmSound.feed(PcmArrayInt16(bytes: buffer.bytes));
}
so when there are hundreds of notes to play, the program is very busy.
I try to make a piano roll, that let users to arrange their own midi sequences. I use both flutter_pcm_sound.dart and dart_melty_soundfont.dart
I don't know if that are better ways to do this, because when I use the pre feed buffer way, I can't hear voice from the second channel.
when I run my program, error reports:
it seems in FlutterPcmSoundPlugin.java here should be modified like this: