# encoding: ascii
# api: powershell
# title: Convert-ToMP3
# description: This script uses VLC to convert an audio file to MP3 format. It makes the assumption that you have an Alias “vlc” that points to the VLC executable.
# version: 0.1
# author: CrazyDave
# license: CC0
# x-poshcode-id: 1561
# x-archived: 2017-03-18T07:48:11
# x-published: 2010-12-27T19:36:00
#
#
param([String] $inputPath, [String] $wildcard, [String] $outputPath = $inputPath)

gci -path $inputPath\$wildcard | % {  
  $outputFile = Join-Path $outputPath ($_.Name.Replace($_.Extension, '.mp3'))  
  vlc -I dummy $_.FullName ":sout=#transcode{acodec=mp3,ab=128,channels=6}:standard{access=file,mux=asf,dst=$outputFile}" vlc://quit
  Get-Process vlc | % { $_.WaitForExit() }
}
