1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
$Codigo = @" using System; using System.Runtime.InteropServices; namespace NS { public class Send { [DllImport("winmm.dll")] public static extern Int32 mciSendString(string command, string buffer, int bufferSize, IntPtr hwndCallback); } } "@ Add-Type $Codigo # Grabar [NS.Send]::mciSendString("open new Type waveaudio Alias recsound", "", 0, 0) [NS.Send]::mciSendString("record recsound", "", 0, 0); # Parar la grabación [NS.Send]::mciSendString("save recsound C:\\Users\\juan\\record.wav", "", 0, 0); [NS.Send]::mciSendString("close recsound ", "", 0, 0); |