voicechat2 icon indicating copy to clipboard operation
voicechat2 copied to clipboard

ValueError: Soundfile is either not in the correct format or is malformed. Ensure that the soundfile has a valid audio file extension (e.g. wav, flac or mp3) and is not corrupted.

Open Pratik-Ghute opened this issue 9 months ago • 7 comments

SRT-SERVER : ValueError: Soundfile is either not in the correct format or is malformed. Ensure that the soundfile has a valid audio file extension (e.g. wav, flac or mp3) and is not corrupted. If reading from a remote URL, ensure that the URL is the full address to download the audio file.

Voicechat2-app : ERROR:voicechat2:Transcription error: 500, message='Attempt to decode JSON with unexpected mimetype: text/plain; charset=utf-8', url='http://localhost:8001/inference' ERROR:voicechat2:Traceback (most recent call last): File "/home/ubuntu/call_voicebot/voicechat2/voicechat2.py", line 155, in transcribe_audio result = await response.json() ^^^^^^^^^^^^^^^^^^^^^ File "/home/ubuntu/miniconda3/envs/voicechat2/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1281, in json raise ContentTypeError( aiohttp.client_exceptions.ContentTypeError: 500, message='Attempt to decode JSON with unexpected mimetype: text/plain; charset=utf-8', url='http://localhost:8001/inference'

ERROR:voicechat2:Error during processing: 500, message='Attempt to decode JSON with unexpected mimetype: text/plain; charset=utf-8', url='http://localhost:8001/inference' ERROR:voicechat2:Traceback (most recent call last): File "/home/ubuntu/call_voicebot/voicechat2/voicechat2.py", line 209, in websocket_endpoint text = await transcribe_audio(audio_data, session_id, turn_id) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/ubuntu/call_voicebot/voicechat2/voicechat2.py", line 155, in transcribe_audio result = await response.json() ^^^^^^^^^^^^^^^^^^^^^ File "/home/ubuntu/miniconda3/envs/voicechat2/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1281, in json raise ContentTypeError( aiohttp.client_exceptions.ContentTypeError: 500, message='Attempt to decode JSON with unexpected mimetype: text/plain; charset=utf-8', url='http://localhost:8001/inference'

Pratik-Ghute avatar Mar 21 '25 10:03 Pratik-Ghute

This is due to the above script not being available now, any replaceable alternative available? anyone has solved this please do let me know

Pratik-Ghute avatar Mar 21 '25 13:03 Pratik-Ghute

Same problem for me. Have you found the solution? Thanks

hungpv297 avatar Mar 22 '25 16:03 hungpv297

The issue is that https://cdn.jsdelivr.net/npm/[email protected]/src/recorder.min.js seems to have a hard-coded dependency to: https://symbl-sdk-cdn-bucket.storage.googleapis.com/js/ga/symbl-opus-encdec/0.1.2/dist/encoderWorker.min.js

You can host your own version that points to your own, or you might be able to try out something like https://www.jsdelivr.com/package/npm/opus-recorder

lhl avatar Mar 23 '25 19:03 lhl

Thank you for your help! it worked for me and indeed you have done some great work!

Pratik-Ghute avatar Mar 24 '25 09:03 Pratik-Ghute

@Pratik-Ghute How can you fix it? Thanks in advance!

hungpv297 avatar Mar 24 '25 10:03 hungpv297

@hungpv297 Here's an example of how to add the static file to the same server hosting the vc2: https://github.com/bradgrimm/voicechat2/pull/1

The main gist of it is...

Serve statically:

app.mount("/static", StaticFiles(directory="static"), name="static")

Place the missing file encoderWorker.min.js in the static directory.

Point to the new file:

recorder = new Recorder({
    ...config,
    encoderPath: '/static/js/encoderWorker.min.js'
});

bradgrimm avatar May 09 '25 22:05 bradgrimm

The issue is that https://cdn.jsdelivr.net/npm/[email protected]/src/recorder.min.js seems to have a hard-coded dependency to: https://symbl-sdk-cdn-bucket.storage.googleapis.com/js/ga/symbl-opus-encdec/0.1.2/dist/encoderWorker.min.js

You can host your own version that points to your own, or you might be able to try out something like https://www.jsdelivr.com/package/npm/opus-recorder

Hii ihl, Can you please suggest changes in index.html file.

shailendrakumar604 avatar Jun 26 '25 00:06 shailendrakumar604