Skip to content
Snippets Groups Projects
Commit 4615667c authored by Fabian Heinrich's avatar Fabian Heinrich
Browse files

Switched from simpleaudio to pygame to play sound

parent 7d660fad
No related branches found
No related tags found
2 merge requests!62Resolve "Game Flow",!61Resolve "Beep on button for audio sync"
Pipeline #46315 passed
......@@ -13,8 +13,8 @@ import numpy as np
import pygame
import pygame_gui
import requests
import simpleaudio
import yaml
from pygame import mixer
from websockets.sync.client import connect
from overcooked_simulator import ROOT_DIR
......@@ -1024,10 +1024,11 @@ class PyGameGUI:
websocket.close()
def play_bell_sound(self):
wave_obj = simpleaudio.WaveObject.from_wave_file(
str(ROOT_DIR / "gui_2d_vis" / "sync_bell.wav")
)
wave_obj.play()
bell_path = str(ROOT_DIR / "gui_2d_vis" / "sync_bell.wav")
mixer.init()
mixer.music.load(bell_path)
mixer.music.set_volume(0.9)
mixer.music.play()
log.log(logging.INFO, "Started game, played bell sound")
def start_pygame(self):
......
......@@ -23,7 +23,6 @@ requirements = [
"websockets>=12.0",
"requests>=2.31.0",
"platformdirs>=4.1.0",
"simpleaudio",
]
test_requirements = [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment