2024-01-26 09:11 AM
Hello guys, I hope you're doing well, I'm currently trying to replicate a video I saw on YouTube about audio processing using stm, I'm just starting to develop for stm and I'm having some doubts, mainly in terms of libs. I'm trying to convert between int and float and I'm almost sure there's a lib that does this, in the video it uses INT16_TO_FLOAT and FLOAT_TO_INT16, do you know how I can use them? Below is a section of the video showing how they are used. Thanks in advance for your help.
leftIn = INT16_TO_FLOAT * inBufPtr[n];
outBufPtr[n] = (int16_t)(FLOAT_TO_INT16 * leftOut);
https://youtu.be/zlGSxZGwj-E?si=GQmDbewvicybIJrO&t=1049
Solved! Go to Solution.
2024-01-26 09:39 AM
There's no need to complicate this with typedefs.
int16_t x = 42;
float x2 = (float) x;
float y = 42.0f;
int16_t y2 = (int16_t) y;
2024-01-26 09:39 AM
There's no need to complicate this with typedefs.
int16_t x = 42;
float x2 = (float) x;
float y = 42.0f;
int16_t y2 = (int16_t) y;