ArduinoSound - AudioInI2S.channels()

Description

Query the number of channels of the I2S input

Syntax

AudioInI2S.channels();

Returns

Current number of channels of the I2S interface. This is always return 2, as I2S is configured for stereo

Example


  // setup the I2S audio input for 44.1 kHz with 32-bits per sample
  if (!AudioInI2S.begin(44100, 32)) {
    Serial.println("Failed to initialize I2S input!");
    while (1); // do nothing
  }

  Serial.print(“sample rate = “);
  Serial.println(AudioInI2S.sampleRate()); // prints out the sample rate used in begin(...)
  Serial.print(“bit per sample = “);
  Serial.println(AudioInI2S.bitsPerSample()); // prints out the bits per sample rate used  in begin(...)
  Serial.print(“channels = “);
  Serial.println(AudioInI2S.channels()); // prints out 2, I2S always has 2 channels