Home > Archive (Community help, from old helpdesk) > Audio_SetStream is not working!

Audio_SetStream is not working!

Avatar image
Aug 24, 2015
Archive Agent wrote
I loke at the demo , and use a file (mpeg, it has two audio stream). but the wpf demo or the winform demo(media player demo) can't change the audio stream. so what can i do? I'm using the FFMPEG source mode.

WpfApplication2.rar 61 KB - 28 downloads
qakmak on April 16, 2013 16:00
Completed
0
Vote
Reply
30 Answers
Aug 24, 2015
Archive Agent agent wrote
Roman Minyaylov

Use DirectShow engine.

on April 16, 2013 16:02
Aug 24, 2015
Archive Agent agent wrote
qakmak

not working , MediaPlayer1.Audio_SetStream(1, true) always return false.
are you sure it support change mpeg audio stream?
by the way , if use DirectShow, the video looks not like ffmpeg good.
please give me another solution.

on April 16, 2013 16:18
Aug 24, 2015
Archive Agent agent wrote
Roman Minyaylov

That's only one solution. This interface not supported in FFMPEG. To
improve quality using DirectShow engine use another video decoder.

on April 16, 2013 16:23
Aug 24, 2015
Archive Agent agent wrote
qakmak

Oh, common....., it's so bad.....
So, I'm only know mpeg can support multiple audio stream. You want me use another video decoder, so tell me what decoder can support multiple audio stream. and say some decoder tools for change the video.

I'm very sorry, please, must help me.thanks.

on April 16, 2013 16:27
Aug 24, 2015
Archive Agent agent wrote
Roman Minyaylov

We'll add this feature within several days, please wait.

on April 16, 2013 17:31
Aug 24, 2015
Archive Agent agent wrote
qakmak

Is that Audio_Balance_Set useless too? I'm play vcd(mpg) can't change anything.

on April 16, 2013 17:32
Aug 24, 2015
Archive Agent agent wrote
qakmak

ok, please hurry. if can use mpeg is best. if can use ffmpeg is best. don't let use change audio stream must replay video , because, I need change the the stream when the video is playing.

on April 16, 2013 17:40
Aug 24, 2015
Archive Agent agent wrote
qakmak

