Closed
Description
Currently in the library, if a zero frequency is specified to play_tone, a ValueError is thrown. In most other similar implementations, a value of 0 simply represents silence, or rest, for the duration specified. There is no reason for this implementation to be different. Also, this change is not likely to affect any user's existing code.
Current Code:
def play_tone(frequency, duration):
"""..."""
if frequency <= 0:
raise ValueError("The frequency has to be greater than 0.")
Suggested change:
def play_tone(frequency, duration):
"""..."""
if frequency < 0:
raise ValueError("Negative frequencies are not allowed.")
Metadata
Metadata
Assignees
Labels
No labels