What is the correct format for audio samples in the STK "Drummer"? #1196
-
Hi everyone. Great community here, already solved several problems by digging through old threads. Thanks Phil, for being so helpful. I'm working on an electronic drum kit, based on the ESP32 and using the Audio-tools library, but I need to add several samples with other drum sounds to the STK "Drummer". I'm able to add samples by putting them in the file structure of the library, and then making a few changes to "Drummer.h", "Drummer.cpp" and "all.h". The problem is that the library needs samples in "uint16 in 1 channel at 22050 Hz" (information that I found in the library file "MemoryWvin.h") and I haven't found a way to make these files. I'm able to use samples in other formats, but they just sound like terrible screeching and scratching when played. Here's how I currently make my sample files (in Linux): Hope someone has a viable way to do this. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
I think 16 bits signed is what you need! There is also some information in the Wiki |
Beta Was this translation helpful? Give feedback.
-
Hi Phil. Thanks for getting back to me.
/ It seems to specifically be asking for "uint16", which would be unsigned, right? |
Beta Was this translation helpful? Give feedback.
-
You could write your own small conversion tool which just reads the signed values (-32768 to 32767) and adds 32768 to convert them to unsigned (0 to 65535). |
Beta Was this translation helpful? Give feedback.
-
When you try to import the data (e.g. bassdrum.raw) from the rawwaves directory into Audacity, you will see that it's signed 16 bit, big endian, mono! So you need to convert your data from little to big endian! |
Beta Was this translation helpful? Give feedback.
I think 16 bits signed is what you need! There is also some information in the Wiki