[Python Error] google.api_core.exceptions.InvalidArgument: 400 Specify MP3 encoding to match audio file.

2021. 3. 19. 12:11·Error code 모음/4. Python errors
반응형

 

1. 에러 원인


해당 에러는 google Speech to Text api 를 사용할 때 나타났었다.

STT 라이브러리 사용시 지원하지 않는 인코딩 포멧을 사용할 경우 나타나는 에러였던 것 같다

 

 

 

 

 

 

2. 해결 방법


나의 경우에는 파이썬 스크립트의 인코딩 설정을 

LINEAR16  --> ENCODING_UNSPECIFIED 으로 바꾸어주었더니 해결이 되었다.

아래와 같이 말이다

 

# 리스트 오디오 인식 config
audio_config = speech.RecognitionConfig(
      encoding = speech.RecognitionConfig.AudioEncoding.ENCODING_UNSPECIFIED,
      sample_rate_hertz=16000,
      language_code='en-US',
)

 

하지만 STACK OVERFLOW의 다른 해결방법에는 

인코딩을 다시해서 하면 된다는 식의 해결방법도 있어서

각자 맞는 해결 방법을 사용하면 될 것 같다

 

 

 

 

 

3. 참고링크


stackoverflow.com/questions/57501402/400-specify-mp3-encoding-to-match-audio-file

 

400 Specify MP3 encoding to match audio file

I am trying to use the google-speech2text api however, I keep getting "Specify MP3 encoding to match audio file" even though I have setup my code to go through all available encoders. This is the...

stackoverflow.com

 

반응형
저작자표시 비영리 변경금지 (새창열림)

'Error code 모음 > 4. Python errors' 카테고리의 다른 글

[Python Error] ValueError: If using all scalar values, you must pass an index  (0) 2021.05.14
[Python Error] Error: [Errno 11001] getaddrinfo failed  (0) 2021.04.17
[Python Error] TypeError: expected string or bytes-like object  (0) 2021.03.18
[Python Error] raise LookupError(resource_not_found)  (0) 2021.03.18
[Python Error] AttributeError: 'MySQLCursor' object has no attribute 'commit'  (0) 2021.03.17
'Error code 모음/4. Python errors' 카테고리의 다른 글
  • [Python Error] ValueError: If using all scalar values, you must pass an index
  • [Python Error] Error: [Errno 11001] getaddrinfo failed
  • [Python Error] TypeError: expected string or bytes-like object
  • [Python Error] raise LookupError(resource_not_found)
쟈누
쟈누
Ad astra per aspera
    반응형
  • 쟈누
    쟈누의 기록공간
    쟈누
  • 전체
    오늘
    어제
    • 분류 전체보기 (444)
      • AWS (31)
        • Glue (4)
        • S3 (1)
      • 클라우드 (0)
      • Data Engineering (37)
        • GitHub (10)
        • NiFi (11)
        • Spark (10)
        • Snowflake (0)
        • 머신러닝, AI (6)
      • 언어 (118)
        • 데이터 베이스 (42)
        • JAVA (9)
        • Python (34)
        • Java Script (15)
        • Linux (18)
      • 프로젝트, 인강 그리고 책 (30)
        • Spotify Project (7)
        • RASA chatbot Project (9)
        • Naver shopping Project (6)
        • 빅데이터를 지탱하는 기술 (8)
      • OLD (56)
        • IT 용어 사전 (13)
        • Front End (12)
        • Back End (31)
      • Error code 모음 (165)
        • 1. SQL errors (17)
        • 2. Hadoop errors (20)
        • 3. Linux Errors (14)
        • 4. Python errors (33)
        • 5. JAVA, Spring errors (41)
        • 6. Jav Script errors (10)
        • 7. Dev Tools errors (9)
        • 8. Git errors (8)
        • 9. Jenkins Errors (4)
        • 10. airflow Errors (2)
        • 11. Aws errors (7)
      • 개인 (1)
        • 책 (1)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
    • 블로그 관리
    • 글쓰기
  • 링크

  • 공지사항

    • 간단한 블로그 소개
  • 인기 글

  • 태그

    linux
    설치
    java
    파이썬
    install
    AWS
    node
    error
    python error
    NiFi
    Python
    Spring
    리눅스
    Git
    API
    자바
    json
    MySQL
    에러
    SQL
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
쟈누
[Python Error] google.api_core.exceptions.InvalidArgument: 400 Specify MP3 encoding to match audio file.
상단으로

티스토리툴바