Repository navigation
Description
What
Record + replay for three audio endpoints that a voice pipeline chains together. Follows #415 (BytePlus Ark video) and #452 (ElevenLabs Voice Design).
- BytePlus Seed Speech (Seed Audio TTS):
POST /api/v3/tts/createonhttps://voice.ap-southeast-1.bytepluses.com - ElevenLabs Speech to Text (Scribe):
POST /v1/speech-to-text - ElevenLabs Audio Isolation:
POST /v1/audio-isolation
Why
OpenStory makes character voices with Seed Audio. Each take is checked with Scribe word timings, and the kept sections are cleaned with Audio Isolation. None of the three routes is handled today (checked 1.43.0 and 1.47.0), so strict replay cannot run any of the voice pipeline. Our e2e suite has no way to cover it without hand-written fakes, and a fake transcript proves much less than a recorded one.
Wire shapes (as our client sends and reads them)
1. Seed Speech: POST /api/v3/tts/create
Request headers: X-Api-Key, X-Api-Request-Id (unique per call), Content-Type: application/json.
{
"model": "<seed audio model id>",
"text_prompt": "…the lines to speak, with @Audio1 references…",
"references": [{ "audio_data": "<base64 wav>" }],
"audio_config": { "format": "wav", "sample_rate": 44100 }
}references is optional and can be several MB of base64.
Response 200:
{ "code": 0, "message": "", "audio": "<base64 wav>", "original_duration": 4.2 }Errors: non-2xx with { "code": <int>, "message": "…" }. We retry 429.
Matching suggestion: key on model + text_prompt + a hash of each references[].audio_data. Do not key on X-Api-Request-Id, which changes every call.
2. Scribe: POST /v1/speech-to-text (multipart)
Sent through the official @elevenlabs/elevenlabs-js SDK (speechToText.convert):
model_id=scribe_v2file: the audio (audio/wav, the Seed take above)language_code=entimestamps_granularity=wordtag_audio_events=false
We read text, audio_duration_secs and words[] (type, text, start, end), keeping type === "word".
Matching suggestion: key on model_id + a hash of the file bytes. On replay the take comes from fixture 1, so its bytes are stable and the recorded transcript lines up with it.
3. Audio Isolation: POST /v1/audio-isolation (multipart)
SDK audioIsolation.convert({ audio }): one audio part (audio/wav). The response is a streamed binary body (audio/mpeg), read to the end.
Matching suggestion: a hash of the audio bytes, which here is a slice of the replayed take.
Notes
- All three are plain request/response (no job lifecycle), so they fit
RawJSONResponse/ binary fixtures more than the video task machinery. - Strict replay should refuse a miss as it does for the other ElevenLabs routes, so a drifted prompt fails loudly.
- Related gaps on the same BytePlus account, possibly separate issues: Seedream on the Ark data plane (
POST /api/v3/images/generations, which aimock only routes as/v1/images/generations), and the Ark asset control plane (POST /?Action=CreateAsset|GetAsset|ListAssets|DeleteAsset|CreateAssetGroup|ListAssetGroups|DeleteAssetGroup&Version=2024-01-01, signed with a BytePlus HMAC).
Activity
feat: record and replay Seed Speech TTS, ElevenLabs Scribe and Audio …
test(e2e): Seedance and Seedream replay through aimock; voice spec
test(e2e): Seedance and Seedream replay through aimock; voice spec
test(e2e): Seedance and Seedream replay through aimock; voice spec
Increase e2e coverage: measurement, sharding, MCP/API/admin/pages spe…
chore: release v1.48.0 (#612)