icculus / SDL_sound

An abstract soundfile decoder.
https://icculus.org/SDL_sound/
Other
149 stars 28 forks source link

Reading timidity soundfont from SDL_rwops #69

Open ericoporto opened 2 years ago

ericoporto commented 2 years ago

Hey, I understand we can pass a soundfont path through an environment variable or SDL_setenv, but is it possible to pass a stream so I could find a soundfont inside a game package - using SDL_rwops or some way to pass the location in memory. Is something like this possible?

ericoporto commented 1 year ago

Actually it appears timidity already uses SDL_rwops internally. I think the only change is here

https://github.com/icculus/SDL_sound/blob/9bdc56c2791ca8a98bd7838d6f17346c1e848a94/src/timidity/common.c#L36

Instead, if there was some way to pass SDL_rwops or some method to pass a callback to replace timi_openfile, then it all would workout!

We could use our own asset loading functions, which we can use then for loading from a diverse set of packages - essentially, it would be possible to make a game with it's own soundfont and also handle asset replacement with our own standard behavior.

ericoporto commented 2 months ago

Other thing that would be great would be to use the SDL hint system somehow instead of SDL_setenv.

An additional issue is the Timidity fork used here has the "joined' file support currently broken - explained by an user here