Skip to content

Commit

Permalink
chore: update microphone driver to use latest i2s interface
Browse files Browse the repository at this point in the history
Signed-off-by: deadprogram <[email protected]>
  • Loading branch information
deadprogram committed Dec 18, 2024
1 parent 019bbbe commit 0623bb4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions microphone/microphone.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (d *Device) Read(r []int32) (int, error) {
count := len(r)

// get the next group of samples
machine.I2S0.Read(d.buf)
machine.I2S0.ReadStereo(d.buf)

if len(r) > len(d.buf) {
count = len(d.buf)
Expand All @@ -83,7 +83,7 @@ func (d *Device) ReadWithFilter(r []int32) (int, error) {
for i := 0; i < len(r); i++ {

// get the next group of samples
machine.I2S0.Read(d.buf)
machine.I2S0.ReadStereo(d.buf)

// filter
sum = applySincFilter(d.buf)
Expand Down

0 comments on commit 0623bb4

Please sign in to comment.