Is it possible to play 2 mp3 files at the same time in C#? I can only get it to work with playing one file at the same time with the mci library
This is a discussion on playing 2 mp3 files at same time within the C# Programming forums, part of the General Programming Boards category; Is it possible to play 2 mp3 files at the same time in C#? I can only get it to ...
Is it possible to play 2 mp3 files at the same time in C#? I can only get it to work with playing one file at the same time with the mci library
Have you tried giving each mp3 a different mci alias? Eg.
Not tested this but I did something similar once to allow simultaneous recording and playback.Code:[DllImport("winmm.dll")] private static extern Int32 mciSendString(String command, StringBuilder buffer, Int32 bufferSize, IntPtr hwndCallback); private void PlayTwoSongs() { String path = "c:\\some_song.mp3"; mciSendString("open \"" + path + "\" type mpegvideo alias songA", null, 0, IntPtr.Zero); mciSendString("play songA", null, 0, IntPtr.Zero); path = "c:\\another_song.mp3"; mciSendString("open \"" + path + "\" type mpegvideo alias songB", null, 0, IntPtr.Zero); mciSendString("play songB", null, 0, IntPtr.Zero); }
Last edited by theoobe; 05-30-2011 at 06:05 PM.
thanks a lot, that worked. I did not think of this