Skip to content

Commit

Permalink
Stop SoundPlayer on OpMode finish
Browse files Browse the repository at this point in the history
  • Loading branch information
bubner committed Dec 10, 2024
1 parent b2bc7df commit 21a1ee3
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import au.edu.sa.mbhs.studentrobotics.bunyipslib.util.Storage
import au.edu.sa.mbhs.studentrobotics.bunyipslib.util.Threads
import com.acmerobotics.roadrunner.Action
import com.acmerobotics.roadrunner.ftc.throwIfModulesAreOutdated
import com.qualcomm.ftccommon.SoundPlayer
import com.qualcomm.hardware.lynx.LynxModule
import com.qualcomm.robotcore.hardware.Blinker
import com.qualcomm.robotcore.hardware.DcMotor
Expand Down Expand Up @@ -506,6 +507,7 @@ abstract class BunyipsOpMode : BOMInternal() {
// Ensure all threads have been told to stop
gamepadExecutor?.shutdownNow()
Threads.stopAll()
SoundPlayer.getInstance().stopPlayingAll()
try {
onStop()
} catch (e: Exception) {
Expand Down

0 comments on commit 21a1ee3

Please sign in to comment.