MCPcopy Create free account
hub / github.com/AstrBotDevs/AstrBot / prepare_audio_input

Function prepare_audio_input

astrbot/core/provider/sources/mimo_api_common.py:59–70  ·  view source on GitHub ↗
(audio_source: str)

Source from the content-addressed store, hash-verified

57
58
59async def prepare_audio_input(audio_source: str) -> tuple[str, list[Path]]:
60 audio_data = await MediaResolver(
61 audio_source,
62 media_type="audio",
63 default_suffix=".wav",
64 ).to_base64_data(
65 strict=True,
66 target_format="wav",
67 )
68 if audio_data is None:
69 raise ValueError(f"Invalid audio data: {describe_media_ref(audio_source)}")
70 return audio_data.to_data_url(), []
71
72
73def cleanup_files(paths: list[Path]) -> None:

Callers 2

get_textMethod · 0.85

Calls 4

MediaResolverClass · 0.90
describe_media_refFunction · 0.90
to_base64_dataMethod · 0.45
to_data_urlMethod · 0.45