# Audio only

> Podcasts and audiobooks in, MP3 and M4A out.

Inputs may be audio files (`mp3`, `wav`, `m4a`, `aac`, `flac`, `ogg`, `opus`), and outputs audio
files. This project turns an English podcast into Spanish MP3 and M4A files:

```json JSON
{
"name": "Podcast — Spanish",
"config": {
  "sourceMedia": { "@type": "S3FolderSource" },
  "transcription": { "@type": "Speechmatics", "language": "en" },
  "translations": [
    {
      "language": "es",
      "engine": { "@type": "Gemini" },
      "ttsOptions": { "provider": { "@type": "Azure", "voice": "es-ES-ElviraNeural" } }
    }
  ],
  "outputs": [
    {
      "@type": "S3FolderOutput",
      "items": [
        {
          "@type": "AudioFile",
          "containerFormat": "mp3",
          "ext": "mp3",
          "nameTemplate": "${name}.es.${ext}",
          "dubTracks": [{ "language": "es", "codec": "libmp3lame" }]
        },
        {
          "@type": "AudioFile",
          "containerFormat": "ipod",
          "ext": "m4a",
          "nameTemplate": "${name}.es.${ext}",
          "dubTracks": [{ "language": "es" }]
        }
      ]
    }
  ]
}
}
```

```yaml YAML
name: Podcast — Spanish
config:
sourceMedia: { '@type': S3FolderSource }
transcription: { '@type': Speechmatics, language: en }
translations:
  - language: es
    engine: { '@type': Gemini }
    ttsOptions:
      provider: { '@type': Azure, voice: es-ES-ElviraNeural }
outputs:
  - '@type': S3FolderOutput
    items:
      - '@type': AudioFile
        containerFormat: mp3
        ext: mp3
        nameTemplate: '${name}.es.${ext}'
        dubTracks: [{ language: es, codec: libmp3lame }]
      - '@type': AudioFile
        containerFormat: ipod
        ext: m4a
        nameTemplate: '${name}.es.${ext}'
        dubTracks: [{ language: es }]
```

`episode-12.mp3` gives `episode-12.es.mp3` and `episode-12.es.m4a`.

## A podcast feed, dubbed

A podcast's RSS feed, its episodes as `<enclosure>`s, can be the project's source (`RssSource`).
The project downloads each new episode, dubs it, and publishes the feed again in Spanish
(`RssOutput`), each finished episode linking its Spanish MP3 and its title and description
translated:

```json
{
  "name": "Podcast feed — Spanish",
  "config": {
    "sourceMedia": { "@type": "RssSource", "url": "https://podcast.example.com/feed.xml" },
    "transcription": { "@type": "Speechmatics", "language": "en" },
    "translations": [
      {
        "language": "es",
        "engine": { "@type": "Gemini" },
        "ttsOptions": { "provider": { "@type": "Azure", "voice": "es-ES-ElviraNeural" } }
      }
    ],
    "outputs": [
      {
        "@type": "RssOutput",
        "language": "es",
        "items": [
          {
            "@type": "AudioFile",
            "containerFormat": "mp3",
            "ext": "mp3",
            "nameTemplate": "${name}.${ext}",
            "dubTracks": [{ "language": "es", "codec": "libmp3lame" }]
          }
        ]
      }
    ]
  }
}
```

Give listeners `GET /feeds/{projectId}/es/feed.xml`; it needs no token. Episodes appear in it as
they finish. The project keeps reading the feed until you stop it. See
[Feeds](/vod-express/concepts/inputs#feeds).

## Notes

- **MP3 needs an encoder.** The dub is AAC; `codec: "libmp3lame"` re-encodes it for an MP3 file.
  M4A (`containerFormat: "ipod"`) keeps the AAC as it is.
- **An audio file holds one track**: one dub track, or the input's audio with
  `useOriginalTracks: true`. For the original and the dub side by side, write two files.
- **The input's audio goes into M4A or Matroska.** It is copied as it is, AAC in most inputs, so
  an MP3 or WAV file with `useOriginalTracks: true` is refused. Use `containerFormat: "ipod"` and
  `ext: "m4a"`.
- **From video to audio.** The same items work on video inputs, to deliver the dubbed audio
  alone, for example to a broadcaster that muxes it itself.
- **A video item from an audio input** is an MP4 without a picture that carries the audio tracks.
