5 Replies - 4094 Views - Last Post: 09 October 2012 - 07:38 PM Rate Topic: -----

#1 allan.tony  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 02-October 12

Using Multiple sound card in C#

Posted 02 October 2012 - 11:45 PM

I have a little project that i have been working on so that i would have a ability to play 4 mp3's each on its own separate audio device.

I am using VLC(AXVLC.VLCPlugin2)to play audio. I am not able assign audio device for each player. Can any help me.
Is This A Good Question/Topic? 0
  • +

Replies To: Using Multiple sound card in C#

#2 immeraufdemhund  Icon User is offline

  • D.I.C Regular

Reputation: 79
  • View blog
  • Posts: 495
  • Joined: 29-March 10

Re: Using Multiple sound card in C#

Posted 03 October 2012 - 04:31 AM

Windows 7 made it a little easier to do such a thing, but I had a similar project that required me to oscialte a noise from left channel to right channel on one of the playback devices, thankfully device number 0 was the speakers and not the headphones for me always.

If this program is only going to run on that one computer with multiple sound cards, I would recommend looking into NAudio library. I downloaded only the required source code that i needed and in it I remember being able to tell NAudio which playback device I want to play a sound to. If i remember too the NAudio library allows the ability to read in Mp3 an output to the speakers. (been a little bit since i looked into it so don't quote me on that)

I think what you could do then is make a simple little window that enumerates all of your playback devices. You could then hit test and it would play a sound through that particular playback device. Then you could assign global variables to reference the desired playback device number.

Let us know how it goes.
Was This Post Helpful? 1
  • +
  • -

#3 allan.tony  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 02-October 12

Re: Using Multiple sound card in C#

Posted 05 October 2012 - 04:25 AM

I have to use VLC(AXVLC.VLCPlugin2) that why, i was not able to use NAudio, do you have any other idea.
Was This Post Helpful? 0
  • +
  • -

#4 immeraufdemhund  Icon User is offline

  • D.I.C Regular

Reputation: 79
  • View blog
  • Posts: 495
  • Joined: 29-March 10

Re: Using Multiple sound card in C#

Posted 06 October 2012 - 03:26 PM

VLC plays through the default speakers in Win7. So unless you can find a command to choose which sound card to play sound through then your other option is to find a way to get that plugin to work with NAudio or with some other library that allows you to choose which sound card to play from. Do you have the option to switch which codec is used so you don't have to use the AXVLC plugin?
Was This Post Helpful? 0
  • +
  • -

#5 allan.tony  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 02-October 12

Re: Using Multiple sound card in C#

Posted 08 October 2012 - 10:29 PM

View Postimmeraufdemhund, on 06 October 2012 - 03:26 PM, said:

VLC plays through the default speakers in Win7. So unless you can find a command to choose which sound card to play sound through then your other option is to find a way to get that plugin to work with NAudio or with some other library that allows you to choose which sound card to play from. Do you have the option to switch which codec is used so you don't have to use the AXVLC plugin?


Hi,
Manually I was able to change Different sound card in VLC by tools-->Preferences-->Audio, but how can i change it by programmatically in C# or how I add vlc command in c#.

Hi,
Manually I was able to change Different sound card in VLC by tools-->Preferences-->Audio, but how can i change it by programmatically in C# or how I add vlc command in c#.
Was This Post Helpful? 0
  • +
  • -

#6 immeraufdemhund  Icon User is offline

  • D.I.C Regular

Reputation: 79
  • View blog
  • Posts: 495
  • Joined: 29-March 10

Re: Using Multiple sound card in C#

Posted 09 October 2012 - 07:38 PM

That my friend would be a google question. See if their are any command line switches that are available in the documents that you can use when you start VLC to choose which sound card to use. There usually is not a programmatic way to "A,B,C" in a program, but sometimes there are command line switches that allow you to do some basic functionality to a program. With that in mind this is where opensource programs come in handy because you can get the source code, and with a little tinkering you can figure out how to manipulate/hard code a way to make a program do what you want it to do on your computer.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1