---
name: Convert To MP3
description: Convert audio files to MP3 320kbps, preserving metadata.
version: 1
author: pastilhas
tags:
  - audio
  - conversion
skills:
  - convert-audio-to-mp3
trigger:
  - type: file
    extensions:
      - flac
      - wav
      - ogg
      - wma
      - aac
      - m4a
      - opus
      - aiff
      - aif
      - ape
      - wv
      - alac
      - dsf
      - dff
  - type: directory
inputs:
  - name: file_path
    description: Path to an audio file or an artist directory to convert.
    required: true
---

# Convert To MP3

Convert audio files to MP3 320kbps, preserving metadata.

## Steps

1. Determine whether `file_path` points to a single audio file or a directory.
2. If it is a single file, use the Convert Audio To MP3 skill's single-file script to convert it. The source file is deleted on success.
3. If it is a directory, use the Convert Audio To MP3 skill's batch script with the directory name as the artist name. All audio files within subdirectories are converted recursively.
4. Verify the conversion completed successfully and report the result to the user.
