ArduinoSound - AudioOutI2S.canPlay()

Description

Check if the specified input can be played out using I2S

Syntax

AudioOutI2S.canPlay(input);

Parameters

input: input to check (type AudioIn)

Returns

1 in the input can be played using play() or loop(), 0 otherwise

Example


  // check if the I2S output can play the Audio input
  if (!AudioOutI2S.canPlay(audioInput)) {
    Serial.println("unable to play audio input using I2S!");
    while (1); // do nothing
  }

  // start playback
  Serial.println("starting playback");
  AudioOutI2S.play(audioInput);