Audio 파일 Encoding시 Config 맞추기
Opened this issue · 0 comments
JinHyukParkk commented
문제사항
Google speech API를 사용하면서 audio 파일을 request 할 때 "400 error " 가 response 된다면
해결
error에 대해 검색해보니 이러한 Troubleshooting에 다룬 페이지가 GCP 사이트에 있었다.
https://cloud.google.com/speech/support
-> 내용을 읽으면서 audio파일 형식과 Encoding에 대해 공부할 필요성을 느꼈다.
시연
- Audacity를 이용하여 flac형식의 녹음 파일(모노)을 만든다.
- 파일의 config는 default로 channel: 2, Samplerate: 44100으로 되있으므로 SoX를 사용하여 해당 녹음파일의 config를 변경해준다.
example): sox --channels=2 --bits=16 --rate=44100 --encoding=signed-integer --endian=little [변경할파일] --channels=1 --bits=16 --rate=16000 [변경 후 파일] - curl이나 speech API를 사용하여 확인.