FlutterOggPiano class

Constructors

FlutterOggPiano()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

init({bool isStereo = true, MODE mode = MODE.LOW_LATENCY}) Future<void>
Initialize sound system
You can enable mono mode by setting isStereo as false. isStereo is true as default mode decides performance of audio handler. If mode is LOW_LATENCY, it can render audio fast, but audio will start stutter if there are too many sounds to be rendered

If mode is POWER_SAVING, it can render audio more fluently, but it may require higher performance than LOW_LATENCY mode
isReleased() Future<bool?>
Check if sound system is released
load({required ByteData src, required String name, required int index, bool forceLoad = false, bool replace = false}) Future<String?>
Load sound file with specified src byte data and specified file name with custom index value. Don't overload file for same index or it won't load it. Or set forceLoad to true. This method will generate temp file in device, so you can decide if you will replace file with replace bool.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
play({required int index, required int note, double pan = 0.0}) Future<void>
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
playInGroup(Map<int, List<Float64List>> data) Future<void>
Plays multiple sounds at the same time, this method is for reducing delays in each sounds data must contain 3 length integer list. Each value in list represents {note, pan, number of notes (can be decimal)} For example, if 1 pitched note will be played 10 times in single session with panned to right, data must be {1, 1, 10} Keys in data must contain id of each sound.

Be aware that if number of notes are too large, it may lead to awful sound
release() Future<void>
Release sound system. After releasing it, you can't do anything with this sound system. You can reuse it by calling init method again
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

platformVersion Future<String?>
no setter