generateTone method
Generates a tone with the specified frequency, volume, and duration.
frequency - The frequency of the tone in Hz (default: 440.0)
volume - The volume of the tone from 0.0 to 1.0 (default: 1.0)
duration - The duration of the tone in milliseconds (optional, if null the tone plays until stopped)
Implementation
@override
Future<bool> generateTone({
double frequency = 440.0,
double volume = 1.0,
int? duration,
}) async {
final result = await methodChannel.invokeMethod<bool>('generateTone', {
'frequency': frequency,
'volume': volume,
'duration': duration,
});
return result ?? false;
}