[29/Jun/2023 20:53:26] "POST /pronunce/word/ HTTP/1.1" 500 102618
Internal Server Error: /pronunce/word/
Traceback (most recent call last):
File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\core\handlers\exception.py", line 55, in inner
response = get_response(request)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\core\handlers\base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\Desktop\-\프로젝트\-\project\project\AI_8_30\bp_django\pronunce\views.py", line 52, in word_pronunciation_view
pronunciation_result = measure_pronunciation_accuracy(audio_file, word)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\Desktop\-\프로젝트\-\project\project\AI_8_30\bp_django\pronunce\views.py", line 27, in measure_pronunciation_accuracy
speech_recognizer = speechsdk.SpeechRecognizer(speech_config=speech_config, audio_config=audio_config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\azure\cognitiveservices\speech\speech.py", line 1006, in __init__
_call_hr_fn(
File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\azure\cognitiveservices\speech\interop.py", line 62, in _call_hr_fn
_raise_if_failed(hr)
File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\azure\cognitiveservices\speech\interop.py", line 55, in _raise_if_failed
__try_get_error(_spx_handle(hr))
File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\azure\cognitiveservices\speech\interop.py", line 50, in __try_get_error
raise RuntimeError(message)
RuntimeError: Exception with error code:
[CALL STACK BEGIN]
> pal_string_to_wstring
- pal_string_to_wstring
- pal_string_to_wstring
- pal_string_to_wstring
- pal_string_to_wstring
- pal_string_to_wstring
- pal_string_to_wstring
- pal_string_to_wstring
- pal_string_to_wstring
- pal_string_to_wstring
- pal_string_to_wstring
- pal_string_to_wstring
- pal_string_to_wstring
- pal_string_to_wstring
- recognizer_create_speech_recognizer_from_config
- recognizer_create_speech_recognizer_from_config
[CALL STACK END]
Exception with an error code: 0xa (SPXERR_INVALID_HEADER)
뭔데 이거..... 난생 처음보는 에러
나는 프론트 팀이었고 백엔드 팀에서 azure-cognitiveservices-speech 를 사용해서 리턴해준 파일의 발음 정확도를 사용해야 했는데
친구가 쓸 때는 문제가 없다가 내가 쓰니까 갑자기 저런 에러가 뜨는 거시다
에러 해결할 시간이 많이 없어서 진땀뺐다
백팀 친구에게 물음표 살인마마냥 질문하면서 하나하나 상황 배제해가며 해결했다
- 해결방법
1. .env 파일 경로 확인
AZURE_SUBSCRIPTION_KEY 를 .env 파일에 저장해두었다면 그 경로를 잘 살펴본다
나 같은 경우는 백팀 친구랑 저장해놓은 경로가 달랐다
2. 음성 파일 확장자 확인
처음에 .m4a 전달해줬을 때는 저 에러 그대로 떴음
.wav 전달해주니 잘 됨
'개발' 카테고리의 다른 글
wsl 에서 USB 사용하기 | USB use in wsl, USB Mount (0) | 2024.11.26 |
---|---|
대상 컴퓨터에서 연결을 거부했으므로 연결하지 못했습니다 (0) | 2023.06.29 |