nativeOutputSampleRate property

Future<int> get nativeOutputSampleRate

Get the native audio output sample rate (Android only).

On iOS this returns 0.

Returns

  • The native sample rate, or 0 when not supported.

Implementation

static Future<int> get nativeOutputSampleRate async {
  if (GemKitPlatform.instance.androidVersion > -1) {
    final dynamic resultString = await GemKitPlatform.instance
        .getChannel(mapId: -1)
        .invokeMethod<String>(
          'callObjectMethod',
          jsonEncode(<String, dynamic>{
            'id': 0,
            'class': 'SoundService',
            'method': 'getNativeOutputSampleRate',
            'args': <String, dynamic>{},
          }),
        );
    final dynamic result = jsonDecode(resultString!);
    return result['result'];
  } else {
    final OperationResult result = staticMethod(
      'SoundService',
      'getNativeOutputSampleRate',
    );
    return result['result'];
  }
}