From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How programatically change audio device default format (DVD Quality) and level ?

Solved!
Go to solution

Hi

 

With a headset audio device I need to change settings like playback level or default format to 1 channel, 16bit 48000HZ (DVD Quality)

Does anyone know how to change these settings in Labview?

 

0 Kudos
Message 1 of 14
(4,891 Views)

@EDGAR_PLATRONICS wrote:

 

With a headset audio device I need to change settings like playback level or default format to 1 channel, 16bit 48000HZ (DVD Quality)

Does anyone know how to change these settings in Labview? 


That's pretty vague.  LabVIEW has Sound VIs that can input and output analog waveforms of 1 or 2 channels at various rates, including 16 bit, 48KHz.  Do you know how to program in LabVIEW?  Are you asking for help with a specific VI you are writing?  If so, attach your VI (the actual code is best) so we have a better idea what question you are really asking.  You might also describe your hardware, including the "headset audio device" -- is this some hardware plugged into your PC that has programmably-settable controls that you want LabVIEW to manipulate?  Then we need to understand how to "control the Controls" ...

 

Bob Schor 

0 Kudos
Message 2 of 14
(4,837 Views)

Thank you

I mean, once any USB headset is connected to computer, I want that LV program changes windows settings of this audio device like volume level or change default audio format to DVD quality. How can I do it?

Sorry for not be so clear.

 

Regards

0 Kudos
Message 3 of 14
(4,829 Views)

It sounds like you want to use LabVIEW as a sort of Windows PowerShell replacement, getting LabVIEW to do Windows-specific tasks for you.  You may be able to do this, but this is not LabVIEW's Intended Purpose.

 

The Sound VIs that ship with LabVIEW, as far as I know, ignore the Windows settings and allow you to configure the LabVIEW Sound VIs to allow LabVIEW to acquire and play sound files (note that there is usually a short time delay between Acquire and Play).

 

Bob Schor

0 Kudos
Message 4 of 14
(4,820 Views)

Hi Bob:

 

My application generates a 1Khz signal in USB headset speaker then I use another part in same VI (not shown to avoid confusion) to measure this acoustics signal with a precision microphone.

Here you have VI (LV2013) I use to generate and play this signal.

If I manually change windows volume I will notice a change in audio level output when playing this VI. So, my measurement will not be correct unless I have a windows volume reference and that is why I need to control this window setting.

Playing this VI does not ignore windows volume unless I am missing anything.

 

Regards

 

Download All
0 Kudos
Message 5 of 14
(4,811 Views)

Sorry, my mistake.  Now I understand the question you are asking, namely how to control the loudness of the sound produced by your PC's sound system (which can vary widely depending on whether you are using a fancy Sound Card, a built-in sound system, a USB-connect sound system, or any of a number of other factors).

 

I don't know what the relationship is between the "volume" from LabVIEW's sound VIs and the sound that you actually hear.  I'm assuming that LabVIEW is fiddling with the input to Windows' sound system (since you have other "Volume Controls" in Windows and perhaps also on your speakers).  As you note, you need to calibrate your output by measuring the output by recording it with a microphone.  This is not an uncommon Engineering Concept, calibrating your instruments so that the numbers you get out have some objective meaning.

 

Bob Schor

0 Kudos
Message 6 of 14
(4,801 Views)

Does anyone know how to do it?

 

Regards

0 Kudos
Message 7 of 14
(4,787 Views)

@EDGAR_PLATRONICS wrote:

Does anyone know how to do it?

 


In my previous reply, I told you "how to do it" -- you need to calibrate your sound system, which means you need to measure (record) the sound output and how it varies as you vary the "loudness" settings.  It's like listening to an audio CD on your PC -- the loudness is affected by many independent variables, including (a) the setting on your speaker's Volume control, (b) the setting on Windows' "Audio Output" volume, (c) the particular make/model of the sound equipment, including the PC and speakers, (d) whether output is speakers or headphones, etc.

 

Bob Schor

0 Kudos
Message 8 of 14
(4,777 Views)

Thank you for your help Bob,

but my question is how to move windows volume control in labview for example to 100%?

0 Kudos
Message 9 of 14
(4,775 Views)
Solution
Accepted by topic author EDGAR_PLATRONICS

Have you tried Googling for Windows library functions that will let you do this? For example: EndpointVolume API

 

Aaron T.

0 Kudos
Message 10 of 14
(4,769 Views)