playString method
SynthizerSound
playString({
- required String string,
- bool keepAlive = false,
- double gain = 0.7,
- bool looping = false,
- double pitchBend = 1.0,
override
Play a sound from the given string
.
Implementation
@override
SynthizerSound playString({
required final String string,
final bool keepAlive = false,
final double gain = 0.7,
final bool looping = false,
final double pitchBend = 1.0,
}) {
final buffer = Buffer.fromString(synthizer, string);
final generator = context.createBufferGenerator()
..gain.value = gain
..looping.value = looping
..pitchBend.value = pitchBend
..buffer.value = buffer;
source.addGenerator(generator);
configureLinger(generator: generator, keepAlive: keepAlive);
return SynthizerSound(
backend: backend,
channel: this,
keepAlive: keepAlive,
generator: generator,
);
}