Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
#include <soc/i2s_reg.h>

//Set youy WiFi network name and password:
const char* ssid = "your_ssid";
const char* pswd = "your_password";
const char* ssid = "ssid";
const char* pswd = "password";

// Set your listener PC's IP here in according with your DHCP network. In my case is 192.168.1.40:
IPAddress udpAddress(192, 168, 1, 40);
IPAddress udpAddress(192, 168, 0, 158);
const int udpPort = 16500; //UDP Listener Port:

boolean connected = false; //UDP State:
Expand Down Expand Up @@ -101,7 +101,12 @@ volatile uint16_t rpt = 0; // Pointer

void i2s_mic()
{
int num_bytes_read = i2s_read_bytes(I2S_PORT, (char*)buffer + rpt, block_size, portMAX_DELAY);
size_t num_bytes_read;
int err = i2s_read(I2S_PORT, (char*)buffer + rpt, block_size, &num_bytes_read, portMAX_DELAY);
if (err != ESP_OK) {
Serial.printf("Failed to read i2s_mic: %d\n", err);
while (true);
}
rpt = rpt + num_bytes_read;
if (rpt > 2043) rpt = 0;
}
Expand Down