---
# System prepended metadata

title: m4a to mp3

---

# m4a to mp3
 
## what it does
 
powershell script that reads each m4a file within a folder and converts it using ffmpegs libmp3lame encoder to mp3
 
## prerequisites
 
- [x] [ffmpeg.exe](https://www.gyan.dev/ffmpeg/builds/ffmpeg-git-essentials.7z) installed to C:\convert\ffmpeg.exe
- [x] input and output folder at C:\convert
- [x] configure PowerShell to use ```ExecutionPolicy = Unrestricted```
 
## how to use
1. put all your m4a files in the *input* folder
2. press WIN+X and select **Windows PowerShell (Administrator)**
3. type ```cd C:\convert``` and run ```.\convert.ps1```
4. wait until everything has converted
5. find your mp3s in the *output* folder

## PowerShell script
 
```=
$files = Get-ChildItem "C:\convert\input\"
  
foreach( $file in $files ) {
  C:\convert\ffmpeg.exe -i C:\convert\input\$file -codec:v copy -codec:a libmp3lame -q:a 2 "C:\convert\output\$file.mp3"
}
```