<# Converts FLAC/MP3/WAV files to the OGG Vorbis tracks the game plays from data\music. .\tools\convert-music.ps1 -Source "F:\Music\Minecraft - Volume Alpha" -Prefix alpha .\tools\convert-music.ps1 -Source "F:\Music\Minecraft - Volume Beta" -Prefix beta Needs ffmpeg (with libvorbis) in PATH. Every .ogg in data\music is shuffled by the in-game music player, volume is the "Music" slider in the options. #> param( [Parameter(Mandatory)] [string]$Source, [string]$Prefix = 'track', [string]$Out = (Join-Path $PSScriptRoot '..\data\music') ) New-Item -ItemType Directory -Force $Out | Out-Null Get-ChildItem -LiteralPath $Source -Include *.flac, *.mp3, *.wav, *.m4a -Recurse | ForEach-Object { $name = ($_.BaseName -replace '[^\w\- ]', '') -replace '\s+', '_' $dst = Join-Path $Out "${Prefix}_$name.ogg" if (-not (Test-Path $dst)) { & ffmpeg -loglevel error -y -i $_.FullName -vn -map_metadata -1 -acodec libvorbis -aq 4 -ar 44100 -ac 2 $dst Write-Host $dst } }