Sounds and music
The ink + Pixi’VN integration introduces a "# script" that allows you to use the sounds and music. To do this, you need to use the following syntax:
# {operation} {component type} {alias} {parameters}#: is the hashtag symbol to identify a hashtag command.operation: the operation to perform. Currently supported:component type: the component type. Available types:sound: to play, pause, resume, stop or edit a sound.channel: to run an operation on a channel.
alias: The alias to identify the sound. Use double quotes if the alias contains spaces.parameters(Optional): a space-separated list of property/value pairs. If a value contains spaces, wrap it in double quotes. If a value is a object, pass valid JSON and escape the braces for ink (e.g.\{ "placeholder": "Enter your name", "maxLength": 20 \}).
# play sound sfx_whoosh delay 0.1
# play sound bgm_cheerful loop true channel bgm
Hello, I'm a cheerful background music that will loop forever until you stop me.
# pause sound bgm_cheerful
I'm paused, but I can be resumed.
# resume sound bgm_cheerful
I'm back!Play
You can use the play to play a sound in ink. To do this, you need to use the following syntax:
# play sound {alias} {source} {parameters}[parameters] (Optional): In theparametersyou must include the properties ofSoundPlayOptionsthat you want to set. Theparametersmust be set as follows:parameterName+SPACE+value. If thevalueis a string and includes spaces, you must use double quotes.
# play sound sfx_whoosh
Now the sfx_whoosh is singing.
# play sound sfx_whoosh volume 100
Now the sfx_whoosh is singing louder.Pause and resume
To pause a sound or a channel in ink, you can use the pause operation. To do this, you need to use the following syntax:
# pause {component type} {alias}To resume a sound or a channel in ink, you can use the resume operation. To do this, you need to use the following syntax:
# resume {component type} {alias}To pause or resume all sounds, you can use the following syntax:
# pause all sounds
# resume all sounds编辑
To edit a sound in ink, you can use the edit operation. To do this, you need to use the following syntax:
# edit sound {alias} {parameters}# edit sound bgm_cheerful volume 50
# edit sound bgm_cheerful loop falseStop
To stop a sound in ink, you can use the stop operation. To do this, you need to use the following syntax:
# stop sound {alias}# stop sound bgm_cheerfulTo stop all sounds, you can use the following syntax:
# stop all sounds