Skip to content

Commit

Permalink
Merge pull request #16 from linto-ai/bugfix/stereo
Browse files Browse the repository at this point in the history
Fix failure of stereo wav via the http server
  • Loading branch information
damienlaine authored Dec 21, 2022
2 parents f61a1ee + 50dc132 commit 4361300
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 4361300

Please sign in to comment.