Title: feat(audio): desktop (Linux/macOS) simulator WAV playback by jnuyens · Pull Request #175 · MicroPythonOS/MicroPythonOS · GitHub
Open Graph Title: feat(audio): desktop (Linux/macOS) simulator WAV playback by jnuyens · Pull Request #175 · MicroPythonOS/MicroPythonOS
X Title: feat(audio): desktop (Linux/macOS) simulator WAV playback by jnuyens · Pull Request #175 · MicroPythonOS/MicroPythonOS
Description: Summary On the Unix/macOS simulator build there is no machine.I2S, so WAVStream.play() hit the I2S init try/except, logged "I2S init failed", and returned with no audio (the track also appeared to end instantly). This makes it impossible to hear music when testing apps on the desktop simulator. This adds a desktop playback path so WAV audio is audible during desktop testing on both Linux and macOS. Changes Single file: internal_filesystem/lib/mpos/audio/stream_wav.py New _detect_desktop_player() — picks afplay on macOS, or the first available of ffplay/aplay/paplay on Linux (probed via command -v). New _shell_quote() — safe single-quoting of the file path for os.system(). A sys.platform != "esp32" branch inserted before the I2S init block: it launches the player in the background, runs a 100 ms progress loop (so the UI progress bar keeps working), honors stop()/skip via pkill -f, and calls on_complete() exactly like the device path. If no player is found it logs one warning and falls back to timed silence (no crash). The ESP32 I2S path is unchanged (gated by sys.platform == "esp32"; the desktop branch returns before I2S init). Only os.system() is used (no os.popen/subprocess, which the Unix build lacks). Testing macOS simulator: music plays via afplay; next/prev/stop interrupt playback; progress bar advances. mpy-cross compiles the file; ast.parse clean; ASCII-only. Notes Volume is applied at launch (afplay/ffplay -v/-volume); changing volume mid-track takes effect on the next track. Acceptable for a simulator convenience. No firmware rebuild needed to pick this up (lib/ overrides frozen libs at boot).
Open Graph Description: Summary On the Unix/macOS simulator build there is no machine.I2S, so WAVStream.play() hit the I2S init try/except, logged "I2S init failed", and returned with no audio (the track also ap...
X Description: Summary On the Unix/macOS simulator build there is no machine.I2S, so WAVStream.play() hit the I2S init try/except, logged "I2S init failed", and returned with no audio (the track...
Opengraph URL: https://github.com/MicroPythonOS/MicroPythonOS/pull/175
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:663e9ec6-92f7-b5ab-8331-adfcb16af003 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D9DE:FDBAE:32420C:44820E:6A514191 |
| html-safe-nonce | e5aa677fbac366b53f0a574e57ce7a026b506fd394f74139f15e804614e05aa0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOURFOkZEQkFFOjMyNDIwQzo0NDgyMEU6NkE1MTQxOTEiLCJ2aXNpdG9yX2lkIjoiNTUzMjkyOTA1OTIzNTU5ODI2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 6ddd90ef71e3053664c325257203647a39a19e143d8499ec4f4f19adc1bb3a6b |
| hovercard-subject-tag | pull_request:3947641457 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/MicroPythonOS/MicroPythonOS/pull/175/files |
| twitter:image | https://avatars.githubusercontent.com/u/3696148?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/3696148?s=400&v=4 |
| og:image:alt | Summary On the Unix/macOS simulator build there is no machine.I2S, so WAVStream.play() hit the I2S init try/except, logged "I2S init failed", and returned with no audio (the track also ap... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | e840f405b2718e8f2d55aafa9ff27dbce17e29d0c253011d05ea0fea3c78baff |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/MicroPythonOS/MicroPythonOS git https://github.com/MicroPythonOS/MicroPythonOS.git |
| octolytics-dimension-user_id | 213598128 |
| octolytics-dimension-user_login | MicroPythonOS |
| octolytics-dimension-repository_id | 975472483 |
| octolytics-dimension-repository_nwo | MicroPythonOS/MicroPythonOS |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 975472483 |
| octolytics-dimension-repository_network_root_nwo | MicroPythonOS/MicroPythonOS |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e876f00c5723f6080b9d294e4958fd4d506e6faf |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width