0:00Intro: MOFUSA Tech Academy
Welcome to MOFUSA Tech Academy. Beyond learning, towards mastery.
0:09This voice is AI
Here's something you may not have noticed: the voice you're listening to right now is generated by AI. The script was written, then a text-to-speech model turned it into speech, with pauses, emphasis and expression. Sana wants the same for Brightcart: an assistant that can speak to customers on the phone, and short product videos, a kettle on a counter with steam rising smoothly. Speech, music and video add new challenges: time, rhythm, and frames that must stay consistent with each other. Today: how machines generate sound and moving pictures, using ideas you already know, tokens, transformers and diffusion, adapted to new kinds of data.
0:56Where we are: speech, music and video
Season Three, Module Twelve, final stop: speech, music and video generation.
1:03Sound as numbers: waveforms and spectrograms
To a computer, sound is a list of numbers: the position of a microphone's membrane, measured thousands of times a second. At twenty-four thousand samples a second, one minute of speech is one point four four million numbers, a very long sequence, with important patterns at many timescales, from tiny vibrations, to syllables, to whole sentences. So audio models often use a more compact picture called a spectrogram. Chop the sound into short overlapping slices, and for each slice, measure how strong each frequency is: which "notes" are present at that moment.
Time runs across, pitch runs up, and brightness shows loudness. Usually the frequencies are grouped on the mel scale, which spaces them the way human hearing does. A common setup produces about eighty-six frames per second, each with eighty frequency bands: far fewer numbers than the raw waveform.
2:04Text-to-speech: how this narrator works
Let's look inside a classic text-to-speech system, the kind of pipeline behind voices like this one. First, text processing. "Twelve dollars" must be read from a dollar sign and a number, an order code read character by character, names pronounced correctly. That's why this course's scripts spell out some acronyms letter by letter. Second, an acoustic model turns the text into a spectrogram-like plan of the speech. It decides how long each sound lasts, how the pitch rises and falls, and where the emphasis goes. Together, that rhythm and melody is called prosody.
The same words can be a question, with the pitch rising at the end, or a statement, with the pitch falling. Third, a vocoder turns that plan into the actual waveform. In two thousand sixteen, a model called WaveNet showed that neural networks could generate remarkably natural audio this way, and faster vocoders followed.
3:08Expressive control
Modern voice models also accept instructions about how to speak. Our own production scripts contain little tags, "curious", "excited", "pause", that tell the voice model what tone to use, where to breathe, and when to let a moment land. Settings like speed and how expressive or steady the delivery should be give further control. Good delivery isn't decoration. It's a big part of what makes an explanation easy to follow.
3:38Sound as tokens: neural audio codecs
A big shift in audio generation came from turning sound into tokens. A neural audio codec is an autoencoder for sound: its encoder compresses each short frame of audio into a few discrete codes, chosen from learned codebooks, and its decoder rebuilds the audio from those codes. One published codec, at its six-kilobit setting, represents twenty-four-thousand-sample-per-second audio with seventy-five frames per second and eight codes per frame: six hundred tokens a second instead of twenty-four thousand numbers. Once speech is a sequence of tokens, you can use everything from this season: train a transformer to predict the next audio token, just like our tiny GPT predicted the next character, conditioned on the text to be spoken, or on a short sample of a voice.
Decode the predicted tokens, and you hear speech. Other systems use diffusion instead, denoising spectrograms or audio latents. Either way, the core ideas are the ones you already know.
4:45Speech recognition (Whisper) in reverse
The reverse task, turning speech into text, uses the same tools. A well-known open model called Whisper takes a spectrogram, passes it through a transformer encoder, and a decoder writes out the words, much like the original transformer translated sentences. It was trained on about six hundred and eighty thousand hours of audio, which is why it copes well with different accents and background noise. For Brightcart, speech recognition plus a language model plus text-to-speech makes a phone assistant, handled with customers' consent and proper data protection.
5:23Music generation
Music can be generated in two forms: as symbols, like notes on a score, or directly as audio, using the same codec tokens or diffusion methods as speech. Prompt with a description, like "calm acoustic background for a product video, ninety beats per minute", or with a melody to follow. The hardest part is long-range structure: keeping a steady beat, and repeating a chorus coherently minutes later. And for commercial use, always check the rights and licence terms of any tool.
5:55Video generation: the hardest of all
Video is the hardest of all. Five seconds of video at twenty-four frames a second, each frame five hundred and twelve pixels square, is about ninety-four million numbers, a hundred and twenty times a single image. And the frames must agree with each other. Generate each frame separately and the result flickers: the kettle's handle changes shape, the steam jumps around. So video models compress whole clips into a latent that spans both space and time, and run diffusion or transformers over little "space-time patches", so attention can connect the same object across frames and keep it consistent.
Many can start from a text prompt, or animate a single still image. Getting physics right, like flowing liquid or rising steam, keeping objects consistent when they move out of view and back, and producing long clips are still active challenges, and video generation remains expensive. A quick note: names, prices and rankings in AI change fast. Everything on screen was accurate when this video was made, but some of it may have changed by the time you're watching.
7:07Voice cloning, consent and disclosure
Synthetic voices bring real risks. With a short recording, some systems can imitate a person's voice, and scammers have used cloned voices to impersonate relatives and executives. The safeguards: never clone a voice without clear consent; tell people when they're hearing a synthetic voice or watching generated video; use watermarking and provenance tools where available; and build habits like calling back on a known number before acting on an urgent request. For Brightcart: licensed synthetic voices only, and every caller is told they're speaking with an AI assistant.
7:47Try it yourself: how small is a token stream?
How much does a neural codec compress speech? One minute of raw audio at twenty-four thousand samples per second, two bytes per sample, is about two point nine megabytes. Our codec runs at six kilobits per second. Pause and work out its size.
Six thousand bits a second, times sixty seconds, divided by eight bits per byte: forty-five thousand bytes, about sixty-four times smaller, stored as thirty-six thousand tokens. That compact token stream is what makes language-model-style audio generation practical.
8:29Pause & Predict: words vs audio tokens
A ten-second spoken sentence, about fifteen words. As text, it's roughly twenty tokens. How many audio tokens? Pause. Six thousand, around three hundred times more. That's because audio carries much more than the words: the speaker's voice, their emotion, their timing, even the room they're in. It's also why modelling speech directly is far more expensive than modelling text, and why audio models work so hard to compress.
9:06Try it yourself: word error rate
Speech recognisers are scored with word error rate. The customer said "your parcel arrives on Friday", five words. The system heard "your parcel arrived Friday". How many errors? Pause. One substitution, "arrived" for "arrives", and one deletion: "on" is missing. Two errors out of five words: a forty percent word error rate. But notice the limitation: every word counts equally, yet getting "Friday" wrong would matter far more than the verb ending. Good evaluation also checks the words that matter.
9:47Video in a latent space
Video generation leans heavily on compression. Five seconds of five-hundred-and-twelve-pixel video is over ninety-four million numbers. Compress each frame into a latent, as text-to-image models do, and it drops to under two million, forty-eight times fewer, and many video models compress across time as well. Then attention works across frames too, so each patch can look at the same region in other frames, which keeps the kettle's handle in the same place instead of flickering.
10:22Music: structure over minutes
Music adds another challenge: structure over minutes. A song has verses and choruses, and a generator must keep the key, the tempo and the melody consistent across thousands of tokens. Some systems generate audio tokens directly; others first plan the melody, lyrics and structure, then render the sound. And music raises sharp questions about training data and artists' rights, which are being debated and tested in court in several countries.
10:54A voice assistant for Brightcart
How could Brightcart use all this? A voice assistant chains three pieces: speech recognition to hear the customer, a language model grounded in Brightcart's data to decide what to say, and text-to-speech to reply. The hard part is speed: the conversation must feel natural, so each stage streams its output to the next instead of waiting. There are accessibility benefits too, like reading order updates aloud and captioning product videos. And customers should always be told when they're speaking with an AI.
11:30Pause & Predict: how to read 3/4 aloud
How should a voice read this message aloud: "Order number four-one-two-seven ships three slash four"? Pause and think about "three slash four". It could be "three quarters". In the United States, it's probably the fourth of March. In the United Kingdom, it's the third of April. Text normalisation, the first step of a speech pipeline, has to make that call, and a wrong guess sends a customer to the door on the wrong day. The best fix is upstream: write dates unambiguously in the first place, like "the fourth of March", so neither people nor machines have to guess.
12:14Myth vs Fact
Myth: you can always spot an AI voice or video. Fact: quality has improved so much that many people can't reliably tell the difference. Don't rely on spotting glitches. Rely on disclosure, provenance information and verification.
12:30Recap
Let's recap. Audio is a long list of samples, often turned into spectrograms on the mel scale. Text-to-speech converts text into a plan of timing, pitch and emphasis, then a vocoder turns it into sound. Neural codecs turn audio into tokens, so transformers can generate speech and music by predicting the next token, while other systems use diffusion. Video generation works over space and time together, to keep frames consistent. And because synthetic voices and video can deceive, consent, disclosure and provenance are essential.
One sentence to remember: turn sound and motion into tokens, and the same machines can speak and move.
13:17Next: multimodal models
Mission complete. Brightcart's assistant can listen and speak on the phone, honestly disclosed as AI, and product videos can be generated with consistent frames. That completes Module Twelve, generation: images, sound and video. Next, the models that combine them: a customer sends a photo of a broken lamp along with a message. Can one model understand both the picture and the words? Multimodal models, next. See you on the map.