Skip to main content
Home Forums Silverlight Programming Programming with JavaScript Where is AudioStreamIndex set???
6 replies. Latest Post by anil_litam on October 29, 2009.
(0)
sensamecca
Member
2 points
5 Posts
12-18-2007 4:52 PM |
I'm working with some Silverlight examples and we've got it displaying an encoding session just fine. I was curious where we would set the AudioStreamIndex property. It seems to reference a MediaElement object, but I don't see one specifically in the code. We have a player, etc.
We want bi-lingual support in our player and that means referencing either AudioStreamIndex 1 or AudioStreamIndex 2 in our .js (or XML?) files. This code we are using is a sample that's been slightly modified. Does anyone have a JS example of how and where to use this AudioStreamIndex value?
Thanks,
d
Justin-J...
380 points
114 Posts
12-19-2007 7:53 AM |
If I understood you correctly, you're using some sort of ready Silverlight player and want to access It's MediaElement to set some properties.
If you're using on the the Expression Encoder skins you should read Tamir Khason's post on how to customize it: http://blogs.microsoft.co.il/blogs/tamir/archive/2007/12/18/messed-with-silverlight-video-player-skin-generated-by-encoder-see-how-to-customize-it.aspx
Otherwise, It's just a matter of finding the MediaElement inside the player's JS code and exposing it so you could use it.
01-02-2008 2:31 PM |
Does anyone have a sample of where and when to setup an AudioStreamIndex after loading a .wmv file and playing it?
We have code that works that reads AudioStreamCount and it does it correctly. In no way does setting AudioStreamIndex on the same object have any effect. Is there somehwere specific this needs to be done? After a particular event or something? Before a particular event?
kienlua
7 points
2 Posts
10-29-2009 6:22 AM |
Hello everybody,I have a problem with the property "AudioStreamIndex" of the object "MediaElement".- I can get the value of AudioStreamCount and I can set AudioStreamIndex.- But MediaElement does not change the language.> My codes :
The audio tracks' order is : 1 : FR, 2 : EN, 3 : DE
1) When the state of the video change, I call the function "video_CurrentStateChanged" :this.video.CurrentStateChanged += new RoutedEventHandler(video_CurrentStateChanged);2) In my function "video_CurrentStateChanged", if the video's state is Playing,I set the AudioStreamIndex with the value "2" for example (2 = EN : English)private void video_CurrentStateChanged(object sender, RoutedEventArgs e){ if (this.video.CurrentState == "Playing") { this.video.AudioStreamIndex = 2; }}3) The video's audio is always in French (FR)Do you have any ideas about this problem?Thank you everyone for your responses,
anil_litam
558 points
262 Posts
10-29-2009 6:41 AM |
Go through the following link..
http://msdn.microsoft.com/en-us/library/system.windows.controls.mediaelement.audiostreamindex%28VS.95%29.aspx
10-29-2009 6:50 AM |
Hi anil_litam,
Have you ever had the same problem when using the attribut AudioStreamIndex?
10-29-2009 6:53 AM |
Actually i never worked for this.
But the link i given Microsoft is showing how could you set the property...