{"record":{"id":"03b975f9d21b37c9","repo":"BerriAI/litellm","slug":"unsupported-bedrock-audio-format-for-file-process","errorCode":null,"errorMessage":"Unsupported Bedrock audio format for file {processed_audio.filename!r}","messagePattern":"Unsupported Bedrock audio format for file (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/bedrock/audio_transcription/__init__.py","lineNumber":27,"sourceCode":"\n\nclass BedrockAudioTranscriptionRustDispatch:\n    @staticmethod\n    def _audio_payload(audio_file: FileTypes) -> dict[str, object]:\n        processed_audio: Final = process_audio_file(audio_file)\n        formats: Final = {\n            \"audio/flac\": \"flac\",\n            \"audio/mpeg\": \"mp3\",\n            \"audio/mp3\": \"mp3\",\n            \"audio/ogg\": \"ogg\",\n            \"audio/wav\": \"wav\",\n            \"audio/x-wav\": \"wav\",\n        }\n        audio_format: Final = formats.get(processed_audio.content_type) or (\n            processed_audio.filename.rsplit(\".\", 1)[-1].lower() if \".\" in processed_audio.filename else \"\"\n        )\n        if audio_format not in {\"wav\", \"mp3\", \"flac\", \"ogg\"}:\n            raise ValueError(f\"Unsupported Bedrock audio format for file {processed_audio.filename!r}\")\n        return {\n            \"data\": base64.b64encode(processed_audio.file_content).decode(\"ascii\"),\n            \"format\": audio_format,\n            \"filename\": processed_audio.filename,\n        }\n\n    def audio_transcriptions(\n        self,\n        *,\n        model: str,\n        audio_file: FileTypes,\n        api_key: str | None,\n        api_base: str | None,\n        custom_llm_provider: str,\n        extra_headers: dict[str, object] | None,\n        optional_params: dict[str, object],\n        timeout: float | httpx.Timeout | None,\n    ) -> TranscriptionResponse:","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/bedrock/audio_transcription/__init__.py#L9-L45","documentation":"Validation failure in _audio_payload: the content type of the uploaded audio file is not in the supported Bedrock format map (flac/mp3/ogg/wav) and the filename has no recognizable extension to fall back on, so the audio cannot be mapped to a Bedrock-supported format.","triggerScenarios":"Thrown at litellm/llms/bedrock/audio_transcription/__init__.py:27 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Convert the audio file to a format supported by Bedrock transcription (e.g. mp3, wav, flac, ogg, amr, webm).","Rename or re-encode the file so its extension matches a supported format.","Check the filename passed in processed_audio for a supported extension."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}