play method
Play sound with specified index
to choose instrument and note
to pick note
1 value difference for note
is semitone
Negative note
value for lower sound, positive for higher sound
You can apply panning effect by adjusting pan
, this parameter must range from -1.0 to 1.0
If pan
is -1.0, users will be able to hear sound only from left side, and if pan
is 1.0, they will be able to hear sound only from right side
Be aware that pan
will be effective only when stereo mode is enabled
Implementation
Future<void> play({required int index, required int note, double pan = 0.0}) async {
await _channel.invokeMethod("play", {"index" : index, "note" : note, "pan" : pan});
}