Skip to content

Commit

Permalink
feat: fix volume control
Browse files Browse the repository at this point in the history
  • Loading branch information
fucksophie committed Dec 29, 2024
1 parent bfdc749 commit e3e6911
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions audioengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void load(uintptr_t data, int length)
{
tsf_set_output(g_TinySoundFont, TSF_MONO, 44100, 0);
tsf_set_max_voices(g_TinySoundFont, 200);
tsf_set_volume(g_TinySoundFont, volume / 100);
tsf_set_volume(g_TinySoundFont, volume / 100.0f);
}
}

Expand Down Expand Up @@ -114,7 +114,7 @@ int get_volume()
void set_volume(int vol)
{
volume = vol;
tsf_set_volume(g_TinySoundFont, vol / 100);
tsf_set_volume(g_TinySoundFont, vol / 100.0f);
}

int start()
Expand Down
1 change: 0 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ uses [TinySoundFont](https://github.com/schellingb/TinySoundFont) and [emscripte
## bugs
1. The only major bug is the fact that it's still mono! There's a ongoing TSF issue, which I've reported is still happening.
2. Also, higher than 100-ish voice count crackles (we're using 200 voices for better blackmidi playback).. I have no clue how to fix this, maybe it's just a issue with how small the sample size for webaudio is (128 samples??).
3. Volume control is broken. Created a issue for this on the TSF repo.

## build
use (with emsdk activated and sourced)
Expand Down

0 comments on commit e3e6911

Please sign in to comment.