Skip to content

Commit e3e6911

Browse files
committed
feat: fix volume control
1 parent bfdc749 commit e3e6911

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

audioengine.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void load(uintptr_t data, int length)
4040
{
4141
tsf_set_output(g_TinySoundFont, TSF_MONO, 44100, 0);
4242
tsf_set_max_voices(g_TinySoundFont, 200);
43-
tsf_set_volume(g_TinySoundFont, volume / 100);
43+
tsf_set_volume(g_TinySoundFont, volume / 100.0f);
4444
}
4545
}
4646

@@ -114,7 +114,7 @@ int get_volume()
114114
void set_volume(int vol)
115115
{
116116
volume = vol;
117-
tsf_set_volume(g_TinySoundFont, vol / 100);
117+
tsf_set_volume(g_TinySoundFont, vol / 100.0f);
118118
}
119119

120120
int start()

readme.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ uses [TinySoundFont](https://github.com/schellingb/TinySoundFont) and [emscripte
1313
## bugs
1414
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.
1515
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??).
16-
3. Volume control is broken. Created a issue for this on the TSF repo.
1716

1817
## build
1918
use (with emsdk activated and sourced)

0 commit comments

Comments
 (0)