void app_main(void)
{
	static const int i2s_num = 0; // i2s port number

	static const i2s_config_t i2s_config =
	{
	    .mode = I2S_MODE_MASTER | I2S_MODE_RX | I2S_MODE_ADC_BUILT_IN,
	    .sample_rate = 16000,
	    .bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT,
	    .channel_format = I2S_CHANNEL_FMT_ONLY_LEFT,
	    .communication_format = I2S_COMM_FORMAT_I2S,
	    .intr_alloc_flags = 0, // default interrupt priority
	    .dma_buf_count = 8,
	    .dma_buf_len = NUM_OF_SAMPLES,
	    .use_apll = false,
		.fixed_mclk = 0,
		.tx_desc_auto_clear = false,
	};

	i2s_driver_install(i2s_num, &i2s_config, 0, NULL);   //install and start i2s driver

	i2s_set_adc_mode(ADC_UNIT_1, ADC1_CHANNEL_4);

	i2s_adc_enable(i2s_num);

	size_t bytes_read = 0;
	uint16_t i2s_read_buff[NUM_OF_SAMPLES];

	while(1)
	{
		i2s_read(i2s_num, (void*) i2s_read_buff, NUM_OF_SAMPLES * sizeof(uint16_t), &bytes_read, portMAX_DELAY);

		for(size_t i = 0; i < NUM_OF_SAMPLES; i++)
		{
			printf("%d ", i2s_read_buff[i]);
			if( (i != 0) && (i%10 == 0) )
			{
				printf("\n");
			}
		}
		vTaskDelay(pdMS_TO_TICKS(1000));
	}
}