Home > Suggestions > Discuss About the audio volume of api not corrent problem!

Discuss About the audio volume of api not corrent problem!

Avatar image
Aug 24, 2015
Archive Agent wrote
I don't know any one find or not. I found the audio volume api has some problem.

//For example
MediaPlayer.Audio_Volume_Set(0, Volume );//Volume value is 1-1000

every time I'm set the Volume to 300 or 400. there is not has any audio. so I think may be the Lowest volume not is 0, is 400.

To solve this problem, I changed my way,use this code

double Low = 400.0;//not 0, 400 is a Lowest volume in my case.
double Height = 1000.0;//height is 1000. it's correct.

private int CorrctAudioVolume(int volume)
{
double temp = Low / Height;
return (int)Math.Round((volume + (((Low - ((volume - 1) * (temp))) + (temp)) - 1)));
}

//and you can use like this:
MediaPlayer.Audio_Volume_Set(0, CorrctAudioVolume(Volume));

this is my final way for now. but I found another problem.
400-1000 increase in the volume is not linear. Be some increase in the acceleration curve type.
What I mean is: 400-500 changes are extremely rare, 900-1000 change particularly large, so it is again necessary to reinvent the above method into a better, so everybody, is there any good ideas or opinions ? together to discuss the issue. thanks.

qakmak on July 16, 2013 5:15 PM
Completed
1
Vote
Reply
11 Answers
Aug 24, 2015
Archive Agent agent wrote
Roman Minyaylov

We'll not change volume implementation. And I told already to you how to use it but you are ignore my replies.

Check IBasicAudio.put_Volume description.

on July 16, 2013 7:55 PM
Aug 24, 2015
Archive Agent agent wrote
qakmak

really? I really don't remember. I ask you before, and you said it's a DirectShow API specific .
http://support.visioforge.com/forums/172855-developers-community-help/suggestions/3895410-about-mediaplayer-audio-problem?page=4&per_page=20

I don't understand that. can you told me again please.
I already try use -10000 to 0 .(MSDN), not working.

on July 16, 2013 10:31 PM
Aug 24, 2015
Archive Agent agent wrote
Roman Minyaylov

The following code used:

int k = value;
if (k < 0)
{
k = 0;
}

if (k > 1000)
{
k = 1000;
}

k = k - 1000;

k = k * 10;

int hr = FBasicAudio.put_Volume(k);

on July 17, 2013 12:58 PM
Aug 24, 2015
Archive Agent agent wrote
qakmak

FBasicAudio.put_Volume(int); where is this?? I don't find it. or you want me implement IBasicAudio??

on July 17, 2013 1:46 PM
Aug 24, 2015
Archive Agent agent wrote
Roman Minyaylov

This code used to set volume. You can see how it's worked now.

private IBasicAudio FBasicAudio;

on July 17, 2013 1:49 PM
Aug 24, 2015
Archive Agent agent wrote
qakmak

IBasicAudio it's just a interface. if I'm use like this:

private IBasicAudio FBasicAudio;
int hr = FBasicAudio.put_Volume(k);

it will told me FBasicAudio can't be null;

on July 17, 2013 2:18 PM
Aug 24, 2015
Archive Agent agent wrote
Roman Minyaylov

I do not told you to use it, I just show our implementation of volume_set code.

on July 17, 2013 2:19 PM
Aug 24, 2015
Archive Agent agent wrote
qakmak

ok......I understant what are you mean now.

but , even you code is correct , now the result wrong. if I'm set it 400. I can't hear any sounds.... I'm not using wrong. I send the idea and Discuss with other people just for use other way handle it.Make sound linear change from 0-1000.

on July 17, 2013 2:50 PM
Aug 24, 2015
Archive Agent agent wrote
qakmak

you can add my code in your Main Demo and feel it.
so please don't close it. I hope can with other developer discuss it.

on July 17, 2013 2:59 PM
Aug 24, 2015
Archive Agent agent wrote
Roman Minyaylov

Please read how IBasicAudio.put_volume worked.

In Main demo minimum value is not 0.

on July 17, 2013 7:03 PM
Aug 24, 2015
Archive Agent agent wrote
qakmak

ok. thank you told me the api inside . I will convert it in own code.

on July 17, 2013 9:23 PM