Skip to content

Two I2S Input to .wav #1966

Answered by pschatzmann
raviumadi asked this question in Q&A
Mar 17, 2025 · 4 comments · 19 replies
Discussion options

You must be logged in to vote

You would use 2 I2SStream and one EncodedAudioStream if you want to write to 1 file only. I think the easiest would be just to read one frame of each I2SStream and write it to the EncodedAudioStream.

Assuming you have bits_per_sample=16 it is something like this:

int16_t frame[2];
void loop() {
  i2s_1.read((uint8_t*) frame, sizeof(frame));
  wav.write((uint8_t*) frame, sizeof(frame))
  i2s_2.read((uint8_t*) frame, sizeof(frame));
  wav.write((uint8_t*) frame, sizeof(frame));
}

Replies: 4 comments 19 replies

Comment options

You must be logged in to vote
7 replies
@raviumadi
Comment options

@pschatzmann
Comment options

@raviumadi
Comment options

@pschatzmann
Comment options

@raviumadi
Comment options

Answer selected by pschatzmann
Comment options

You must be logged in to vote
2 replies
@raviumadi
Comment options

@pschatzmann
Comment options

Comment options

You must be logged in to vote
1 reply
@raviumadi
Comment options

Comment options

You must be logged in to vote
9 replies
@raviumadi
Comment options

@pschatzmann
Comment options

@raviumadi
Comment options

@pschatzmann
Comment options

@raviumadi
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants