Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

bitsy

a little engine for little games, worlds, and stories · By adam le doux

Help with adding music in Bitsy 8.7

A topic by raven created Sep 23, 2023 Views: 1,459 Replies: 4
Viewing posts 1 to 3

Hi! I have been trying for the past couple of days to add external music to a Bitsy 8.7 game I have made, but nothing seems to work. I've been trying:

- The kooltools bitsy hack https://kool.tools/bitsy/tools/bitsymuse-ui/, which I found through watching this tutorial  (I also watched one about borksy)  www.youtube.com/watch?v=VyVA2qAEFoA&t=3s - however, this did not work, and the tutorial seems to be demonstating on an older bitsy version.

-Using borksy to add the bitsymuse hack.

-Opening the games script using chrome > developer tools and adding the Github 'bitsymuse' hack in.

-  Candle's tool to add one audio to the game https://candle.itch.io/bitsy-audio (I would prefer multiple room audios but wanted to see if I could make any external music work!)


After downloading the 'hacked html' file in each case, I put it in a folder also containing the .mp3 or .wav music files (tried with both) and then opened it. However, nothing seemed to work. To be honest, I have next to no coding knowledge so I am 98% sure these are not working due to my own errors and misinterpreting instructions. 

I wondered if anyone had any tips, tutorials or advice as to how to make this work? Or other places to seek advice?

If so, thank you so much! If this is the wrong place to ask, sorry! 

This is tips & help, very much the right place to ask!

I did a quick test game/audio just to check since I haven't made anything with 8.7 yet, and I can confirm that the bitsymuse hack via borksy installation still works, so no worries! You will be able to assign music to multiple rooms, we just need to figure out where the issue is.

(However, I was unable to get the bitsy muse ui or bitsy audio 1 track version to work. But also I've also never used these before, so perhaps someone who has could weigh in on that)

Some things to look for when troubleshooting:

1) Is it playing zero sound, or just not the music? If it's not even making the interaction bleep bloops (professional term), the issue might be with something else.

2) Have you doublechecked that you haven't mistyped the names of the audio files in the hackOptions section of bitsymuse (or the Options section if you did it directly on Borksy)?

3) Did you remember to set the files to play in the rooms you wanted in the audio id mappings section?

If none of this helps or makes sense, open your hacked game html file in notepad, search for "var hackOptions" with no quotes, copy from there down to where it says "(doesn't affect sound effects)"  and paste it into a reply here and we'll see if we can't figure out what's going on.

Hi! thank you so so much for your help and replying :). It turns out I was misspelling some of the file names, and then was putting the hack-code in the wrong place (I think it was somewhere in system?).  It's all good and working now! :)

Glad to hear it!

(2 edits)

Rise from your grave, old thread!


So I was having the same issue and it led me to this thread. I got music to work but only if I opened the hacked .html file in my browser. If I try and run it through the Bitsy editor or Bitsy Savior, it doesn't play the music. Is that intentional?

Here are my hackOptions. I put the mp3 in the same directory as the hacked .html file.

var hackOptions = {
    // Put entries in this list for each audio file you want to use
    // the key will be the id needed to play it in dialog tags and the musicByRoom options below,
    // and the value will be the properties of the corresponding <audio> tag (e.g. src, loop, volume)
    // `src` can be either a string, or an array of strings (to support fallbacks in different formats)
    // Note: you can add <audio> tags to the html manually if you prefer
    audio: {
        // Note: the entries below are examples that should be removed and replaced with your own audio files
        'siltStrider': { src: './Silt Strider.mp3', loop: true },
        // 'example sfx ID': { src: './example sfx filepath.mp3', volume: 0.5 },
        // 'example with multiple formats': { src: ['./preferred.mp3', './fallback.ogg'] },
    },
    // Put entries in this list for every room ID or name that will change the music
    // If the player moves between rooms with the same audio ID, the music keeps playing seamlessly.
    // Undefined rooms will keep playing whatever music they were last playing
    musicByRoom: {
        // Note: the entries below are examples that should be removed and replaced with your own room -> audio id mappings
        0: 'siltStrider',
        1: 'S', // This room is silent - it will stop music when you enter (see `silenceId` below)
        2: 'another song ID',
        h: 'a song ID for a room with a non-numeric ID',
        'my room': 'a song ID for a room with a user-defined name',
    },
    silenceId: 'S', // Use this song ID to make a room fall silent.
    resume: false, // If true, songs will pause/resume on change; otherwise, they'll stop/play (doesn't affect sound effects)
};