Browse Source

some fixes

Andrey Sobolev 7 months ago
parent
commit
b51004d27f
1 changed files with 3 additions and 0 deletions
  1. 3 0
      controllers/sound.py

+ 3 - 0
controllers/sound.py

@@ -148,6 +148,7 @@ class SoundController:
                 time.sleep(0.05)
                 
         stream.stop()
+        stream.close()
         print('Sound stopped')
 
         
@@ -190,6 +191,7 @@ class ContinuousSoundStream:
             self.stream.write(self.data[start_idx:end_idx])
             
         self.stream.stop()
+        self.stream.close()
         
         
 class SoundControllerPR:
@@ -289,3 +291,4 @@ class SoundControllerPR:
         for t in self.timers:
             t.cancel()
         self.stream.stop()
+        self.stream.close()