Jump to content

Playing with Mixer Device


wiredbits
 Share

Recommended Posts

hi

I needed a routine that would select input line and after searching I found the mixer device API calls which suited my needs,. for fun I also did a set volume routine.

Most of the info came from :

http://www.borg.com/~jglatt/tech/mixer.htm

and of course

http://msdn.microsoft.com/library/default....troldetails.asp

Since I have two sound cards im my system I wrote the routines to handle mulitible mixer devices. You will need the latest betta to run and both routines need the include file.

MXSelectInputSrc_include.au3

MXSelectInputSrc.au3

MXVolume.au3

Link to comment
Share on other sites

Good job :o

Thanks

It was fun and gives me a starting place in case i want to use more than just two controls, plus i like watching the mixer change while i play with its widgets... :geek:

Code could be cleaned up, I need to write a routine that grabs defines in a .h file and converts them to Autoit format. Would make life easier for me, hmmm maybe then go back and scan autoit code and make another file with only defines used.;)

Jim

Link to comment
Share on other sites

  • 8 months later...

hi

I needed a routine that would select input line and after searching I found the mixer device API calls which suited my needs,. for fun I also did a set volume routine.

Most of the info came from :

http://www.borg.com/~jglatt/tech/mixer.htm

and of course

http://msdn.microsoft.com/library/default....troldetails.asp

Since I have two sound cards im my system I wrote the routines to handle mulitible mixer devices. You will need the latest betta to run and both routines need the include file.

MXSelectInputSrc_include.au3

MXSelectInputSrc.au3

MXVolume.au3

Hi Jim do you have the code for a line in slider thanks beau
Link to comment
Share on other sites

  • 2 weeks later...

Thought this was worth putting here being 99% of the code is wiredbits

http://www.autoitscript.com/fileman/users/gafrost/projects/Mixer/Mixer.au3

#include <Mixer.au3>

