Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Infarcactus/Balatro-Custom-Sound-Player
Allows you to play custom sounds
https://github.com/Infarcactus/Balatro-Custom-Sound-Player
Last synced: about 1 month ago
JSON representation
Allows you to play custom sounds
- Host: GitHub
- URL: https://github.com/Infarcactus/Balatro-Custom-Sound-Player
- Owner: Infarcactus
- License: mit
- Created: 2024-03-21T23:04:01.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-05-20T18:51:12.000Z (7 months ago)
- Last Synced: 2024-08-02T00:22:47.119Z (5 months ago)
- Language: Lua
- Size: 443 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-Sound_Util
Awesome Lists containing this project
- awesome-balatro - JoJo's Tarots - 打出塔罗牌时会播放相应的 jojo 替身音效。 by [@infarctus](https://github.com/Infarcactus) (模组 (依赖 [**Steamodded**](https://github.com/Steamopollys/Steamodded)) / 功能)
README
# Balatro-Custom-Sound-Player
## This is for Steamodded 0.9 not 1.0, I already merged this project with 1.0
.mp3 can be used but it's not recommended please use .ogg or .wav
## FUNCTIONS
## register_sound_global(modID)
You give this function your modID and it'll search and load every sound in the `assets/sounds` folder next to your .lua file.
The name of every sound file will be the sound_code (without the extension) so for example TEST.ogg its sound_code is TEST (it's case sensitive)### Custom_Play_Sound(sound_code,stop_previous_instance, volume, pitch)
This is the main player of custom_sound everytime something plays a custom sound it calls this function.
Arguments :
- sound_code : the sound_code from the sound file you wanna play
- stop_previous_instace : set to false by default, if you wanna play a sound and it's already playing should we stop it to play the new one ?
- volume : set to 1 by default
- pitch : set to 1 by default## register_stop_sound(sound_code)
This functions directly interacts with the base game and stops the desired sound_code from the base game
Arguments :
- sound_code : the sound_code you wanna stop (it can be a single string or a table of strings)## register_temporary_stop_sound(sound_code,number_repeat)
Same as register_stop_sound but will only trigger the desired number of time
Arguments :
- sound_code : the sound_code you wanna stop (it can be a single string or a table of strings)
- number_repeat : the number of time we should keep it to stop sounds## register_replace_sound_played(replace_code_table)
This function also directly interacts with the base game but instead of completely stopping the sound from the base game, it stops it and plays a desired one instead
replace_code_table:
Structure of replace_code_table:
``{base_sound_code = "custom_sound_code"}`` if you don't want to customize the playing sound volume, pitch, etc
otherwise if you want to customize :
``{base_sound_code = {sound_code ="custom_sound_code",volume = X}}`` with each arguments can be an argument of Custom_Play_Sound(sound_code,stop_previous_instance, volume, pitch)
Plus continue_base_sound that can be set to true to still play the base sound_code after playing the custom one
A full one will look like this :
```lua
{
base_sound_code =
{
sound_code ="custom_sound_code",
stop_previous_instance = bool,
volume = X,
pitch=X,
continue_base_sound=bool
}
}
```## register_temporary_replace_sound_played(sound_code,number_repeat)
Same as register_replace_sound_played but will only trigger the desired number of time
Arguments :
- replace_code_table : same as register_replace_sound_played
- number_repeat : the number of time we should keep it to replace sounds## play_sound
play_sound is from the base game, it's modified non destructively to be able to do manipulation on it with Add_Custom_Stop_Sound or Add_Custom_Replace_Sound## modulate_sound
modulate_sound is from the base game it is what handles the music being played, it's modified non destructively to be able to do manipulation on it with Add_Custom_Stop_Sound or Add_Custom_Replace_Sound