With TyranoScript, you can play music tailored to each scene.
Now, let's try playing background music.
First, prepare the music file you want to play.
The supported formats are mp3, ogg, and m4a.
For environments using TyranoScript V5 and later, it is recommended to use the mp3 format.
With the mp3 format, it can be played without issues on most platforms, including PCs, smartphones, and browsers.
■ Browser Game Format
Please use the mp3 format. The ogg format cannot be played on Safari (iPhone).
■ PC Game Format (Windows, Mac)
Please use either the mp3 or ogg format. (mp3 is supported in versions V5 and later)
This also applies when using TyranoScript for Windows/Mac for testing purposes.
■ Smartphone App Format
Please use mp3, m4a (for iPhone), or ogg (for Android). For apps, mp3 is recommended since it plays on both platforms.
This time, we obtained free resources from the following site.
Free BGM DOVA-SYNDROME
Choose your favorite background music and download it.
For this example, we used the following music file as a sample.
http://dova-s.jp/bgm/play146.html
Click on the "Download MP3 File" section at the bottom of the page to download it.
Once the conversion is complete, rename the file to "test.mp3" and place it in the project's bgm folder.
Now, you are ready to play the music.
In addition to the above site, we would also like to introduce "Maou Damashii", a site that offers free background music and sound effects.
This site distributes files in ogg format as well as mp3.
Visit the Maou Damashii site
Playing music [l][r]
[playbgm storage=test.mp3]
Music is now playing [l][r]
Next, we stop the music [l][r]
[stopbgm]
The music has stopped playing [l][r]
TyranoScript also supports the playback of sound effects and voice.
Please place sound effect files in the project's sound folder.
Basically, it's the same as playing music, so please refer to the sample code below.
;Playing sound effect
[playse storage="voice.mp3"]
Sound effect is playing [l][r]