Komut
sampleRate()
Açıklama
I2S girişinin örnek hızını sorgulayın
Sözdizimi
AudioInI2S .sampleRate ();
İadeler
Hz cinsinden I2S arayüzünün mevcut örnek oranı.
Misal
…
// 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
…
// 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
…