#define NumberofSamples 8 #define audio_in_Pin 32 int Samplefrequency=44100; int sampling_period = round(1000000*(1.0/Samplefrequency)); int ADCValue[8]; void setup(){ Serial.begin(115200); } void loop(){ for (int i=0 ; i < NumberofSamples; i++) { unsigned long newTime= micros(); ADCValue[i]=analogRead(audio_in_Pin); while( micros() < newTime+ sampling_period ){ // do nothing} } // now the buffer ADCValue is filled with 8 samples of ADC // data that was sampled at 10 Khz // now you can process your audio samples for(int i=0;i