Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion examples/galactic_unicorn/audio/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def __stop_i2s(self):
if self.__audio_out is not None:
self.__audio_out.deinit() # Deinit any active I2S comms

self.__state == WavPlayer.NONE # Return to the none state
self.__state = WavPlayer.NONE # Return to the none state

def __i2s_callback(self, arg):
# PLAY
Expand All @@ -198,6 +198,7 @@ def __i2s_callback(self, arg):
# Do we want to loop the WAV playback?
if self.__loop_wav:
_ = self.__wav_file.seek(self.__first_sample_offset) # Play again, so advance to first byte of sample data
self.total_bytes_read = 0 # Reset for looping
else:
self.__wav_file.close() # Stop playing, so close the file
self.__state = WavPlayer.FLUSH # and enter the flush state on the next callback
Expand Down