Skip to content

Commit 225e07a

Browse files
authored
Merge pull request #112 from pimoroni/patch-noise-device
Fix audio capture for #91
2 parents 78c4703 + 599615d commit 225e07a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

library/enviroplus/noise.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ def get_noise_profile(self,
8383
def _record(self):
8484
return sounddevice.rec(
8585
int(self.duration * self.sample_rate),
86+
device='adau7002',
8687
samplerate=self.sample_rate,
8788
blocking=True,
8889
channels=1,

library/tests/test_noise.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def test_noise_get_amplitudes_at_frequency_ranges(sounddevice, numpy):
1717
(501, 1000)
1818
])
1919

20-
sounddevice.rec.assert_called_with(0.1 * 16000, samplerate=16000, blocking=True, channels=1, dtype='float64')
20+
sounddevice.rec.assert_called_with(0.1 * 16000, device='adau7002', samplerate=16000, blocking=True, channels=1, dtype='float64')
2121

2222

2323
def test_noise_get_noise_profile(sounddevice, numpy):
@@ -32,7 +32,7 @@ def test_noise_get_noise_profile(sounddevice, numpy):
3232
mid=0.36,
3333
high=None)
3434

35-
sounddevice.rec.assert_called_with(0.1 * 16000, samplerate=16000, blocking=True, channels=1, dtype='float64')
35+
sounddevice.rec.assert_called_with(0.1 * 16000, device='adau7002', samplerate=16000, blocking=True, channels=1, dtype='float64')
3636

3737
assert amp_total == 10.0
3838

0 commit comments

Comments
 (0)