schellingb / TinySoundFont

SoundFont2 synthesizer library in a single C/C++ file
MIT License
608 stars 71 forks source link

white noise unexpected sound when playing the files #58

Open cyrax50000 opened 3 years ago

cyrax50000 commented 3 years ago

Hello!

Thanks for this interesting library. It's really compact and for sure can be used in many projects. I had some strange problem when trying to run the examples on my old tv box, an allwinner a10 armhf system. The example1 works fine there. examples 2 and 3 do play the notes, but also some quite loud white noise plays in the background. I have also tried to use the tinysoundfont implementation from esp8266audio and got a similar problem there. A background whooshing sound goes together with every note played. On a regular x86_64 system it works perfectly. Any hints to solve this? thanks again...

kode54 commented 3 years ago

You may note that example1 outputs in signed integer 16 bit, while examples 2 and 3 output in floating point 32 bit, which your device may not handle properly.

cyrax50000 commented 3 years ago

Hello, Thanks for the reply. You were right, I have used tsf_render_short instead of float and now it's working. Have you seen the ESP library? There, they seem to be using some modified version of tsf_render_short already, so I can't see why a similar problem happens.