diff --git a/bec_widgets/assets/sounds/bubble-pop.mp3 b/bec_widgets/assets/sounds/bubble-pop.mp3 new file mode 100644 index 00000000..e521aa16 Binary files /dev/null and b/bec_widgets/assets/sounds/bubble-pop.mp3 differ diff --git a/bec_widgets/assets/sounds/button.mp3 b/bec_widgets/assets/sounds/button.mp3 new file mode 100644 index 00000000..91613051 Binary files /dev/null and b/bec_widgets/assets/sounds/button.mp3 differ diff --git a/bec_widgets/assets/sounds/call-to-attention.mp3 b/bec_widgets/assets/sounds/call-to-attention.mp3 new file mode 100644 index 00000000..c625d3e2 Binary files /dev/null and b/bec_widgets/assets/sounds/call-to-attention.mp3 differ diff --git a/bec_widgets/assets/sounds/chicken-sounds.mp3 b/bec_widgets/assets/sounds/chicken-sounds.mp3 new file mode 100644 index 00000000..1b2e03ac Binary files /dev/null and b/bec_widgets/assets/sounds/chicken-sounds.mp3 differ diff --git a/bec_widgets/assets/sounds/cinematic-impact-hit.mp3 b/bec_widgets/assets/sounds/cinematic-impact-hit.mp3 new file mode 100644 index 00000000..657f6e95 Binary files /dev/null and b/bec_widgets/assets/sounds/cinematic-impact-hit.mp3 differ diff --git a/bec_widgets/assets/sounds/computer-mouse-click.mp3 b/bec_widgets/assets/sounds/computer-mouse-click.mp3 new file mode 100644 index 00000000..960443da Binary files /dev/null and b/bec_widgets/assets/sounds/computer-mouse-click.mp3 differ diff --git a/bec_widgets/assets/sounds/cow-mooing.mp3 b/bec_widgets/assets/sounds/cow-mooing.mp3 new file mode 100644 index 00000000..66b9aa6e Binary files /dev/null and b/bec_widgets/assets/sounds/cow-mooing.mp3 differ diff --git a/bec_widgets/assets/sounds/duck-quack.mp3 b/bec_widgets/assets/sounds/duck-quack.mp3 new file mode 100644 index 00000000..327718f0 Binary files /dev/null and b/bec_widgets/assets/sounds/duck-quack.mp3 differ diff --git a/bec_widgets/assets/sounds/duck-quacking.mp3 b/bec_widgets/assets/sounds/duck-quacking.mp3 new file mode 100644 index 00000000..af310cf0 Binary files /dev/null and b/bec_widgets/assets/sounds/duck-quacking.mp3 differ diff --git a/bec_widgets/assets/sounds/error_01.mp3 b/bec_widgets/assets/sounds/error_01.mp3 new file mode 100644 index 00000000..167f07d6 Binary files /dev/null and b/bec_widgets/assets/sounds/error_01.mp3 differ diff --git a/bec_widgets/assets/sounds/error_02.mp3 b/bec_widgets/assets/sounds/error_02.mp3 new file mode 100644 index 00000000..ea9c92d9 Binary files /dev/null and b/bec_widgets/assets/sounds/error_02.mp3 differ diff --git a/bec_widgets/assets/sounds/error_03.mp3 b/bec_widgets/assets/sounds/error_03.mp3 new file mode 100644 index 00000000..1b692679 Binary files /dev/null and b/bec_widgets/assets/sounds/error_03.mp3 differ diff --git a/bec_widgets/assets/sounds/fail-trumpet.mp3 b/bec_widgets/assets/sounds/fail-trumpet.mp3 new file mode 100644 index 00000000..88e67139 Binary files /dev/null and b/bec_widgets/assets/sounds/fail-trumpet.mp3 differ diff --git a/bec_widgets/assets/sounds/fail.mp3 b/bec_widgets/assets/sounds/fail.mp3 new file mode 100644 index 00000000..989e3635 Binary files /dev/null and b/bec_widgets/assets/sounds/fail.mp3 differ diff --git a/bec_widgets/assets/sounds/funny-spring-jump.mp3 b/bec_widgets/assets/sounds/funny-spring-jump.mp3 new file mode 100644 index 00000000..2f554873 Binary files /dev/null and b/bec_widgets/assets/sounds/funny-spring-jump.mp3 differ diff --git a/bec_widgets/assets/sounds/gentle-horse-neigh.mp3 b/bec_widgets/assets/sounds/gentle-horse-neigh.mp3 new file mode 100644 index 00000000..926d6b5f Binary files /dev/null and b/bec_widgets/assets/sounds/gentle-horse-neigh.mp3 differ diff --git a/bec_widgets/assets/sounds/impact-cinematic-boom.mp3 b/bec_widgets/assets/sounds/impact-cinematic-boom.mp3 new file mode 100644 index 00000000..a71c70f2 Binary files /dev/null and b/bec_widgets/assets/sounds/impact-cinematic-boom.mp3 differ diff --git a/bec_widgets/assets/sounds/interface.mp3 b/bec_widgets/assets/sounds/interface.mp3 new file mode 100644 index 00000000..5e3fdabb Binary files /dev/null and b/bec_widgets/assets/sounds/interface.mp3 differ diff --git a/bec_widgets/assets/sounds/level-up_01.mp3 b/bec_widgets/assets/sounds/level-up_01.mp3 new file mode 100644 index 00000000..c4981a9a Binary files /dev/null and b/bec_widgets/assets/sounds/level-up_01.mp3 differ diff --git a/bec_widgets/assets/sounds/level-up_02.mp3 b/bec_widgets/assets/sounds/level-up_02.mp3 new file mode 100644 index 00000000..5cdb6931 Binary files /dev/null and b/bec_widgets/assets/sounds/level-up_02.mp3 differ diff --git a/bec_widgets/assets/sounds/loud-thunder.mp3 b/bec_widgets/assets/sounds/loud-thunder.mp3 new file mode 100644 index 00000000..1eda3d71 Binary files /dev/null and b/bec_widgets/assets/sounds/loud-thunder.mp3 differ diff --git a/bec_widgets/assets/sounds/magic.mp3 b/bec_widgets/assets/sounds/magic.mp3 new file mode 100644 index 00000000..f61ce88d Binary files /dev/null and b/bec_widgets/assets/sounds/magic.mp3 differ diff --git a/bec_widgets/assets/sounds/monkey-scream.mp3 b/bec_widgets/assets/sounds/monkey-scream.mp3 new file mode 100644 index 00000000..db344f59 Binary files /dev/null and b/bec_widgets/assets/sounds/monkey-scream.mp3 differ diff --git a/bec_widgets/assets/sounds/monkey-sound.mp3 b/bec_widgets/assets/sounds/monkey-sound.mp3 new file mode 100644 index 00000000..b06e0193 Binary files /dev/null and b/bec_widgets/assets/sounds/monkey-sound.mp3 differ diff --git a/bec_widgets/assets/sounds/new-notification_01.mp3 b/bec_widgets/assets/sounds/new-notification_01.mp3 new file mode 100644 index 00000000..4f61b6ec Binary files /dev/null and b/bec_widgets/assets/sounds/new-notification_01.mp3 differ diff --git a/bec_widgets/assets/sounds/new-notification_02.mp3 b/bec_widgets/assets/sounds/new-notification_02.mp3 new file mode 100644 index 00000000..e8d21870 Binary files /dev/null and b/bec_widgets/assets/sounds/new-notification_02.mp3 differ diff --git a/bec_widgets/assets/sounds/new-notification_03.mp3 b/bec_widgets/assets/sounds/new-notification_03.mp3 new file mode 100644 index 00000000..71d80c70 Binary files /dev/null and b/bec_widgets/assets/sounds/new-notification_03.mp3 differ diff --git a/bec_widgets/assets/sounds/new-notification_04.mp3 b/bec_widgets/assets/sounds/new-notification_04.mp3 new file mode 100644 index 00000000..0430b396 Binary files /dev/null and b/bec_widgets/assets/sounds/new-notification_04.mp3 differ diff --git a/bec_widgets/assets/sounds/pipe.mp3 b/bec_widgets/assets/sounds/pipe.mp3 new file mode 100644 index 00000000..5870b5ff Binary files /dev/null and b/bec_widgets/assets/sounds/pipe.mp3 differ diff --git a/bec_widgets/assets/sounds/punch.mp3 b/bec_widgets/assets/sounds/punch.mp3 new file mode 100644 index 00000000..178df7b1 Binary files /dev/null and b/bec_widgets/assets/sounds/punch.mp3 differ diff --git a/bec_widgets/assets/sounds/ringtone_01.mp3 b/bec_widgets/assets/sounds/ringtone_01.mp3 new file mode 100644 index 00000000..8dc3c5c4 Binary files /dev/null and b/bec_widgets/assets/sounds/ringtone_01.mp3 differ diff --git a/bec_widgets/assets/sounds/ringtone_02.mp3 b/bec_widgets/assets/sounds/ringtone_02.mp3 new file mode 100644 index 00000000..a560f467 Binary files /dev/null and b/bec_widgets/assets/sounds/ringtone_02.mp3 differ diff --git a/bec_widgets/assets/sounds/ringtone_03.mp3 b/bec_widgets/assets/sounds/ringtone_03.mp3 new file mode 100644 index 00000000..0589c6e7 Binary files /dev/null and b/bec_widgets/assets/sounds/ringtone_03.mp3 differ diff --git a/bec_widgets/assets/sounds/ringtone_04.mp3 b/bec_widgets/assets/sounds/ringtone_04.mp3 new file mode 100644 index 00000000..8ff765bb Binary files /dev/null and b/bec_widgets/assets/sounds/ringtone_04.mp3 differ diff --git a/bec_widgets/assets/sounds/ringtone_05.mp3 b/bec_widgets/assets/sounds/ringtone_05.mp3 new file mode 100644 index 00000000..eb6418f4 Binary files /dev/null and b/bec_widgets/assets/sounds/ringtone_05.mp3 differ diff --git a/bec_widgets/assets/sounds/ringtone_06.mp3 b/bec_widgets/assets/sounds/ringtone_06.mp3 new file mode 100644 index 00000000..92f889da Binary files /dev/null and b/bec_widgets/assets/sounds/ringtone_06.mp3 differ diff --git a/bec_widgets/assets/sounds/school-bell.mp3 b/bec_widgets/assets/sounds/school-bell.mp3 new file mode 100644 index 00000000..013e28ad Binary files /dev/null and b/bec_widgets/assets/sounds/school-bell.mp3 differ diff --git a/bec_widgets/assets/sounds/simple-notification.mp3 b/bec_widgets/assets/sounds/simple-notification.mp3 new file mode 100644 index 00000000..1182e178 Binary files /dev/null and b/bec_widgets/assets/sounds/simple-notification.mp3 differ diff --git a/bec_widgets/assets/sounds/single-church-bell.mp3 b/bec_widgets/assets/sounds/single-church-bell.mp3 new file mode 100644 index 00000000..3cf93a28 Binary files /dev/null and b/bec_widgets/assets/sounds/single-church-bell.mp3 differ diff --git a/bec_widgets/assets/sounds/sinister-laugh.mp3 b/bec_widgets/assets/sounds/sinister-laugh.mp3 new file mode 100644 index 00000000..aa852b48 Binary files /dev/null and b/bec_widgets/assets/sounds/sinister-laugh.mp3 differ diff --git a/bec_widgets/assets/sounds/swoosh_01.mp3 b/bec_widgets/assets/sounds/swoosh_01.mp3 new file mode 100644 index 00000000..113d99f4 Binary files /dev/null and b/bec_widgets/assets/sounds/swoosh_01.mp3 differ diff --git a/bec_widgets/assets/sounds/swoosh_02.mp3 b/bec_widgets/assets/sounds/swoosh_02.mp3 new file mode 100644 index 00000000..fd9375e0 Binary files /dev/null and b/bec_widgets/assets/sounds/swoosh_02.mp3 differ diff --git a/bec_widgets/assets/sounds/swoosh_03.mp3 b/bec_widgets/assets/sounds/swoosh_03.mp3 new file mode 100644 index 00000000..c560efc8 Binary files /dev/null and b/bec_widgets/assets/sounds/swoosh_03.mp3 differ diff --git a/bec_widgets/assets/sounds/system-notification.mp3 b/bec_widgets/assets/sounds/system-notification.mp3 new file mode 100644 index 00000000..a0f2e2d8 Binary files /dev/null and b/bec_widgets/assets/sounds/system-notification.mp3 differ diff --git a/bec_widgets/assets/sounds/thunder.mp3 b/bec_widgets/assets/sounds/thunder.mp3 new file mode 100644 index 00000000..2b828d7f Binary files /dev/null and b/bec_widgets/assets/sounds/thunder.mp3 differ diff --git a/bec_widgets/assets/sounds/wrong-answer.mp3 b/bec_widgets/assets/sounds/wrong-answer.mp3 new file mode 100644 index 00000000..c3afd090 Binary files /dev/null and b/bec_widgets/assets/sounds/wrong-answer.mp3 differ diff --git a/bec_widgets/utils/sound_player.py b/bec_widgets/utils/sound_player.py new file mode 100644 index 00000000..d8278e15 --- /dev/null +++ b/bec_widgets/utils/sound_player.py @@ -0,0 +1,63 @@ +from pathlib import Path + +from qtpy.QtCore import QUrl +from qtpy.QtMultimedia import QAudioOutput, QMediaPlayer +from qtpy.QtWidgets import QApplication, QComboBox, QPushButton, QVBoxLayout, QWidget + + +class SoundPlayerWidget(QWidget): + """Simple widget to preview bundled sound assets.""" + + def __init__(self, parent=None): + super().__init__(parent=parent) + self.setWindowTitle("Sound Player") + + self._sounds_dir = Path(__file__).resolve().parent.parent / "assets" / "sounds" + self._player = QMediaPlayer(self) + self._audio_output = QAudioOutput(self) + self._player.setAudioOutput(self._audio_output) + + self.sound_combo_box = QComboBox(self) + self.play_button = QPushButton("Play", self) + + self._populate_sounds() + self.play_button.clicked.connect(self.play_selected_sound) + + layout = QVBoxLayout(self) + layout.addWidget(self.sound_combo_box) + layout.addWidget(self.play_button) + + self.resize(420, 100) + + def _populate_sounds(self) -> None: + """Load bundled sound assets into the combo box.""" + sound_files = sorted(self._sounds_dir.glob("*.mp3")) + for sound_file in sound_files: + self.sound_combo_box.addItem(sound_file.stem, str(sound_file)) + + self.play_button.setEnabled(bool(sound_files)) + if not sound_files: + self.sound_combo_box.addItem("No sounds found") + + def play_selected_sound(self) -> None: + """Play the currently selected sound asset.""" + sound_path = self.sound_combo_box.currentData() + if not sound_path: + return + + self._player.setSource(QUrl.fromLocalFile(sound_path)) + self._player.stop() + self._player.play() + + +if __name__ == "__main__": # pragma: no cover + import sys + + from bec_qthemes import apply_theme + + app = QApplication(sys.argv) + apply_theme("light") + + widget = SoundPlayerWidget() + widget.show() + sys.exit(app.exec_())