Skip to content

Commit

Permalink
add local import for websockets (VoskAudioRecognizer)
Browse files Browse the repository at this point in the history
  • Loading branch information
HadronCollider committed Mar 31, 2024
1 parent c82a185 commit 0dbb056
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/audio_recognizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import wave

import requests
import websockets

from app import utils
from app.recognized_audio import RecognizedAudio
Expand Down Expand Up @@ -101,6 +100,7 @@ def recognize(self, audio):

async def send_audio_to_recognizer(self, file_name):
recognizer_results = []
import websockets
async with websockets.connect(self._host) as websocket:
wf = wave.open(file_name, "rb")
await websocket.send('''{"config" : { "sample_rate" : 8000.0 }}''')
Expand Down

0 comments on commit 0dbb056

Please sign in to comment.