Skip to content

Commit

Permalink
Fix stereo -> mono conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
pseudotensor committed Sep 20, 2024
1 parent aff4fa0 commit 94323f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/stt.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ def transcribe(audio_state1, new_chunk, transcriber=None, max_chunks=None, sst_f
else:
# stereo to mono if needed
if len(y.shape) > 1:
y = np.mean(y, axis=0)
if y.shape[0] == 2:
y = np.mean(y, axis=0)
else:
y = np.mean(y, axis=1)
avg = np.average(np.abs(y))
if not np.isfinite(avg):
avg = 0.0
Expand Down
2 changes: 1 addition & 1 deletion src/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "650070ba7297971f59e8f493fc9af52c0082fd50"
__version__ = "aff4fa0a307fb3e81296826b6c41353c8820bc09"

0 comments on commit 94323f7

Please sign in to comment.