Skip to content

Commit

Permalink
fix command line parameters rate and channels
Browse files Browse the repository at this point in the history
  • Loading branch information
mzakharo committed Jul 26, 2022
1 parent 7b17df7 commit a39bcc8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions birdnetapp/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ def process(self, ts, data, mdata):
tic = time.time()
mdata['week'] = ts.isocalendar()[1]
data = np.frombuffer(data, dtype=np.int16)
data = data.reshape((-1, CHANNELS))
data = data.reshape((-1, self.stream.channels))
with tempfile.NamedTemporaryFile(suffix='.wav') as tmp:
fname = tmp.name
scipy.io.wavfile.write(fname, RATE, data)
scipy.io.wavfile.write(fname, self.stream.rate, data)
res = self.sendRequest(HOST, PORT, fname, json.dumps(mdata))
up = self.upload_result(ts, fname, SAVEDIR, res)
_LOGGER.debug(f'proces took: {time.time() - tic} seconds')
Expand Down
1 change: 1 addition & 0 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class Args:pass
class MocStream:
channels = 2
periodsize = 48000
rate = 48000


class DummyExecutor(Executor):
Expand Down

0 comments on commit a39bcc8

Please sign in to comment.