VoiceCollection.create constructor

VoiceCollection.create(
  1. Synthesizer synthesizer,
  2. int maxActiveVoiceCount
)

Implementation

factory VoiceCollection.create(Synthesizer synthesizer, int maxActiveVoiceCount) {
  List<Voice> voices = [];

  for (int i = 0; i < maxActiveVoiceCount; i++) {
    voices.add(Voice(synthesizer));
  }

  return VoiceCollection(synthesizer: synthesizer, voices: voices);
}