Skip to content

Commit

Permalink
this change fixes the garbled audio on my Pixel 6a while the screen i…
Browse files Browse the repository at this point in the history
…s off. Not familiar with libmpv, but seems to favor audiotrack audio output over opensles. KRTirtho#571
  • Loading branch information
olivier2 committed Feb 8, 2024
1 parent 5d0b5e6 commit 0e73443
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/services/audio_player/mk_state_player.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'dart:async';

import 'package:flutter_desktop_tools/flutter_desktop_tools.dart';
import 'package:catcher_2/catcher_2.dart';
import 'package:collection/collection.dart';
import 'package:media_kit/media_kit.dart';
Expand Down Expand Up @@ -64,6 +64,12 @@ class MkPlayerWithState extends Player {
Catcher2.reportCheckedError('[MediaKitError] \n$event', null);
}),
];
if (super.platform is NativePlayer) {
NativePlayer playerNative = super.platform as NativePlayer;
if (DesktopTools.platform.isAndroid) {
playerNative.setProperty("ao", "audiotrack,opensles");
}
}
}

bool get shuffled => _shuffled;
Expand Down

0 comments on commit 0e73443

Please sign in to comment.