Spaces:
Running
Running
Download tests/check_audio.py from pollen-robotics/marionette: direct link, hf CLI and curl.
- Browser
- Download file 897 Bytes
-
https://huggingface.co/spaces/pollen-robotics/marionette/resolve/dc8a09726670ce933f57c51f1bf3ae0da7b308fb/tests/check_audio.py
- Command line
-
hf download hf://spaces/pollen-robotics/marionette@dc8a09726670ce933f57c51f1bf3ae0da7b308fb/tests/check_audio.py
-
curl -L -o check_audio.py https://huggingface.co/spaces/pollen-robotics/marionette/resolve/dc8a09726670ce933f57c51f1bf3ae0da7b308fb/tests/check_audio.py
897 Bytes
| #!/usr/bin/env python3 | |
| """Quick check: can the robot play audio from this laptop?""" | |
| import sys | |
| import time | |
| from reachy_mini import ReachyMini | |
| def main() -> int: | |
| wav = "/home/remi/reachy_mini_apps/reachy_mini/examples/recorded_audio.wav" | |
| print("Connecting to robot...") | |
| with ReachyMini() as r: | |
| mode = r.connection_mode | |
| has_media = hasattr(r, "media") and r.media is not None | |
| print(f"Connection mode: {mode}") | |
| print(f"Has media: {has_media}") | |
| if not has_media: | |
| print("FAIL: no media backend") | |
| return 1 | |
| try: | |
| print(f"Playing {wav} ...") | |
| r.media.play_sound(wav) | |
| time.sleep(3) | |
| print("OK: play_sound completed") | |
| return 0 | |
| except Exception as e: | |
| print(f"FAIL: {e}") | |
| return 1 | |
| if __name__ == "__main__": | |
| sys.exit(main()) | |