Skip to content

Commit eb4d3d6

Browse files
authored
Merge pull request #53 from karengineering/patch-1
removing 2.0 code
2 parents 84ec65b + a063ae3 commit eb4d3d6

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

adafruit_circuitplayground/express.py

+3-8
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ def _generate_sample(self, length=100):
577577
self._sample = audioio.AudioOut(board.SPEAKER)
578578
self._sine_wave_sample = audioio.RawSample(self._sine_wave)
579579
else:
580-
self._sample = audioio.AudioOut(board.SPEAKER, self._sine_wave)
580+
raise NotImplementedError("Please use CircuitPython 3.0 or higher.")
581581

582582

583583
def play_tone(self, frequency, duration):
@@ -633,9 +633,7 @@ def start_tone(self, frequency):
633633
if not self._sample.playing:
634634
self._sample.play(self._sine_wave_sample, loop=True)
635635
else:
636-
self._sample.frequency = int(len(self._sine_wave) * frequency)
637-
if not self._sample.playing:
638-
self._sample.play(loop=True)
636+
raise NotImplementedError("Please use CircuitPython 3.0 or higher.")
639637

640638
def stop_tone(self):
641639
""" Use with start_tone to stop the tone produced.
@@ -690,10 +688,7 @@ def play_file(self, file_name):
690688
while audio.playing:
691689
pass
692690
else:
693-
with audioio.AudioOut(board.SPEAKER, open(file_name, "rb")) as audio:
694-
audio.play()
695-
while audio.playing:
696-
pass
691+
raise NotImplementedError("Please use CircuitPython 3.0 or higher.")
697692
self._speaker_enable.value = False
698693

699694

0 commit comments

Comments
 (0)