LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to decrease the volume of .wav file output to a speaker connected to NI 9263 output module

Solved!
Go to solution

Hello,

 

I found an example from http://zone.ni.com/devzone/cda/epd/p/id/4182 and edited it for my purposes. From this, I have been able to output 16 bit mono speech files with 16kHz sampling rate to a speaker connected to the NI 9263 output module. However, this speaker is without volume control and the output is extremely loud. I have attached images of my block diagrams below. 


The Snd Read Wave File.vi returns a mono 1D array of 16 bit integers. I multiplied this array with a control knob so I could adjust the constant which I multiply with the 1D array as I thought the size of the integers are related to the amplitude of the signal. However, reducing the constant only reduces the quality of the speech and is still very loud.

Is this the right approach to reduce the volume? And if not, what is? Thanks in advance 🙂

Download All
0 Kudos
Message 1 of 3
(2,775 Views)
Solution
Accepted by topic author Yawei7

@Yawei7 wrote:

I thought the size of the integers are related to the amplitude of the signal.


Thats absolutely correct...!!
And your approach is perfect...!!


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


Message 2 of 3
(2,772 Views)

Thank you for your confirmation for this approach! But when I apply it, It doesn't work well at all. The speech I hear begins to sound more broken, and perhaps volume has decreased but not a significant amount. I gather it sounds more broken when I multiple it by an extremely small value because this causes the amplitude of some values to become almost zero? I was hoping to achieve a similar volume changing effect as when using the white noise generator function where volume can be controlled by an RMS terminal. 

0 Kudos
Message 3 of 3
(2,759 Views)