there is the last question. I need play some movie. and the movie Left audio channel is English voice. and the right audio channel is France voice. so I need change the channel when video is playing state(but I'm use your api Audio_Balance_Set it not working). and if I'm change the right channel. I need the right channel voice to be a store(just like play vcd and change channel , when change to right channel , right Speaker and left Speaker playing the right channel , not like : right Speaker is on and left Speaker is off).

on April 16, 2013 17:47
Aug 24, 2015
Archive Agent agent wrote
qakmak

If you know the answer for the previous question, please told me now . thanks.

on April 16, 2013 17:50
Aug 24, 2015
Archive Agent agent wrote
qakmak

Is there any solution for my final question?

on April 16, 2013 20:54
Aug 24, 2015
Archive Agent agent wrote
Roman Minyaylov

Please download updated version - http://visioforge.com/files/visioforge_sdks_installer_dotnet_setup_trial.zip

Both problems has been resolved.

on April 16, 2013 21:01
Aug 24, 2015
Archive Agent agent wrote
qakmak

ok, the first problem is fix. thanks. you're so fast.
but problem 2 not fix. maybe problem 2 not a problem, it's just a little idea.
if I'm use Audio_Balance_Set api. can let the right speaker on ,and left speaker off. or let the right speaker off and the left speaker on. but i want if I'm let right speaker on(use balance api . choice right audio channel) , don't off the left speaker, let the left speaker and right speaker play the right speaker voice. (just like you use two speaker listen the right channel or the left channel music.)

on April 17, 2013 09:41
Aug 24, 2015
Archive Agent agent wrote
qakmak

and the new problem is , when I'm update the new version, the media player control is not working(but the demo is fine, can work), I don't know why. when I use my own project, when I play some video, I can hear the music, but the video is not working, can't display.(but same video can play in your project demo).

and final question is , why the audio effect is not working ? I'm try use FFMPEG or DirectShow. both can't enable that.

on April 17, 2013 09:44
Aug 24, 2015
Archive Agent agent wrote
Roman Minyaylov

Yes, balance require a new feature,so, not a bug. We'll analyze and add it.

About your application - maybe .Net assemblies in your project is still old, not replaced by new.

About audio effects - we'll check soon. Audio effects "Enabled" checkbox in Main Demo must be enabled before Play button pressed.

on April 17, 2013 10:06
Aug 24, 2015
Archive Agent agent wrote
qakmak

About the balance. can you guys try add a property bool, like bool Enable_All_Speaker.
if user set this property :true. and if user use balance and choice the right channel or the right channel. you let the both speaker play the choice channel. not on some one , and off some on.(if user need old mode. set the Enable_All_Speker false)

About my application. there is have one bug. if I want video display. must :MediaPlayer1.Video_Effects_Enabled = true; before play();
why? please check it and fix it.

About audio effect. I always Enable , but it not working, some time I enable , and the audio is disable. I can't hear.

on April 17, 2013 10:47
Aug 24, 2015
Archive Agent agent wrote
Roman Minyaylov

Audio effects ith FFMPEG - problem confirmed, will be fixed in next build, today later

About balance feature - please share your file with us for tests, I hope we'll add it today too.

on April 17, 2013 13:25
Aug 24, 2015
Archive Agent agent wrote
qakmak

ok. wait for me about 2 hour. I find a short video has a two language channel, and convert to a mpg file(vcd). and give you. can u give me your email address, I'm not sure the website supprt upload Large attachments.

on April 17, 2013 13:41
Aug 24, 2015
Archive Agent agent wrote
Roman Minyaylov

send to support@visioforge.com or use Dropbox or example

on April 17, 2013 13:42
Aug 24, 2015
Archive Agent agent wrote
qakmak

I can't send email. because it's turn back................
so , this is dropbox link:https://www.dropbox.com/s/v6f91k7vccl4ksr/WpfApplication2.rar

on April 17, 2013 16:20
Aug 24, 2015
Archive Agent agent wrote
qakmak

and the final problem is , when I change the audio stream:
MediaPlayer1.Audio_SetStream(0, false)//close strem1 first.
MediaPlayer1.Audio_SetStream(1, true)//open stream2 now

when I'm change the audio stream use that code. the application(video and audio) gonna standstill(pause) about 1 second . can you Optimization you api, let the audio stream changing Relatively smooth?

on April 17, 2013 16:24
Aug 24, 2015
Archive Agent agent wrote
Roman Minyaylov

1 second is ok, depends from FFMPEG code, not our SDK...

Download latest build on product page, audio effects problem resolved for FFMPEG engine.

About "balance" - How to copy one channel to both channels - http://support.visioforge.com/knowledgebase/articles/190158-audio-effects-copy-one-channel-to-both-channels

on April 17, 2013 17:44
Aug 24, 2015
Archive Agent agent wrote
qakmak

thanks. but the change channel example can't use it .
that's my code:

MediaPlayer1.Audio_Effects_Enabled = true;
MediaPlayer1.Audio_Effects_Add(-1, VFAudioEffectType.ChannelOrder, true);
MediaPlayer1.Play();

left channel method:
MediaPlayer1.Audio_Effects_SetCurrentChannel(-1, 0, 0);
MediaPlayer1.Audio_Effects_ChannelOrder(-1, 0, 0);

right channel method:
MediaPlayer1.Audio_Effects_SetCurrentChannel(-1, 0, 1);
MediaPlayer1.Audio_Effects_ChannelOrder(-1, 0, 0);

my problem is , only first time it can be effective. and you example not any description.I don't know , Is that I'm using wrong?

on April 17, 2013 19:09
Aug 24, 2015
Archive Agent agent wrote
qakmak

And about the MediaPlayer1.Video_Effects_Enabled = true; And can be display the video problem. because I'm using unregister version. so It need display your company logo , so I must display it.

on April 17, 2013 19:11
Aug 24, 2015
Archive Agent agent wrote
Roman Minyaylov

You are must call it one time or clear effects using Audio_Effects_Clear().

Article has been updated.

on April 17, 2013 19:28
Aug 24, 2015
Archive Agent agent wrote
qakmak

I already try :
MediaPlayer1.Audio_Effects_Clear(-1);
MediaPlayer1.Audio_Effects_Clear(0);
MediaPlayer1.Audio_Effects_Clear(1);

the all not working, so I'm asking, I asking you so many question ,also very embarrassed . I'm not understand why you can using the method without param.
and I'm not understand why the method: Audio_Effects_SetCurrentChannel and Audio_Effects_ChannelOrder audio stream parameter is -1. (because I thinks default first audio stream is 0)

on April 17, 2013 19:45
Aug 24, 2015
Archive Agent agent wrote
qakmak

I can't finish this, I event not understand the api. and clear effect(-1) is not working. can you edit my last project (you can download from dropbox), and give me back?

on April 18, 2013 05:55
Aug 24, 2015
Archive Agent agent wrote
Roman Minyaylov

//Play
private void Button_Click(object sender, RoutedEventArgs e)
{
MediaPlayer1.FilenamesOrURL.Add(System.IO.Path.Combine(Environment.CurrentDirectory, "Demo.mpg"));
MediaPlayer1.Source_Mode = VFMediaPlayerSource.File_FFMPEG;
MediaPlayer1.Video_Renderer = VFVideoRendererWPF.WPF;

MediaPlayer1.Audio_Effects_Clear(-1);

MediaPlayer1.Audio_Effects_Enabled = true;

MediaPlayer1.Audio_Effects_Add(-1, VFAudioEffectType.ChannelOrder, true);

//The new version Bug, if not select this, can't play the video, audio is fine.
MediaPlayer1.Video_Effects_Enabled = true;

MediaPlayer1.Play();

}

//Stop
private void Button_Click_1(object sender, RoutedEventArgs e)
{
MediaPlayer1.Stop();
}

//Play audio use left channel
private void Button_Click_2(object sender, RoutedEventArgs e)
{
MediaPlayer1.Audio_Effects_SetCurrentChannel(-1, 0, 0);

MediaPlayer1.Audio_Effects_ChannelOrder(-1, 0, 0);

MediaPlayer1.Audio_Effects_SetCurrentChannel(-1, 0, 1);

MediaPlayer1.Audio_Effects_ChannelOrder(-1, 0, 0);
}

//Play audio use right channel
private void Button_Click_3(object sender, RoutedEventArgs e)
{
MediaPlayer1.Audio_Effects_SetCurrentChannel(-1, 0, 0);

MediaPlayer1.Audio_Effects_ChannelOrder(-1, 0, 1);

MediaPlayer1.Audio_Effects_SetCurrentChannel(-1, 0, 1);

MediaPlayer1.Audio_Effects_ChannelOrder(-1, 0, 1);
}

//Reset audio channel
private void Button_Click_4(object sender, RoutedEventArgs e)
{
MediaPlayer1.Audio_Effects_SetCurrentChannel(-1, 0, 0);

MediaPlayer1.Audio_Effects_ChannelOrder(-1, 0, 0);

MediaPlayer1.Audio_Effects_SetCurrentChannel(-1, 0, 1);

MediaPlayer1.Audio_Effects_ChannelOrder(-1, 0, 1);
}

on April 18, 2013 09:40
Aug 24, 2015
Archive Agent agent wrote
qakmak

thank you very much. It's ok now. please add some description to the top of the method.(then when we use visual studio programming , we can understand every param role, not like now only can look the param name , It is easy to make people confused ).
thanks again.

on April 18, 2013 11:04
Aug 24, 2015
Archive Agent agent wrote
dsiebes

This:

//The new version Bug, if not select this, can't play the video, audio is fine.
MediaPlayer1.Video_Effects_Enabled = true;

drove me crazy. I spent at least a half day trying to figure out why the wpf control would not render until I found this post.

Is there some sort of known issue webpage or detailed changelog for the SDK webpage? Something where critical notes like this are kept?

Anyway, otherwise the SDKs are great as usual.
Cheers
Dan

on May 17, 2013 08:33
Aug 24, 2015
Archive Agent agent wrote
Roman Minyaylov

Please download updated build

on May 18, 2013 14:31