_SetMixerVolume($MIXERLINE_COMPONENTTYPE_DST_SPEAKERS, 75)
ConsoleWrite("DST" & @LF)
ConsoleWrite("Digital: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_DST_DIGITAL) & @LF)
ConsoleWrite("Line: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_DST_LINE) & @LF)
ConsoleWrite("Monitor: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_DST_MONITOR) & @LF)
ConsoleWrite("Speakers: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_DST_SPEAKERS) & @LF)
ConsoleWrite("HeadPhones: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_DST_HEADPHONES) & @LF)
ConsoleWrite("Phone: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_DST_TELEPHONE) & @LF)
ConsoleWrite("WaveIn: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_DST_WAVEIN) & @LF)
ConsoleWrite("VoiceIn: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_DST_VOICEIN) & @LF)

ConsoleWrite(@LF & "SRC" & @LF)
ConsoleWrite("Digital: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_DIGITAL) & @LF)
ConsoleWrite("Line: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_LINE) & @LF)
ConsoleWrite("Microphone: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE) & @LF)
ConsoleWrite("Synthesizer: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_SYNTHESIZER) & @LF)
ConsoleWrite("CompactDisc: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_COMPACTDISC) & @LF)
ConsoleWrite("Phone: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_TELEPHONE) & @LF)
ConsoleWrite("PcSpeaker: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_PCSPEAKER) & @LF)
ConsoleWrite("WaveOut: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT) & @LF)
ConsoleWrite("Aux: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_AUXILIARY) & @LF)
ConsoleWrite("Analog: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_ANALOG) & @LF)

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

wow finally someone that doesn't post spam when they have a low post account ;) you have made my day, will try the script later sounds cool though :P

I'm going to guess your talking about wiredbits :whistle: who post this several months ago.

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

iHi gafrost i have saved your code an can not get it to run do yoy have it in a zip file thanks

Thought this was worth putting here being 99% of the code is wiredbits

http://www.autoitscript.com/fileman/users/gafrost/projects/Mixer/Mixer.au3

#include <Mixer.au3>

_SetMixerVolume($MIXERLINE_COMPONENTTYPE_DST_SPEAKERS, 75)
ConsoleWrite("DST" & @LF)
ConsoleWrite("Digital: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_DST_DIGITAL) & @LF)
ConsoleWrite("Line: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_DST_LINE) & @LF)
ConsoleWrite("Monitor: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_DST_MONITOR) & @LF)
ConsoleWrite("Speakers: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_DST_SPEAKERS) & @LF)
ConsoleWrite("HeadPhones: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_DST_HEADPHONES) & @LF)
ConsoleWrite("Phone: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_DST_TELEPHONE) & @LF)
ConsoleWrite("WaveIn: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_DST_WAVEIN) & @LF)
ConsoleWrite("VoiceIn: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_DST_VOICEIN) & @LF)

ConsoleWrite(@LF & "SRC" & @LF)
ConsoleWrite("Digital: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_DIGITAL) & @LF)
ConsoleWrite("Line: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_LINE) & @LF)
ConsoleWrite("Microphone: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE) & @LF)
ConsoleWrite("Synthesizer: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_SYNTHESIZER) & @LF)
ConsoleWrite("CompactDisc: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_COMPACTDISC) & @LF)
ConsoleWrite("Phone: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_TELEPHONE) & @LF)
ConsoleWrite("PcSpeaker: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_PCSPEAKER) & @LF)
ConsoleWrite("WaveOut: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT) & @LF)
ConsoleWrite("Aux: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_AUXILIARY) & @LF)
ConsoleWrite("Analog: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_ANALOG) & @LF)
Link to comment
Share on other sites

iHi gafrost i have saved your code an can not get it to run do yoy have it in a zip file thanks

No, no need to complicate a simple au3 file by zipping it.

Just save the Mixer.au3 to a folder.

Create another au3 file in that folder and copy/paste the code above and run.

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

No, no need to complicate a simple au3 file by zipping it.

Just save the Mixer.au3 to a folder.

Create another au3 file in that folder and copy/paste the code above and run.

ok I made two file one is mixer.au3

the i put this in mixer1.au3

#include <Mixer.au3>

_SetMixerVolume($MIXERLINE_COMPONENTTYPE_DST_SPEAKERS, 75)

ConsoleWrite("DST" & @LF)

ConsoleWrite("Digital: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_DST_DIGITAL) & @LF)

ConsoleWrite("Line: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_DST_LINE) & @LF)

ConsoleWrite("Monitor: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_DST_MONITOR) & @LF)

ConsoleWrite("Speakers: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_DST_SPEAKERS) & @LF)

ConsoleWrite("HeadPhones: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_DST_HEADPHONES) & @LF)

ConsoleWrite("Phone: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_DST_TELEPHONE) & @LF)

ConsoleWrite("WaveIn: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_DST_WAVEIN) & @LF)

ConsoleWrite("VoiceIn: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_DST_VOICEIN) & @LF)

ConsoleWrite(@LF & "SRC" & @LF)

ConsoleWrite("Digital: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_DIGITAL) & @LF)

ConsoleWrite("Line: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_LINE) & @LF)

ConsoleWrite("Microphone: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE) & @LF)

ConsoleWrite("Synthesizer: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_SYNTHESIZER) & @LF)

ConsoleWrite("CompactDisc: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_COMPACTDISC) & @LF)

ConsoleWrite("Phone: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_TELEPHONE) & @LF)

ConsoleWrite("PcSpeaker: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_PCSPEAKER) & @LF)

ConsoleWrite("WaveOut: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT) & @LF)

ConsoleWrite("Aux: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_AUXILIARY) & @LF)

ConsoleWrite("Analog: " & _GetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_ANALOG) & @LF)

but when I click it it did nothing what verison did you use thanks beau

Link to comment
Share on other sites

ok I made two file one is mixer.au3

the i put this in mixer1.au3

but when I click it it did nothing what verison did you use thanks beau

I use release and/or beta both work.

But to see the console writes you'll need to use and IDE like SciTE for AutoIt, look in my signature for link.

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

Try changing this (if the file is in the same directory as the script).

#include "Mixer.au3"
doesn't matter which way it's put, but usually when I do non-standard udfs I use the quotes

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

doesn't matter which way it's put, but usually when I do non-standard udfs I use the quotes

I was under the impression that the "???.au3" looked in the directory where the script is located and the <???.au3> looked in the \include directory of where Autoit is installed.

Agreement is not necessary - thinking for one's self is!

My-Colors.jpg

cuniform2.gif

Link to comment
Share on other sites

I was under the impression that the "???.au3" looked in the directory where the script is located and the <???.au3> looked in the \include directory of where Autoit is installed.

try it and you'll see it works, I don't remember exactly what Valik stated about it, but I know it works either way.

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

Well done, it works good :whistle:

Any way to:

- set recording volume of an input device;

- select microphone as active input device (without using wiredbits GUI);

?

try exchanging the _Get's for _Set's

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

try exchanging the _Get's for _Set's

Your _SetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE, $percent) affects playback output volume, not the input registration volume.

Edited:

As explained here: http://www.codeproject.com/audio/volctrl.a...2866#xx852866xx

What I'm asking for can't be done.

Edited:

Volumeline does the job very good (thanx to Schindi for the nice find)

Edited by masvil
Link to comment
Share on other sites

  • 1 month later...

Can we have some more simple examples on using yours/WiredBits Mixer UDF, Mr Frosty please? :P

Like toggling between Mic and Stereo Mix in the record panel?

many Thanks!

Edited by Lakes

2015 - Still no flying cars, instead blankets with sleeves.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...