---
title: Preparing the audio — P-Video-2-Pro-Lipsync | Runware Docs
url: https://runware.ai/docs/models/prunaai-p-video-2-pro-lipsync/guides/preparing-the-audio
description: "How to prepare the audio for Pruna P-Video-2-Pro-Lipsync: how it sets the length of the output, sizing a line to the shot, and keeping music under the speech."
---
### [Introduction](https://runware.ai/docs/models/prunaai-p-video-2-pro-lipsync/guides/preparing-the-audio#introduction)

In P-Video-2-Pro-Lipsync the audio does two jobs. The mouth follows its speech, and it **becomes the whole soundtrack** of the output, music and room sound included. Together with the video, it also **sets the length** of the clip. Turn the sound on:

[Watch video](https://runware.ai/docs/assets/hero.D7vygpMj.mp4)

*The new line, with a music bed under it*

**Source video**:

[Watch video](https://runware.ai/docs/assets/source-backpack.q3Xl2xVd.mp4)

> **Prompt**: The founder of a travel gear brand, a woman in her thirties with a dark bob, in a mustard cardigan, stands in a bright studio holding a charcoal gray carry-on backpack up to the camera and says, "This is the bag I wanted for every trip, and it fits under any plane seat." Medium close-up, locked-off camera, white walls and a rail of bags softly out of focus behind her, soft even light. Photoreal e-commerce product video, no text, no logos. Audio: her warm clear voice close to the microphone over an upbeat acoustic music bed.

**New audio**:

[Listen to audio](https://runware.ai/docs/assets/audio-backpack-mix.Ca6vxGgf.mp3)

This guide covers **how long the output runs**, and how to keep music and ambience under the new speech.

### [Output length](https://runware.ai/docs/models/prunaai-p-video-2-pro-lipsync/guides/preparing-the-audio#output-length)

The output **runs as long as the shorter of the two inputs**, up to 60 seconds. A short line ends the clip early, and a line that **runs past the video is cut** where the video ends, wherever in the sentence that falls. The two lines below go to the same clip of an agent:

[Watch video](https://runware.ai/docs/assets/source-apartment.BrQcwKFZ.mp4)

*The source clip*

> **Prompt**: A real estate agent, a man in his thirties with short curly hair, in a dark green quarter-zip, stands in the bright empty living room of an apartment for sale and says to the camera, "Welcome in. The living room gets light all day, and the kitchen is right through here." Medium shot, locked-off camera, tall windows and pale wood floors behind him, afternoon daylight. Photoreal property listing video, no text, no logos. Audio: his friendly clear voice close to the microphone, light room echo, no music.

[Listen to audio](https://runware.ai/docs/assets/speech-apartment-fits.C1-MlRq1.mp3)

*A line that fits the clip*

> **Prompt**: There is an open house this Saturday, from ten in the morning until two.

[Listen to audio](https://runware.ai/docs/assets/speech-apartment-long.DJaG2Qqb.mp3)

*A line that runs longer than the clip*

> **Prompt**: There is an open house this Saturday, from ten in the morning until two, and you can book a private viewing on any weekday evening after six.

**Line that fits**:

[Watch video](https://runware.ai/docs/assets/output-apartment-fits.C3HJ-sPX.mp4)

*Ends with the line*

**Line that runs long**:

[Watch video](https://runware.ai/docs/assets/output-apartment-long.Br6L4zEb.mp4)

*Ends with the video, partway through the line*

The long line runs 7.7 seconds against a 6.6-second clip, so its output **stops at 6.5 seconds**, right after "on any weekday". The short line runs 4.3 seconds, and its output ends with it.

**Time the line to the shot** before you send it. Measure the audio against the video, and shorten the script or ask the voice for a quicker delivery when it runs over. When the line is the shorter input, the clip ends with the audio file, so **leave a short pause after the last word** to keep the final syllable from landing on the last frame.

The output is **billed per second of video returned**, rounded up to the next second, so trimming the longer input to the part you need also sets the cost. Anything past 60 seconds is cut, so split a longer piece into takes of up to a minute and join them in the edit.

### [Music and ambience](https://runware.ai/docs/models/prunaai-p-video-2-pro-lipsync/guides/preparing-the-audio#music-and-ambience)

The audio you send **replaces the soundtrack of the source**. Sent with the speech alone, the founder's clip loses the music bed it was shot with:

[Watch video](https://runware.ai/docs/assets/output-backpack-dry.BgdGOqVK.mp4)

*The same new line, sent without the music bed*

To keep music or room sound, **mix it into the audio before the request**, with the music low enough that the voice stays on top. The hero above is this same line over this bed:

[Listen to audio](https://runware.ai/docs/assets/speech-backpack.DTQIBrM5.mp3)

*The speech*

> **Prompt**: Our carry-on backpack is back in stock, in three new colors.

[Listen to audio](https://runware.ai/docs/assets/music-backpack.DApm3lXD.mp3)

*The music bed, trimmed to the clip*

> **Prompt**: A 20-second upbeat acoustic instrumental for a product ad, 110 BPM. Bright acoustic guitar strums, light hand claps and a soft kick drum. Positive and steady from the first beat, no vocals.

Any audio tool builds the mix. With ffmpeg, the speech starts 0.3 seconds in and the music plays at 30% under it, for as long as the longer of the two files:

```bash
ffmpeg -i speech.mp3 -i music.mp3 -filter_complex "[0:a]adelay=delays=300:all=1[voice];[1:a]volume=0.3[bed];[voice][bed]amix=inputs=2:duration=longest:normalize=0" mix.mp3
```

The mix then goes in `inputs.audio` like any other speech file:

**TypeScript**:

```typescript
import { createClient } from '@runware/sdk'

const client = await createClient({ apiKey: process.env.RUNWARE_API_KEY })
await client.connect()

const [result] = await client.run({
  model: 'prunaai:p-video@2-pro-lipsync',
  inputs: {
    video: 'https://assets.runware.ai/guides/prunaai-p-video-2-pro-lipsync/preparing-the-audio/source-backpack.mp4',
    audio: 'https://assets.runware.ai/guides/prunaai-p-video-2-pro-lipsync/preparing-the-audio/audio-backpack-mix.mp3'
  },
  deliveryMethod: 'async'
})
```

**Python**:

```python
import asyncio
import os

from runware import Runware

async def main():
    async with Runware(api_key=os.environ["RUNWARE_API_KEY"]) as client:
        results = await client.run({
            "model": "prunaai:p-video@2-pro-lipsync",
            "inputs": {
                "video": "https://assets.runware.ai/guides/prunaai-p-video-2-pro-lipsync/preparing-the-audio/source-backpack.mp4",
                "audio": "https://assets.runware.ai/guides/prunaai-p-video-2-pro-lipsync/preparing-the-audio/audio-backpack-mix.mp3"
            },
            "deliveryMethod": "async"
        })

asyncio.run(main())
```

**cURL**:

```bash
curl https://api.runware.ai/v1 \
  -H "Authorization: Bearer $RUNWARE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "taskType": "videoInference",
      "taskUUID": "bc48b29c-0b2a-4b33-836d-70cd0699c14e",
      "model": "prunaai:p-video@2-pro-lipsync",
      "inputs": {
        "video": "https://assets.runware.ai/guides/prunaai-p-video-2-pro-lipsync/preparing-the-audio/source-backpack.mp4",
        "audio": "https://assets.runware.ai/guides/prunaai-p-video-2-pro-lipsync/preparing-the-audio/audio-backpack-mix.mp3"
      },
      "deliveryMethod": "async"
    }
  ]'
```

**CLI**:

```bash
runware run prunaai:p-video@2-pro-lipsync \
  inputs.video=https://assets.runware.ai/guides/prunaai-p-video-2-pro-lipsync/preparing-the-audio/source-backpack.mp4 \
  inputs.audio=https://assets.runware.ai/guides/prunaai-p-video-2-pro-lipsync/preparing-the-audio/audio-backpack-mix.mp3 \
  deliveryMethod=async
```

**JSON**:

```json
{
  "taskType": "videoInference",
  "taskUUID": "bc48b29c-0b2a-4b33-836d-70cd0699c14e",
  "model": "prunaai:p-video@2-pro-lipsync",
  "inputs": {
    "video": "https://assets.runware.ai/guides/prunaai-p-video-2-pro-lipsync/preparing-the-audio/source-backpack.mp4",
    "audio": "https://assets.runware.ai/guides/prunaai-p-video-2-pro-lipsync/preparing-the-audio/audio-backpack-mix.mp3"
  },
  "deliveryMethod": "async"
}
```

The mouth **follows the voice in the mix**, and the music plays under it to the end of the clip.

### [Tips](https://runware.ai/docs/models/prunaai-p-video-2-pro-lipsync/guides/preparing-the-audio#tips)

1. **Measure the line against the clip.** The shorter input sets the length, and a line that runs past the video is cut where the video ends.
    
2. **End the audio on a short pause.** The clip stops with the file, so a pause keeps the last word from ending on the final frame.
    
3. **Mix the music into the audio you send.** The output carries only that audio, so anything the source played is gone unless the mix brings it back.
    
4. **Split anything longer than a minute.** The output stops at 60 seconds, so send longer pieces as separate takes.