Audio to different channels

Oct 12, 2011 at 1:13 AM

Great tool for video! And - assuming that this could be used for just audio...

Wanted to take one stream of audio and play it through only the left or right.  Then take a different audio stream and play it on the other (right or left).

Would this be possible with the MediaKit?  Or would this have to be done on the streaming/server side?

Thanks for any help or pointers to where I can get help!

 

Oct 12, 2011 at 8:09 AM

My $0.02 worth:

For your purpose, you might need a filter that can mix L/R audio from two input streams.  Or you can always use ffdShow to re-mix streams from the same source into the output.  However, I don't think MediaKit has built-in facilities to do this, which really belongs with DirectShow and custom filters.

Once you get it done in DirectShow, there is nothing to prevent you from modifying the sources in order to build the DirectShow graph exactly as you want it.  There is one method that builds the graph.

- Stephen

 

Oct 12, 2011 at 4:10 PM

Thanks for the reply Stephen.

I was hoping that I wouldn't have to build a graph on the client side... and use a plug n play control type to route sound to left or right only.  Although I'll be using a graph on the server, there's multiple clients that could ask for any particular audio stream and choose to receive it in stereo or just left or right.  So, I suppose I would need to build a graph on the client or if this routing needs to be on the server side then I would probably have to create multiple graphs for each (stereo, left only, and right only) -- wanted to avoid that.

I tried to play with MediaElement's Balance prop -- but that does not completely work.  I still hear sound on the other side when I set to -1.0 or 1.0.

Thought that MediaKit might have a different way to handle the balance control.

I guess I'll keep researching/testing with graphs rather than players (out of the box wpf controls)?

Thanks again,

Jimmy

Oct 13, 2011 at 3:24 AM

Well, AFAIK, balance in Windows audio does not work consistently across different hardware.

Also, check whether you have 5.1 audio or other types of audio post-processing (e.g. sound expansion aka WOW) turned on in Windows.  Even with one channel muted, after processing, Windows may be redistributing this audio among all the six channels, so the other (supposedly-muted) channel(s) may have a little bit of sound.

At least for Windows < 7, I haven't found a way to make it work consistently across a range of different audio chipsets, so I ended up creating my own filter to select one channel or another.  I have not really tested it with Windows 7 though, as I've been using my filter.  If you want a copy of that filter, let me know.

I understand you're not playing any video, but fyi if you are playing an MPEG-1 coded video (aka VideoCD) and have dual languages on L/R channels, you can use the IMepgAudio (or something of that sort) interface to choose the channel.  However, it only works for MPEG-1 audio though.

 

Oct 13, 2011 at 5:29 PM

Stephan - YES - I would be extremely grateful if I could get a copy of your filter to direct to different channels.  I believe Chris Parsons - also created something along those lines called AudioChannelShifter - but have not played with his filter yet because it was really specially made for someone (with a 7.1 card).

So - for the copy of your filter - if you don't want to give me the source to build it - Can you be kind enough to give me a 32 and 64bit version?  Any code samples to use your filter would be great, too :)

I'll test it out on 7 (32bit) and 2008 Ent (64bit) for you.

I'm thinking I might try out the MPEG-1 route, too.  As long as the conversion/transpose doesn't eat up too much it might prove to be a back up.

Thanks a ton!!!