Created
December 10, 2017 06:45
-
-
Save furushei/3851be75d1b7a4efcd2d87370a8ec39f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import System; | |
import System.IO; | |
import System.Media; | |
import Microsoft.JScript; | |
var args = Environment.GetCommandLineArgs(); | |
if (args.length < 2) { | |
Console.WriteLine("ファイル名は必須です"); | |
Environment.Exit(1); | |
} | |
var fileName = args[1]; | |
var player = new System.Media.SoundPlayer(); | |
player.SoundLocation = fileName; | |
try { | |
player.Load(); | |
player.PlaySync(); | |
} catch (e) { | |
var ex = Throw.JScriptThrow(e); | |
Console.WriteLine(ex); | |
Environment.Exit(1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
概要
WindowsでWAVEファイルを再生するコマンド。
使い方
> wplay ファイル名
ビルド
次のコマンドでコンパイルすると
wplay.exe
が生成される。ただしx.xxxxx
はバージョンによって変わる。> C:\Windows\Microsoft.NET\Framework\v4.x.xxxxx\jsc.exe wplay.js
コンパイルに用いる
jsc.exe
はWindowsに標準で含まれていると思われる。