Skip to content

Commit dd3b5a3

Browse files
committed
Removing duplicate code.
1 parent 36bbb56 commit dd3b5a3

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

adafruit_circuitplayground/circuit_playground_base.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -709,16 +709,12 @@ def _generate_sample(self, length=100, waveform="sine"):
709709
return
710710
if waveform == "square":
711711
self._wave = array.array("H", self._square_sample(length))
712-
self._sample = self._audio_out( # pylint: disable=not-callable
713-
board.SPEAKER
714-
)
715-
self._wave_sample = audiocore.RawSample(self._wave)
716712
else:
717713
self._wave = array.array("H", self._sine_sample(length))
718-
self._sample = self._audio_out( # pylint: disable=not-callable
719-
board.SPEAKER
720-
)
721-
self._wave_sample = audiocore.RawSample(self._wave)
714+
self._sample = self._audio_out( # pylint: disable=not-callable
715+
board.SPEAKER
716+
)
717+
self._wave_sample = audiocore.RawSample(self._wave)
722718

723719
def play_tone(self, frequency, duration, waveform="sine"):
724720
"""Produce a tone using the speaker. Try changing frequency to change

0 commit comments

Comments
 (0)