realnc / SDL_audiolib

An audio decoding, resampling and mixing library for SDL.
GNU Lesser General Public License v3.0
43 stars 8 forks source link

Integer mode #40

Open glebm opened 1 year ago

glebm commented 1 year ago

We kept optimizing DevilutionX and it go to the point where I managed to run it on a device with no FPU (RG-99 handheld). It runs OK without audio, but enabling audio is costly.

Since the device has no FPU, I was wondering if it would be possible to add an integer mode to SDL_audiolib, at least for WAV files?

dr_wav does seem to have an option for it (drwav_read_pcm_frames_s32 instead of drwav_read_pcm_frames_f32)

/cc @AJenbo

glebm commented 1 year ago

How about making Decoder etc templated on the data type?

glebm commented 1 year ago

I've tried starting on the templated approach here; unfinished and it's a lot of mechanical changes #41

Perhaps the buffers should be 4-byte aligned and untyped instead. Then the decoder be made to accept the data type at construction.