PoshCode Archive  Artifact [afcbf62893]

Artifact afcbf628934c0936c4ce600f97c41025f726b3513c9c8913e1dcc5d62a2f6d7b:

  • File Convert-ToMP3.ps1 — part of check-in [dfa57c4b9c] at 2018-06-10 12:58:34 on branch trunk — 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. (user: CrazyDave size: 771)

# 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() }
}