1
- # The MIT License (MIT)
1
+ # SPDX-FileCopyrightText: 2016 Scott Shawcroft for Adafruit Industries
2
+ # SPDX-FileCopyrightText: 2017-2019 Kattni Rembor for Adafruit Industries
2
3
#
3
- # Copyright (c) 2016 Scott Shawcroft for Adafruit Industries
4
- # Copyright (c) 2017-2019 Kattni Rembor for Adafruit Industries
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in
14
- # all copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- # THE SOFTWARE.
4
+ # SPDX-License-Identifier: MIT
23
5
24
6
# We have a lot of attributes for this complex library, as well as a lot of documentation.
25
7
# pylint: disable=too-many-instance-attributes, too-many-lines
@@ -661,7 +643,7 @@ def _generate_sample(self, length=100):
661
643
self ._sine_wave_sample = audiocore .RawSample (self ._sine_wave )
662
644
663
645
def play_tone (self , frequency , duration ):
664
- """ Produce a tone using the speaker. Try changing frequency to change
646
+ """Produce a tone using the speaker. Try changing frequency to change
665
647
the pitch of the tone.
666
648
667
649
:param int frequency: The frequency of the tone in Hz
@@ -684,7 +666,7 @@ def play_tone(self, frequency, duration):
684
666
self .stop_tone ()
685
667
686
668
def start_tone (self , frequency ):
687
- """ Produce a tone using the speaker. Try changing frequency to change
669
+ """Produce a tone using the speaker. Try changing frequency to change
688
670
the pitch of the tone.
689
671
690
672
:param int frequency: The frequency of the tone in Hz
@@ -717,7 +699,7 @@ def start_tone(self, frequency):
717
699
self ._sample .play (self ._sine_wave_sample , loop = True )
718
700
719
701
def stop_tone (self ):
720
- """ Use with start_tone to stop the tone produced.
702
+ """Use with start_tone to stop the tone produced.
721
703
722
704
.. image :: ../docs/_static/speaker.jpg
723
705
:alt: Onboard speaker
@@ -744,7 +726,7 @@ def stop_tone(self):
744
726
self ._speaker_enable .value = False
745
727
746
728
def play_file (self , file_name ):
747
- """ Play a .wav file using the onboard speaker.
729
+ """Play a .wav file using the onboard speaker.
748
730
749
731
:param file_name: The name of your .wav file in quotation marks including .wav
750
732
0 commit comments