diff --git a/fern/pages/08-speech-understanding/translation.mdx b/fern/pages/08-speech-understanding/translation.mdx index cf519d30..935d92db 100644 --- a/fern/pages/08-speech-understanding/translation.mdx +++ b/fern/pages/08-speech-understanding/translation.mdx @@ -172,6 +172,7 @@ audio_url = "https://assembly.ai/wildfires.mp3" data = { "audio_url": audio_url, "speaker_labels": True, # Enable speaker labels + # "language_detection": True, # Enable language detection if you are processing files in a variety of languages "speech_understanding": { "request": { "translation": { @@ -223,6 +224,7 @@ transcriber = aai.Transcriber() # Configure transcription with translation config = aai.TranscriptionConfig( speaker_labels=True, # Enable speaker labels + # language_detection=True, # Enable language detection if you are processing files in a variety of languages speech_understanding=aai.SpeechUnderstandingConfig( translation=aai.TranslationConfig( target_languages=['es', 'de'], # Translate to Spanish and German @@ -266,6 +268,7 @@ const audioUrl = 'https://assembly.ai/wildfires.mp3'; const data = { audio_url: audioUrl, speaker_labels: true, // Enable speaker labels + // language_detection: true, // Enable language detection if you are processing files in a variety of languages speech_understanding: { request: { translation: { @@ -332,6 +335,7 @@ const client = new AssemblyAI({ const config = { audio_url: 'https://assembly.ai/wildfires.mp3', speaker_labels: true, // Enable speaker labels + // language_detection: true, // Enable language detection if you are processing files in a variety of languages speech_understanding: { request: { translation: { @@ -359,7 +363,7 @@ if (transcript.translated_texts) { } ``` - */} + */} ### Method 2: Transcribe and translate in separate requests @@ -385,7 +389,8 @@ audio_url = "https://assembly.ai/wildfires.mp3" # Submit transcription request (without translation) data = { "audio_url": audio_url, - "speaker_labels": True + "speaker_labels": True, + # "language_detection": True, # Enable language detection if you are processing files in a variety of languages } # Transcribe file @@ -452,6 +457,7 @@ audio_url = "https://assembly.ai/wildfires.mp3" config = aai.TranscriptionConfig( speaker_labels=True, + # language_detection=True, # Enable language detection if you are processing files in a variety of languages ) transcript = aai.Transcriber().transcribe(audio_file, config) @@ -504,7 +510,8 @@ async function main() { // Submit transcription request (without translation) const data = { audio_url: audioUrl, - speaker_labels: true + speaker_labels: true, + // language_detection: true, // Enable language detection if you are processing files in a variety of languages }; // Transcribe file @@ -601,6 +608,7 @@ async function translateTranscript() { const transcript = await client.transcripts.transcribe({ audio: audioUrl, speaker_labels: true // Optional: enable speaker diarization + // language_detection: true, // Enable language detection if you are processing files in a variety of languages }); if (transcript.status === "error") { @@ -634,7 +642,7 @@ async function translateTranscript() { translateTranscript().catch(console.error); ``` - */} + */} **Expected output:** @@ -733,6 +741,7 @@ audio_url = "https://assembly.ai/wildfires.mp3" data = { "audio_url": audio_url, "speaker_labels": True, # Enable speaker labels + # "language_detection": True, # Enable language detection if you are processing files in a variety of languages "speech_understanding": { "request": { "translation": { @@ -787,6 +796,7 @@ const audioUrl = 'https://assembly.ai/wildfires.mp3'; const data = { audio_url: audioUrl, speaker_labels: true, // Enable speaker labels + // language_detection: true, // Enable language detection if you are processing files in a variety of languages speech_understanding: { request: { translation: { @@ -889,6 +899,7 @@ curl -X POST \ -d '{ "audio_url": "https://assembly.ai/wildfires.mp3", "speaker_labels": true, + "language_detection": true, "speech_understanding": { "request": { "translation": {