Distorted sound using sample method

16 views
Skip to first unread message

Tobia Bandini

unread,
May 2, 2026, 4:52:24 PMMay 2
to Mozzi-users
Hello,

I'm trying to build a project running Mozzi on an ESP-32 SUPERMINI.
So far, everything is working quite smoothly, and Mozzi seems to be a great library.

I'm encountering a weird issue when trying to reproduce custom made samples using the sample method in Mozzi.
I have exported my audio files as raw, headerless, signed 8 bit PCM, and I have converted them to the .h file using the char2python.py script.

Everything seems to work fine, but when I flash my sketch on my ESP-32 I only get very distorted sounds. I think the files are correct (meaning the temporal evolution of what I hear seems to be the same as the original file) but the sounds are completely mangled and unrecognisable. They sound like white noise bursts.

I'm not 100% sure of doing this right, but the problem seems to persist even with the .h files included in the Mozzi library, so I guess there must be some mistake in my sketch? I wanted to try to flash my ESP-32 with one of the example sketches to verify if that worked correctly, but I haven't figure out how to do that yet (as the example files are .ino).

I know for sure that my ESP-32 isn't faulty as the other audio engines I'm programming (based on the Mozzi FM and additional synthesis) just work fine.

Now, I'm pretty new to Mozzi so I don't really know how to better explain the issue or what other relevant information I could give you, but if anyone has any idea and wants to ask some questions, please just fire away and I'll try to answer you.

Thanks a lot.

Tobia

Mozzi-users

unread,
May 4, 2026, 7:47:23 PMMay 4
to Mozzi-users
Hi,
if you post your sketch that would help...  also I recommend making the effort to get examples to compile for you in whatever environment you're using.  Usually it's just something like renaming them .cpp and working out how to get the includes working.  A web search/ai summary will get you there, then you can incrementally change a working example, testing each step of the way...

Reply all
Reply to author
Forward
0 new messages