Skip to content

Commit

Permalink
Fix stereo to mono conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Jérôme Louradour committed Dec 21, 2022
1 parent f61a1ee commit 50dc132
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 3.3.2
- Fixed use of stereo audio in http serving mode

# 3.3.1
- Fixed lin_to_vosk throwing an error on a already existing container.
- Corrected an error on the README regarding mounting model volumes.
Expand Down
4 changes: 3 additions & 1 deletion stt/processing/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def formatAudio(file_buffer):
if file_content.data.shape[1] == 1:
data = squeeze(file_content.data)
elif file_content.data.shape[1] == 2:
data = mean(data, axis=1, dtype=int16)
data = mean(file_content.data, axis=1, dtype=int16)
else:
raise Exception("Audio Format not supported.")
return data.tobytes(), file_content.rate
raise Exception("Audio Format not supported.")

0 comments on commit 50dc132

Please sign in to comment.