Recipe: play packaged audio
luastra/media · live media_state events · about 20 minutesLoad one packaged WAV file, control playback, and render only decoded host state without polling or an application-owned progress loop.
You will copy one audio fixture, install it as a one-item queue at launch, and expose Play and Pause controls whose enabled state follows the host.
Media commands return RequestId values and complete in app.resolve. Ongoing playback truth arrives as media_state events in app.handle; both payload paths use Media.decodeState.
A successful Media.play completion is not permission to invent playing state. Decode host state and let media_state remain authoritative as playback changes.