i2s stream into Maximilian #1338
-
Is it possible to take the two channels of an i2s input, and port them into maximilian as separate objects? Then after processing, port them back to the i2s for output? Say, if I wanted to amplitude modulate my left channel with my right channel, and then send them back to the i2s port? Also, does maximilian support other operators other than * ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This should not be too difficult: Just open the I2SStream with RXTX_MODE. Then you can also read the values from it. All you have to do yourself is to convert the values to float! If you have stereo 16 bits data, you can do something like this float* readFloat(Stream &in, float volume=1.0){
static float result[2];
int16_t in_data[2];
result[0] = 0.0f;
result[1] = 0.0f;
int bytes = 2*sizeof(int16_t);
if (in.readBytes((uint8_t*)in_data, bytes)==bytes){
result[0] = static_cast<float>(in_data[0]) / 32768.0 * volume;
result[1] = static_cast<float>(in_data[1]) / 32768.0 * volume;
}
return result;
} |
Beta Was this translation helpful? Give feedback.
This should not be too difficult: Just open the I2SStream with RXTX_MODE. Then you can also read the values from it. All you have to do yourself is to convert the values to float!
If you have stereo 16 bits data, you can do something like this