Tricks on Stopping Audio

terrorsoul Beginner API Reference

In Trailmakers modding it can be hard to control audio due to the limited functions available for audio. In my Minigolf mod I used a few tricks with audio in order to have different sound effects and music play depending on the current course style. This was done by playing these two audio ids using PlayAudioAtPosition (One stops the sound effects, the other stops the music):

tm.audio.PlayAudioAtPosition("UI_InGameMenu_QuitToMain_click", tm.vector3.Create(0, 1000, 0), 0)
tm.audio.PlayAudioAtPosition("ExplorationCheckpoint_music_stop", tm.vector3.Create(0, 1000, 0), 0)


This effectively stops all audio that that the game is currently playing including any sound effects, this then gives you a blank slate to rebuild the audio by then playing the audio that you need such as perhaps some forest ambience with AMB_Forest_Birds_start or perhaps the feeling of underwater by playing CameraUnderWater.

Discussion

Please log in to post a comment.