c3b3b47c9a
新增 ElevenLabs 直接二进制适配、固定请求契约和单次 POST 边界。 实现 40 MiB 有界读取、MIME/MP3 校验和 600 秒纯 Rust 时长探测。 接入服务端环境配置、失败关闭 settings guard 与持久化来源解耦。 补齐 mock 回归测试、环境模板和 T3 tracked 文档记录。
61 lines
2.8 KiB
Rust
61 lines
2.8 KiB
Rust
mod background_music_prompt;
|
|
mod client;
|
|
mod download;
|
|
mod elevenlabs;
|
|
mod error;
|
|
mod mp3;
|
|
mod persist;
|
|
mod request;
|
|
mod response;
|
|
mod sound_effect_prompt;
|
|
mod types;
|
|
|
|
pub use background_music_prompt::{
|
|
ValidatedBackgroundMusicPrompt, background_music_prompt_char_count,
|
|
background_music_prompt_effective_char_count, canonicalize_background_music_prompt,
|
|
validate_background_music_completion_prompt, validate_background_music_generation_prompt,
|
|
};
|
|
pub use client::{
|
|
build_vector_engine_audio_http_client, resolve_audio_task_download_urls,
|
|
submit_background_music_task, submit_editor_background_music_task,
|
|
submit_editor_sound_effect_task, submit_sound_effect_task,
|
|
};
|
|
pub use download::{audio_mime_to_extension, download_generated_audio, normalize_audio_mime_type};
|
|
pub use elevenlabs::{
|
|
ELEVENLABS_PROVIDER, ELEVENLABS_SOUND_EFFECT_MODEL, ELEVENLABS_SOUND_EFFECT_OUTPUT_FORMAT,
|
|
ELEVENLABS_SOUND_EFFECT_PROMPT_INFLUENCE, ElevenLabsAudioSettings,
|
|
ElevenLabsGeneratedSoundEffect, ElevenLabsSoundEffectRequest,
|
|
build_elevenlabs_audio_http_client, build_elevenlabs_sound_effect_body,
|
|
elevenlabs_sound_generation_endpoint, generate_elevenlabs_sound_effect,
|
|
};
|
|
pub use error::{AudioError, AudioStatusHint};
|
|
pub use mp3::MAX_GENERATED_AUDIO_DURATION_SECONDS;
|
|
pub use persist::{
|
|
GeneratedAudioPersistInput, GeneratedAudioPersistSource, GeneratedAudioPersistTarget,
|
|
prepare_generated_audio_put_request,
|
|
};
|
|
pub use request::{
|
|
build_background_music_task_body, build_editor_background_music_task_body,
|
|
build_editor_sound_effect_task_body, build_sound_effect_task_body, normalize_limited_text,
|
|
normalize_limited_text_allow_empty, normalize_optional_text,
|
|
};
|
|
pub use response::{
|
|
extract_audio_urls, is_failed_task_status, is_pending_task_status, normalize_task_status,
|
|
};
|
|
pub use sound_effect_prompt::{
|
|
SOUND_EFFECT_DURATION_MAX_SECONDS, SOUND_EFFECT_DURATION_MIN_SECONDS,
|
|
SOUND_EFFECT_PROMPT_MAX_CODE_POINTS, ValidatedSoundEffectPrompt,
|
|
canonicalize_sound_effect_prompt, sound_effect_prompt_code_point_count,
|
|
sound_effect_prompt_contains_han, sound_effect_prompt_uses_only_latin_alphabetic_script,
|
|
validate_sound_effect_duration_seconds, validate_sound_effect_prompt,
|
|
};
|
|
pub use types::{
|
|
AudioTaskKind, AudioTaskResponse, BACKGROUND_MUSIC_PROMPT_SIMPLIFICATION_MAX_CHARS,
|
|
BackgroundMusicTaskRequest, DEFAULT_SOUND_EFFECT_DURATION_SECONDS, DownloadedAudio,
|
|
EditorBackgroundMusicTaskRequest, EditorSoundEffectTaskRequest, MAX_GENERATED_AUDIO_BYTES,
|
|
SUNO_DEFAULT_MODEL, SUNO_GPT_DESCRIPTION_PROMPT_MAX_CHARS, SUNO_PROMPT_MAX_CHARS,
|
|
SUNO_TAGS_MAX_CHARS, SUNO_TITLE_MAX_CHARS, SoundEffectTaskRequest, VECTOR_ENGINE_PROVIDER,
|
|
VECTOR_ENGINE_SUNO_PROVIDER, VECTOR_ENGINE_VIDU_PROVIDER, VIDU_AUDIO_MODEL,
|
|
VIDU_PROMPT_MAX_CHARS, VectorEngineAudioSettings,
|
|
};
|