{"id":204,"date":"2026-09-19T17:34:36","date_gmt":"2026-09-19T17:34:36","guid":{"rendered":"https:\/\/robinclapworthy.com\/?p=204"},"modified":"2026-09-19T17:39:26","modified_gmt":"2026-09-19T17:39:26","slug":"the-sound-effect-that-refused-to-play","status":"publish","type":"post","link":"https:\/\/robinclapworthy.com\/?p=204","title":{"rendered":"The Sound Effect That Refused to Play"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">What sounded like a tiny improvement became one of the most stubborn problems in Galactic Gladiators so far.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I had found a much better sound for the ship\u2019s boost: a long, stuttering cinematic riser that made acceleration feel genuinely powerful. The plan seemed simple:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Press Circle.<\/li>\n\n\n\n<li>Turn the background music down.<\/li>\n\n\n\n<li>Play the boost sound.<\/li>\n\n\n\n<li>Restore the music when Circle is released.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The music obediently became quieter. The WAV, however, refused to cooperate.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We tried trimming its very quiet opening, increasing its volume and converting it from 24-bit to old-fashioned 16-bit PCM. The file played perfectly from the Visual FoxPro Command Window, but remained silent inside the game.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That led us through several generations of Windows audio technology.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First came <code>PlaySound()<\/code>, which works well for short effects but provides one shared channel. Lasers, warnings and other sounds can replace whatever it is currently playing.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next came MCI, complete with a dedicated <code>GGBoost<\/code> audio channel. It successfully opened the file, then rejected the command to loop it with the wonderfully unhelpful error number 259.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, the boost received its own hidden Windows Media Player object\u2014the same reliable technology already used for GG\u2019s music.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Even that did not work immediately.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The final problem was timing. Windows Media Player loads audio asynchronously. The game was asking it to play before it had finished preparing the WAV, and the first request was silently ignored.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The working solution checks the player\u2019s state every frame and retries until Windows confirms:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>playState = 3<\/code><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Playing.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And there it was.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The music drops instantly, the boost erupts through its own independent channel, ordinary sound effects cannot interrupt it, and releasing Circle stops it cleanly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">All that effort for one sound effect\u2014but it matters. The player\u2019s ship is the centre of the game, and pressing boost should feel exciting every single time.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I\u2019ll be honest: by this point the whole episode had become genuinely infuriating. Every apparent breakthrough uncovered another reason for the sound not to play. More than once, it felt absurd to be spending so much effort on a single effect.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But hearing it working properly changed that immediately.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The boost now has real presence. The music falls away, the engine effect takes over and the ship suddenly feels much more powerful. It is a small moment in the game, but one the player will experience repeatedly\u2014and it is absolutely worth getting right.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Infuriating? Completely.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Worth it? One hundred percent.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It also produced another oddly satisfying milestone: Visual FoxPro is now coordinating multiple independent audio channels, looping cinematic effects, music ducking, controller input and real-time gameplay.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Not bad for a database language from the 1990s.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What sounded like a tiny improvement became one of the most stubborn problems in Galactic Gladiators so far. I had found a much better sound for the ship\u2019s boost: a long, stuttering cinematic riser that made acceleration feel genuinely powerful. The plan seemed simple: The music obediently became quieter. The WAV, however, refused to cooperate. &#8230; <a title=\"The Sound Effect That Refused to Play\" class=\"read-more\" href=\"https:\/\/robinclapworthy.com\/?p=204\" aria-label=\"Read more about The Sound Effect That Refused to Play\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-204","post","type-post","status-publish","format-standard","hentry","category-galactic-gladiators"],"_links":{"self":[{"href":"https:\/\/robinclapworthy.com\/index.php?rest_route=\/wp\/v2\/posts\/204","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/robinclapworthy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/robinclapworthy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/robinclapworthy.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/robinclapworthy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=204"}],"version-history":[{"count":2,"href":"https:\/\/robinclapworthy.com\/index.php?rest_route=\/wp\/v2\/posts\/204\/revisions"}],"predecessor-version":[{"id":206,"href":"https:\/\/robinclapworthy.com\/index.php?rest_route=\/wp\/v2\/posts\/204\/revisions\/206"}],"wp:attachment":[{"href":"https:\/\/robinclapworthy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=204"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/robinclapworthy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=204"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/robinclapworthy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=204"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}