Skip to content

Commit

Permalink
#51 Write to log
Browse files Browse the repository at this point in the history
  • Loading branch information
rbn42 committed Feb 21, 2021
1 parent 61b2373 commit ef5fca7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions panon/backend/source.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import numpy as np
from .. import logger
try:
import soundcard as sc
p = sc.pulseaudio._PulseAudio()
Expand All @@ -9,6 +10,7 @@
except:
pass


def binary2numpy(data, num_channel):
data = np.frombuffer(data, 'int16')
len_data = len(data) // num_channel
Expand Down Expand Up @@ -124,6 +126,7 @@ def update_smart_device(self, ):

if name is not None:
if not self.smart_device_id == name:
logger.log('update smart device: %s', name)
self.smart_device_id = name
for stream in self.streams:
stream.__exit__(None, None, None)
Expand Down

0 comments on commit ef5fca7

Please # to comment.