VLC - Play two mp3s simultaneously from command line
Solution 1
You need to use the START command and a little batch file.
Your batch will be something like this
start "First MP3" vlc 1.mp3
start "Second MP3" vlc 2.mp3
START is a command with the following arguments:
start "TITLE" command [arguments]
Where "TITLE" is any name (enclosed between quotes) and command, in this case, is vlc
or vlc.exe
. The argument is your .mp3
file.
This assumes the batch file is at the same directory VLC is. The batch will run two separate instances of VLC simultaneously. I've tested it in Windows XP and it works.
Solution 2
Not VLC, but with ffplay you can use:
ffplay -f lavfi -i 'amovie=file1.mp3[01];amovie=file2.mp3[02];[01][02]amerge'
You can get ffplay from here -- that also includes the ffmpeg encoding tool (which you may find useful), but you can just ignore that and extract ffplay.exe
from the bin directory within the 7z.
You won't be able to seek with this (ffplay is actually re-encoding on the fly here, and it's really quite a simple program. Using ffmpeg, you could permanently merge two audio files, and the result would be seekable). You might be able to get better (by which I mean 'seekability' rather than audio quality) results with either VLC or mplayer, but I think the easiest way would be to just launch two instances of VLC (e.g. as detailed in DoktoroReichard's answer).
Solution 3
It doesn't exactly answer my question, but my solution was to load the m3ps in Audacity, cut them to the same length, and export them as one mp3.
Related videos on Youtube
Martin Kučera
Updated on September 18, 2022Comments
-
Martin Kučera over 1 year
I'm using VLC 2.0.8 on Windows 7. How do I play two mp3s simultaneously from the command line (command line because to write a batch script that launches the mp3s)? I've tried
vlc 1.mp3 2.mp3
and
vlc 1.mp3 --input-slave 2.mp3
(I've seen the second one as a way to play a video file and a separate audio file simultaneously). Both of these just launch 1.mp3.
Not important, but if you're wondering, the mp3s are respectively cafe sounds and rain sounds, so I can play sounds similar to those found at http://rainycafe.com/ without having to launch a browser.
-
mtone over 10 yearsEven within the GUI, the "Open multiple files" with Extra synchronous track doesn't seem to work with 2 audio files. Before investigating command lines, you should out if the app even supports it within the GUI (if not, it's a bit strange that the GUI lets the user attempt it without any error messages)
-
Martin Kučera over 10 yearsThanks. I didn't even think to try it within the GUI. I only specified command line so that I could get an answer that used the command line, and not to imply that I could do it with the GUI. So are you saying you think it's impossible?
-
mtone over 10 yearsYeah, it made me think that it's not supported without a video primary file, but I can't confirm for sure.
-
-
Martin Kučera over 10 yearsThank you! I went with my own solution of merging the files because I wanted to do it immediately, but I'm accepting yours because it actually answers the question. Your answer also doesn't require downloading Audacity and figuring out how to edit and merge tracks with it.