{ "kind": "open-flow-workflow", "version": 1, "name": "French to English Audio", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_6216300275234e7e": { "name": "French text and voice", "kind": "start", "inputDefs": [ { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "french_text" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "voice_id" } ] }, "n_d8b8eedd1d55fd52": { "inputs": { "french_text": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_6216300275234e7e", "output": "french_text" } ] }, "voice_id": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_6216300275234e7e", "output": "voice_id" } ] } }, "name": "Validate text and voice", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "french_text" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "voice_id" } ], "outputs": [ { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "frenchText" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "voiceId" } ], "name": "Validate text and voice", "moduleId": "n_abcbcddd3c0c4f44", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_093c33562bc8747e": { "inputs": { "modelId": { "kind": "value", "value": "eleven_multilingual_v2" }, "voiceSettings": { "kind": "value", "value": { "stability": 0.5, "similarityBoost": 0.5 } }, "outputFormat": { "kind": "value", "value": "mp3_44100_128" }, "optimizeStreamingLatency": { "kind": "value", "value": 1 }, "voiceId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_d8b8eedd1d55fd52", "output": "voiceId" } ] }, "text": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_d8b8eedd1d55fd52", "output": "frenchText" } ] } }, "name": "Generate French speech", "kind": "task", "task": { "inputs": [ { "description": "The voice ID to use for synthesis.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The voice ID to use for synthesis." }, "nullable": false, "handle": "voiceId" }, { "description": "The input text to synthesize.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The input text to synthesize." }, "nullable": false, "handle": "text" }, { "description": "The model ID to use for synthesis.", "jsonSchema": { "type": "string", "description": "The model ID to use for synthesis." }, "nullable": true, "handle": "modelId", "value": null }, { "description": "The output audio format. ElevenLabs formats are named as codec_sample_rate_bitrate, such as mp3_44100_128.", "jsonSchema": { "type": "string", "enum": [ "alaw_8000", "mp3_22050_32", "mp3_24000_48", "mp3_44100_128", "mp3_44100_192", "mp3_44100_32", "mp3_44100_64", "mp3_44100_96", "opus_48000_128", "opus_48000_192", "opus_48000_32", "opus_48000_64", "opus_48000_96", "pcm_16000", "pcm_22050", "pcm_24000", "pcm_32000", "pcm_44100", "pcm_48000", "pcm_8000", "ulaw_8000", "wav_16000", "wav_22050", "wav_24000", "wav_32000", "wav_44100", "wav_48000", "wav_8000" ], "description": "The output audio format. ElevenLabs formats are named as codec_sample_rate_bitrate, such as mp3_44100_128." }, "nullable": true, "handle": "outputFormat", "value": null }, { "description": "The streaming latency optimization level.", "jsonSchema": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The streaming latency optimization level." }, "nullable": true, "handle": "optimizeStreamingLatency", "value": null }, { "description": "The deterministic generation seed.", "jsonSchema": { "type": "integer", "description": "The deterministic generation seed." }, "nullable": true, "handle": "seed", "value": null }, { "description": "The voice settings overrides for synthesis.", "jsonSchema": { "type": "object", "properties": { "stability": { "type": "number", "minimum": 0, "maximum": 1, "description": "The stability control value." }, "similarityBoost": { "type": "number", "minimum": 0, "maximum": 1, "description": "The similarity boost value." }, "style": { "type": "number", "minimum": 0, "maximum": 1, "description": "The style control value." }, "useSpeakerBoost": { "type": "boolean", "description": "Whether speaker boost should be enabled." } }, "additionalProperties": true, "description": "The voice settings overrides for synthesis." }, "nullable": true, "handle": "voiceSettings", "value": null }, { "description": "The pronunciation dictionary locators to apply.", "jsonSchema": { "type": "array", "items": { "type": "object", "properties": { "pronunciationDictionaryId": { "type": "string", "description": "The pronunciation dictionary identifier." }, "versionId": { "type": "string", "description": "The pronunciation dictionary version identifier." } }, "required": [ "pronunciationDictionaryId" ], "additionalProperties": false, "description": "A pronunciation dictionary locator." }, "maxItems": 3, "description": "The pronunciation dictionary locators to apply." }, "nullable": true, "handle": "pronunciationDictionaryLocators", "value": null } ], "outputs": [ { "description": "A downloadable file uploaded to connector transit storage.", "jsonSchema": { "type": "object", "properties": { "name": { "type": "string", "description": "The generated file name." }, "mimetype": { "type": "string", "description": "The MIME type of the uploaded file." }, "s3url": { "type": "string", "description": "The transit URL for downloading the uploaded file." } }, "required": [ "name", "mimetype", "s3url" ], "additionalProperties": false, "description": "A downloadable file uploaded to connector transit storage." }, "nullable": false, "handle": "file" }, { "description": "The voice ID used for synthesis.", "jsonSchema": { "type": "string", "description": "The voice ID used for synthesis." }, "nullable": false, "handle": "voiceId" }, { "description": "The model ID used for synthesis.", "jsonSchema": { "type": "string", "description": "The model ID used for synthesis." }, "nullable": true, "handle": "modelId" }, { "description": "The requested output format.", "jsonSchema": { "type": "string", "description": "The requested output format." }, "nullable": false, "handle": "outputFormat" }, { "description": "The response content type from ElevenLabs.", "jsonSchema": { "type": "string", "description": "The response content type from ElevenLabs." }, "nullable": false, "handle": "contentType" } ], "name": "Generate French speech", "executor": { "kind": "connector", "action": "elevenlabs.text_to_speech" } } }, "n_9304d5be9f62355a": { "inputs": { "file": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_093c33562bc8747e", "output": "file" } ] } }, "name": "Prepare French audio", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "object", "properties": { "name": { "type": "string", "description": "The generated file name." }, "mimetype": { "type": "string", "description": "The MIME type of the uploaded file." }, "s3url": { "type": "string", "description": "The transit URL for downloading the uploaded file." } }, "required": [ "name", "mimetype", "s3url" ], "additionalProperties": false, "description": "A downloadable file uploaded to connector transit storage." }, "nullable": false, "handle": "file" } ], "outputs": [ { "jsonSchema": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1 }, "mimetype": { "type": "string" }, "url": { "type": "string", "pattern": "^https?://" } }, "required": [ "name", "mimetype", "url" ], "additionalProperties": false }, "nullable": false, "handle": "file" } ], "name": "Prepare French audio", "moduleId": "n_0063224ffeaa13af", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_a3c8c14bf77ec999": { "inputs": { "file": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_9304d5be9f62355a", "output": "file" } ] }, "model": { "kind": "value", "value": "whisper-1" }, "response_format": { "kind": "value", "value": "json" } }, "name": "Transcribe the French audio", "kind": "task", "task": { "inputs": [ { "description": "The audio file source to transcribe.", "jsonSchema": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "description": "The filename to report when uploading the audio file." }, "mimetype": { "type": "string", "description": "The MIME type of the audio file." }, "url": { "type": "string", "description": "A public URL pointing to the audio file." }, "content_base64": { "type": "string", "minLength": 1, "description": "The base64-encoded audio content to upload." } }, "required": [ "name" ], "additionalProperties": false, "description": "The audio file source to transcribe." }, "nullable": false, "handle": "file" }, { "description": "The transcription model to use.", "jsonSchema": { "type": "string", "description": "The transcription model to use." }, "nullable": false, "handle": "model" }, { "description": "The chunking strategy configuration accepted by the upstream API.", "jsonSchema": { "type": "object", "additionalProperties": { "description": "Any JSON value accepted by the upstream API." }, "description": "The chunking strategy configuration accepted by the upstream API." }, "nullable": true, "handle": "chunking_strategy", "value": null }, { "description": "Additional response fields to include.", "jsonSchema": { "type": "array", "items": { "type": "string", "description": "One additional response field to include." }, "minItems": 1, "description": "Additional response fields to include." }, "nullable": true, "handle": "include", "value": null }, { "description": "The language code of the source audio.", "jsonSchema": { "type": "string", "description": "The language code of the source audio." }, "nullable": true, "handle": "language", "value": null }, { "description": "A guiding prompt for the transcription.", "jsonSchema": { "type": "string", "description": "A guiding prompt for the transcription." }, "nullable": true, "handle": "prompt", "value": null }, { "description": "The response format to return.", "jsonSchema": { "type": "string", "description": "The response format to return." }, "nullable": true, "handle": "response_format", "value": null }, { "description": "Whether to request a streaming transcription response. This connector only accepts false or an omitted value.", "jsonSchema": { "type": "boolean", "description": "Whether to request a streaming transcription response. This connector only accepts false or an omitted value." }, "nullable": true, "handle": "stream", "value": null }, { "description": "The sampling temperature.", "jsonSchema": { "type": "number", "minimum": 0, "maximum": 1, "description": "The sampling temperature." }, "nullable": true, "handle": "temperature", "value": null }, { "description": "The timestamp granularities to include.", "jsonSchema": { "type": "array", "items": { "type": "string", "enum": [ "word", "segment" ], "description": "One timestamp granularity value." }, "minItems": 1, "description": "The timestamp granularities to include." }, "nullable": true, "handle": "timestamp_granularities", "value": null } ], "outputs": [ { "description": "The normalized payload returned by an OpenAI audio text endpoint.", "jsonSchema": { "type": "object", "properties": { "text": { "type": "string", "description": "The transcribed or translated text." }, "language": { "type": "string", "description": "The detected or returned language code." }, "duration": { "type": "number", "description": "The duration of the processed audio in seconds." }, "segments": { "type": "array", "items": { "type": "object", "additionalProperties": { "description": "Any JSON value accepted by the upstream API." }, "description": "Any JSON object." }, "description": "The segment-level timing details." }, "words": { "type": "array", "items": { "type": "object", "additionalProperties": { "description": "Any JSON value accepted by the upstream API." }, "description": "Any JSON object." }, "description": "The word-level timing details." }, "logprobs": { "type": "array", "items": { "type": "object", "additionalProperties": { "description": "Any JSON value accepted by the upstream API." }, "description": "Any JSON object." }, "description": "The token log probabilities, if requested." }, "usage": { "type": "object", "additionalProperties": { "description": "Any JSON value accepted by the upstream API." }, "description": "Usage details returned by the API." } }, "additionalProperties": true, "description": "The normalized payload returned by an OpenAI audio text endpoint." }, "nullable": false, "handle": "output" } ], "name": "Transcribe the French audio", "executor": { "kind": "connector", "action": "openai.create_audio_transcription", "outputMode": "value" } } }, "n_74f27febe2bfb6c3": { "inputs": { "transcription": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_a3c8c14bf77ec999", "output": "output" } ] } }, "name": "Read the French transcript", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "object", "properties": { "text": { "type": "string", "description": "The transcribed or translated text." }, "language": { "type": "string", "description": "The detected or returned language code." }, "duration": { "type": "number", "description": "The duration of the processed audio in seconds." }, "segments": { "type": "array", "items": { "type": "object", "additionalProperties": { "description": "Any JSON value accepted by the upstream API." }, "description": "Any JSON object." }, "description": "The segment-level timing details." }, "words": { "type": "array", "items": { "type": "object", "additionalProperties": { "description": "Any JSON value accepted by the upstream API." }, "description": "Any JSON object." }, "description": "The word-level timing details." }, "logprobs": { "type": "array", "items": { "type": "object", "additionalProperties": { "description": "Any JSON value accepted by the upstream API." }, "description": "Any JSON object." }, "description": "The token log probabilities, if requested." }, "usage": { "type": "object", "additionalProperties": { "description": "Any JSON value accepted by the upstream API." }, "description": "Usage details returned by the API." } }, "additionalProperties": true, "description": "The normalized payload returned by an OpenAI audio text endpoint." }, "nullable": false, "handle": "transcription" } ], "outputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "frenchTranscript" } ], "name": "Read the French transcript", "moduleId": "n_eeb8f060887556f8", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_f21665fcb250c922": { "inputs": { "frenchTranscript": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_74f27febe2bfb6c3", "output": "frenchTranscript" } ] } }, "name": "Translate into English", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "items": { "type": "object" }, "type": "array" }, "nullable": true, "handle": "messages", "value": null }, { "jsonSchema": { "items": { "type": "object" }, "minItems": 1, "type": "array" }, "nullable": false, "handle": "template", "value": [ { "role": "user", "content": "Translate to English:\n{{frenchTranscript}}" } ] }, { "jsonSchema": { "type": "object" }, "nullable": false, "handle": "model", "value": { "model": "gpt-4o-mini-2024-07-18", "temperature": 0 } }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "frenchTranscript" } ], "outputs": [ { "description": "Generated response.", "jsonSchema": { "type": "string" }, "nullable": false, "handle": "output" } ], "name": "Translate into English", "executor": { "kind": "llm", "mode": "chat" } } }, "n_36bdc968cf447501": { "inputs": { "text": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_f21665fcb250c922", "output": "output" } ] } }, "name": "Validate the English translation", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "text" } ], "outputs": [ { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "englishText" } ], "name": "Validate the English translation", "moduleId": "n_0baaa7fbf05947e7", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_e023133d4c070e9e": { "inputs": { "modelId": { "kind": "value", "value": "eleven_multilingual_v2" }, "voiceSettings": { "kind": "value", "value": { "stability": 0.5, "similarityBoost": 0.5 } }, "outputFormat": { "kind": "value", "value": "mp3_44100_128" }, "optimizeStreamingLatency": { "kind": "value", "value": 1 }, "voiceId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_d8b8eedd1d55fd52", "output": "voiceId" } ] }, "text": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_36bdc968cf447501", "output": "englishText" } ] } }, "name": "Generate English speech", "kind": "task", "task": { "inputs": [ { "description": "The voice ID to use for synthesis.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The voice ID to use for synthesis." }, "nullable": false, "handle": "voiceId" }, { "description": "The input text to synthesize.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The input text to synthesize." }, "nullable": false, "handle": "text" }, { "description": "The model ID to use for synthesis.", "jsonSchema": { "type": "string", "description": "The model ID to use for synthesis." }, "nullable": true, "handle": "modelId", "value": null }, { "description": "The output audio format. ElevenLabs formats are named as codec_sample_rate_bitrate, such as mp3_44100_128.", "jsonSchema": { "type": "string", "enum": [ "alaw_8000", "mp3_22050_32", "mp3_24000_48", "mp3_44100_128", "mp3_44100_192", "mp3_44100_32", "mp3_44100_64", "mp3_44100_96", "opus_48000_128", "opus_48000_192", "opus_48000_32", "opus_48000_64", "opus_48000_96", "pcm_16000", "pcm_22050", "pcm_24000", "pcm_32000", "pcm_44100", "pcm_48000", "pcm_8000", "ulaw_8000", "wav_16000", "wav_22050", "wav_24000", "wav_32000", "wav_44100", "wav_48000", "wav_8000" ], "description": "The output audio format. ElevenLabs formats are named as codec_sample_rate_bitrate, such as mp3_44100_128." }, "nullable": true, "handle": "outputFormat", "value": null }, { "description": "The streaming latency optimization level.", "jsonSchema": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The streaming latency optimization level." }, "nullable": true, "handle": "optimizeStreamingLatency", "value": null }, { "description": "The deterministic generation seed.", "jsonSchema": { "type": "integer", "description": "The deterministic generation seed." }, "nullable": true, "handle": "seed", "value": null }, { "description": "The voice settings overrides for synthesis.", "jsonSchema": { "type": "object", "properties": { "stability": { "type": "number", "minimum": 0, "maximum": 1, "description": "The stability control value." }, "similarityBoost": { "type": "number", "minimum": 0, "maximum": 1, "description": "The similarity boost value." }, "style": { "type": "number", "minimum": 0, "maximum": 1, "description": "The style control value." }, "useSpeakerBoost": { "type": "boolean", "description": "Whether speaker boost should be enabled." } }, "additionalProperties": true, "description": "The voice settings overrides for synthesis." }, "nullable": true, "handle": "voiceSettings", "value": null }, { "description": "The pronunciation dictionary locators to apply.", "jsonSchema": { "type": "array", "items": { "type": "object", "properties": { "pronunciationDictionaryId": { "type": "string", "description": "The pronunciation dictionary identifier." }, "versionId": { "type": "string", "description": "The pronunciation dictionary version identifier." } }, "required": [ "pronunciationDictionaryId" ], "additionalProperties": false, "description": "A pronunciation dictionary locator." }, "maxItems": 3, "description": "The pronunciation dictionary locators to apply." }, "nullable": true, "handle": "pronunciationDictionaryLocators", "value": null } ], "outputs": [ { "description": "A downloadable file uploaded to connector transit storage.", "jsonSchema": { "type": "object", "properties": { "name": { "type": "string", "description": "The generated file name." }, "mimetype": { "type": "string", "description": "The MIME type of the uploaded file." }, "s3url": { "type": "string", "description": "The transit URL for downloading the uploaded file." } }, "required": [ "name", "mimetype", "s3url" ], "additionalProperties": false, "description": "A downloadable file uploaded to connector transit storage." }, "nullable": false, "handle": "file" }, { "description": "The voice ID used for synthesis.", "jsonSchema": { "type": "string", "description": "The voice ID used for synthesis." }, "nullable": false, "handle": "voiceId" }, { "description": "The model ID used for synthesis.", "jsonSchema": { "type": "string", "description": "The model ID used for synthesis." }, "nullable": true, "handle": "modelId" }, { "description": "The requested output format.", "jsonSchema": { "type": "string", "description": "The requested output format." }, "nullable": false, "handle": "outputFormat" }, { "description": "The response content type from ElevenLabs.", "jsonSchema": { "type": "string", "description": "The response content type from ElevenLabs." }, "nullable": false, "handle": "contentType" } ], "name": "Generate English speech", "executor": { "kind": "connector", "action": "elevenlabs.text_to_speech" } } }, "n_e116a0f4563b272e": { "inputs": { "file": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_e023133d4c070e9e", "output": "file" } ] } }, "name": "Read the English audio download", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "object", "properties": { "name": { "type": "string", "description": "The generated file name." }, "mimetype": { "type": "string", "description": "The MIME type of the uploaded file." }, "s3url": { "type": "string", "description": "The transit URL for downloading the uploaded file." } }, "required": [ "name", "mimetype", "s3url" ], "additionalProperties": false, "description": "A downloadable file uploaded to connector transit storage." }, "nullable": false, "handle": "file" } ], "outputs": [ { "jsonSchema": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1 }, "mimetype": { "type": "string" }, "url": { "type": "string", "pattern": "^https?://" } }, "required": [ "name", "mimetype", "url" ], "additionalProperties": false }, "nullable": false, "handle": "file" } ], "name": "Read the English audio download", "moduleId": "n_a8a3929f911f9156", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_68ae64dda287a154": { "name": "French and English audio", "kind": "outputs", "outputDefs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "frenchTranscript" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "englishText" }, { "jsonSchema": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1 }, "mimetype": { "type": "string" }, "url": { "type": "string", "pattern": "^https?://" } }, "required": [ "name", "mimetype", "url" ], "additionalProperties": false }, "nullable": false, "handle": "frenchAudio" }, { "jsonSchema": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1 }, "mimetype": { "type": "string" }, "url": { "type": "string", "pattern": "^https?://" } }, "required": [ "name", "mimetype", "url" ], "additionalProperties": false }, "nullable": false, "handle": "englishAudio" } ], "outputMappings": { "frenchTranscript": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_74f27febe2bfb6c3", "output": "frenchTranscript" } ] }, "englishText": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_36bdc968cf447501", "output": "englishText" } ] }, "frenchAudio": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_9304d5be9f62355a", "output": "file" } ] }, "englishAudio": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_e116a0f4563b272e", "output": "file" } ] } } } }, "edges": [ { "source": "n_6216300275234e7e", "target": "n_d8b8eedd1d55fd52" }, { "source": "n_d8b8eedd1d55fd52", "target": "n_093c33562bc8747e" }, { "source": "n_093c33562bc8747e", "target": "n_9304d5be9f62355a" }, { "source": "n_9304d5be9f62355a", "target": "n_a3c8c14bf77ec999" }, { "source": "n_a3c8c14bf77ec999", "target": "n_74f27febe2bfb6c3" }, { "source": "n_74f27febe2bfb6c3", "target": "n_f21665fcb250c922" }, { "source": "n_f21665fcb250c922", "target": "n_36bdc968cf447501" }, { "source": "n_36bdc968cf447501", "target": "n_e023133d4c070e9e" }, { "source": "n_e023133d4c070e9e", "target": "n_e116a0f4563b272e" }, { "source": "n_e116a0f4563b272e", "target": "n_68ae64dda287a154" } ] } }, "modules": { "n_abcbcddd3c0c4f44": { "name": "Validate text and voice", "imports": [], "source": "export default function prepareSpeechInput({french_text,voice_id}) {\n if(typeof french_text!=='string'||!french_text.trim()||Array.from(french_text).length>10000) throw new Error('Supply French text with 1–10000 characters.');\n if(typeof voice_id!=='string'||!voice_id.trim()) throw new Error('Supply an ElevenLabs voice ID.');\n return {frenchText:french_text,voiceId:voice_id.trim()};\n}\n" }, "n_0063224ffeaa13af": { "name": "Prepare French audio", "imports": [], "source": "export default function prepareSpeechFile({file}) {\n if(!file||typeof file!=='object'||typeof file.name!=='string'||!file.name.trim()||typeof file.mimetype!=='string'||typeof file.s3url!=='string'||!/^https?:\\/\\/[^\\s]+$/.test(file.s3url)) throw new Error('The speech service returned an invalid downloadable file.');\n const mimetype=file.mimetype.split(';')[0].trim().toLowerCase();\n if(!['audio/mpeg','audio/mp3','application/octet-stream'].includes(mimetype)) throw new Error('The speech response is not an MP3 audio file.');\n return {file:{name:file.name,mimetype,url:file.s3url}};\n}\n" }, "n_eeb8f060887556f8": { "name": "Read the French transcript", "imports": [], "source": "export default function readFrenchTranscript({transcription}) {\n if(!transcription||typeof transcription.text!=='string'||!transcription.text.trim()) throw new Error('The French audio returned no transcript.');\n return {frenchTranscript:transcription.text};\n}\n" }, "n_0baaa7fbf05947e7": { "name": "Validate the English translation", "imports": [], "source": "export default function validateEnglishSpeechText({text}) {\n if(typeof text!=='string'||!text.trim()) throw new Error('The translation returned no English text.');\n const englishText=text.trim();\n if(Array.from(englishText).length>10000) throw new Error('The English translation exceeds the 10000-character speech limit.');\n return {englishText};\n}\n" }, "n_a8a3929f911f9156": { "name": "Read the English audio download", "imports": [], "source": "export default function prepareSpeechFile({file}) {\n if(!file||typeof file!=='object'||typeof file.name!=='string'||!file.name.trim()||typeof file.mimetype!=='string'||typeof file.s3url!=='string'||!/^https?:\\/\\/[^\\s]+$/.test(file.s3url)) throw new Error('The speech service returned an invalid downloadable file.');\n const mimetype=file.mimetype.split(';')[0].trim().toLowerCase();\n if(!['audio/mpeg','audio/mp3','application/octet-stream'].includes(mimetype)) throw new Error('The speech response is not an MP3 audio file.');\n return {file:{name:file.name,mimetype,url:file.s3url}};\n}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }