ai newsMi., 21. Okt.
EilmeldungGoogle unveils TorchTPU in a push to break Nvidia’s stranglehold on AI compute

How News Organizations Use AI Voice for Breaking Stories

Newsrooms are racing to deliver breaking stories in real‑time, and one of the newest weapons in their arsenal is AI‑generated voice. Whether it’s a 911 alert, a live‑stream commentary, or an automated recap of an event, text‑to‑speech (TTS) and voice cloning let journalists reach audiences faster a

dev.toMittwoch 02:29 · 21.10.3 Min. Lesezeit
Bild: dev.to

Newsrooms are racing to deliver breaking stories in real‑time, and one of the newest weapons in their arsenal is AI‑generated voice. Whether it’s a 911 alert, a live‑stream commentary, or an automated recap of an event, text‑to‑speech (TTS) and voice cloning let journalists reach audiences faster and with higher accessibility than ever before.

Modern TTS engines are built on neural networks that learn the nuances of human speech: intonation, breath, and even subtle pauses. Voice cloning takes this a step further by creating a digital twin of a real person’s voice. By feeding a handful of hours of clean audio, the model learns the speaker’s timbre and style, enabling it to read any text in that voice.

Many outlets now embed AI‑generated audio into their websites, podcasts, and mobile apps. For example, a breaking event can trigger an API call that generates a short clip in the anchor’s voice, which is then pushed to the newsroom’s content management system and broadcasted to listeners.

ElevenLabs offers a robust API that makes it trivial to integrate voice cloning into a news workflow. Their platform supports high‑fidelity synthesis and a wide array of voice presets. To start, sign up at https://try.elevenlabs.io/kr07zfuqn1bp and obtain your API key.

Below is a minimal script that sends a text prompt to ElevenLabs and streams back the synthesized audio.

import requests API_KEY = " YOUR_ELEVENLABS_API_KEY " BASE_URL = " https://api.elevenlabs.io/v1 " headers = { " Accept ": " audio/mpeg ", " xi-api-key ": API_KEY, " Content-Type ": " application/json ", } payload = { " text ": " Breaking news: The city council has just approved a new public transportation initiative. ", " voice_settings ": { " stability ": 0.75, " similarity_boost ": 0.85 }, " voice_id ": " YOUR_VOICE_ID " # use a voice you have cloned } response = requests. post ( f " { BASE_URL } /text-to-speech/ { payload [ ' voice_id ' ] } ", json = payload, headers = headers ) if response. status_code == 200: with open ( " breaking_story.mp3 ", " wb " ) as f: f. write ( response. content ) print ( " Audio file saved: breaking_story.mp3 " ) else: print ( f " Error: { response. status_code } - { response. text } " ) Enter fullscreen mode Exit fullscreen mode Replace YOUR_ELEVENLABS_API_KEY and YOUR_VOICE_ID with the values from your ElevenLabs account. The voice_settings block lets you fine‑tune the output’s naturalness and similarity to the original voice.

If you’re working on a front‑end or a serverless function, here’s how you can do the same in Node:

const fetch = require ( ' node-fetch ' ); const apiKey = ' YOUR_ELEVENLABS_API_KEY '; const voiceId = ' YOUR_VOICE_ID '; const payload = { text: ' Breaking news: The city council has just approved a new public transportation initiative. ', voice_settings: { stability: 0.75, similarity_boost: 0.85 } }; fetch ( `https://api.elevenlabs.io/v1/text-to-speech/ ${ voiceId } `, { method: ' POST ', headers: { ' Accept ': ' audio/mpeg ', ' xi-api-key ': apiKey, ' Content-Type ': ' application/json ' }, body: JSON. stringify ( payload ) }). then ( res => res. arrayBuffer ()). then ( buffer => { const fs = require ( ' fs ' ); fs. writeFileSync ( ' breaking_story.mp3 ', Buffer. from ( buffer )); console. log ( ' Audio file saved: breaking_story.mp3 ' ); }). catch ( err => console. error ( err )); Enter fullscreen mode Exit fullscreen mode cURL Example For quick testing from the terminal:

curl -X POST "https://api.elevenlabs.io/v1/text-to-speech/YOUR_VOICE_ID" \ -H "Accept: audio/mpeg" \ -H "xi-api-key: YOUR_ELEVENLABS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "text": "Breaking news: The city council has just approved a new public transportation initiative.", "voice_settings": {"stability":0.75,"similarity_boost":0.85} }' --output breaking_story.mp3 Enter fullscreen mode Exit fullscreen mode Best Practices and Ethics When automating voice for journalism, transparency is essential:

If you’re looking to add instant, high‑quality voice to breaking news, give ElevenLabs a try. Their API is developer‑friendly, the voices are incredibly natural, and the platform is built to handle the real‑world demands of a newsroom. Sign up at https://try.elevenlabs.io/kr07zfuqn1bp and start turning your headlines into compelling audio today.

Quelle: dev.to (dev.to). Original öffnen