Skip to content

Commit

Permalink
Adding trouble shooting section
Browse files Browse the repository at this point in the history
  • Loading branch information
sheaivey authored Sep 2, 2024
1 parent 024c862 commit c5e1e33
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion AudioInI2S.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ Checkout the `examples/Basic` example folder for audio analysis.
#define WS_PIN 39 // WS pin from the mic.
#define DATA_PIN 5 // Data pin from the mic.
#define CHANNEL_SELECT_PIN 40 // Pin to select the channel output from the mic.
// Some Mic's have a pin that lets you choose which I2S_CHANNEL_FMT_ONLY_LEFT
// or I2S_CHANNEL_FMT_ONLY_RIGHT the data is sent on. It is best to not leave
// this pin floating if your mic does have this feature (Tie it to ground or
// use this CHANNEL_SELECT_PIN pin).

AudioInI2S mic(BCK_PIN, WS_PIN, DATA_PIN, CHANNEL_SELECT_PIN); // defaults to RIGHT channel.
AudioInI2S mic(BCK_PIN, WS_PIN, DATA_PIN, CHANNEL_SELECT_PIN, I2S_CHANNEL_FMT_ONLY_RIGHT); // defaults to RIGHT channel.

int32_t samples[SAMPLE_SIZE]; // I2S sample data is stored here

Expand All @@ -47,5 +51,11 @@ void loop() {
}
```
## Trouble Shooting
* Samples only filled with zeros
* Make sure you are reading the correct left or right channel data from your mic. `I2S_CHANNEL_FMT_ONLY_LEFT` or `I2S_CHANNEL_FMT_ONLY_RIGHT`
* Samples randomly read zeros
* Your MEMS Microphone might have a channel select pin which is floating and needs to be tied to ground or assigned a pin from the esp32.
## Licensing
MIT Open Source - Free to use anywhere.

0 comments on commit c5e1e33

Please sign in to comment.