V
V
Vladislav2015-05-20 16:49:20
cmd/bat
Vladislav, 2015-05-20 16:49:20

How to start recording sound with a Windows script (and then stop recording)?

There was a similar question for Linux: How to write a script to automatically record sounds? .
We need a program that can be started by a batch file and then stopped. It does not have to be completely console. A file with an audio track should appear on the disk immediately (so that you can quickly but roughly paste this track instead of the second one, guided by the difference in creation dates).
There is a task to record video (currently from an analog camera) with two different audio tracks. Now it is solved by recording two programs from two tuners, respectively, and two video files are stored (plus encoding of two streams in real time). We need some small program that could, by double clicking, quietly record the sound from the selected input and stop when another batch file is closed / launched. Standard Sound Recorder is not suitable, as it writes the result to disk at the end, and also does not allow you to stop recording before the time specified at startup. I'm using VLC, but I would like a simpler alternative: repeating this script from 0 on another computer will take time. Current batch file:

set h=%TIME:~0,2%
set m=%TIME:~3,2%
set s=%TIME:~6,2%
start "C:\Program Files (x86)\VideoLAN\VL\vlc.exe" dshow:// :dshow-vdev="none" :dshow-adev="Mic in at front panel (Pink) (R" :sout="#transcode{vcodec=none,acodec=mp3,ab=128,channels=2,samplerate=44100}:file{dst=C:\\\\Users\\\\FR\\\\Desktop\\\\\%date%_%h%%m%%s%.mp3,no-overwrite}}" :sout-keep

At the same time, maybe tell me a program for simultaneous recording from a capture board and simultaneously streaming broadcasting (via rtsp, for example), which can also be launched with a script? VLC does not fully cope, it does not allow you to receive sound from the capture board. I'm postponing the option to buy a USB sound card. The current working script for VLC requires a second audio source to be connected to the microphone jack on the front panel (which is inconvenient for many reasons):
set h=%TIME:~0,2%
set m=%TIME:~3,2%
set s=%TIME:~6,2%
c:
cd "C:\Program Files (x86)\VideoLAN\VLC"
rem video+sound rear
start vlc.exe dshow:// :dshow-vdev="Behold TV M63: A/V Capture [Slot 7]"  :dshow-adev="Mic in at rear panel (Pink) (Re" :dshow-video-input="1" :dshow-tuner-standard="16" :dshow-size="720x576" :dshow-chroma="YUY2" :sout="#transcode{fps=25,vcodec=mp2v,vb=800,acodec=mpga,ab=128,samplerate=44100,channels=2,audio-sync}:duplicate{dst=display,dst=std{access=mmsh,mux=asfh,dst=0.0.0.0:3727},dst=file{dst=C:\\\\Users\\\\FR\\\\Desktop\\\\\%date%_%h%%m%%s%.ts,no-overwrite}}" :sout-keep
rem sound front
start vlc.exe dshow:// :dshow-vdev="none" :dshow-adev="Mic in at front panel (Pink) (R" :sout="#transcode{vcodec=none,acodec=mp3,ab=128,channels=2,samplerate=44100}:file{dst=C:\\\\Users\\\\FR\\\\Desktop\\\\\%date%_%h%%m%%s%.mp3,no-overwrite}}" :sout-keep

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question