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: 

Balancing generated sound through speakers

Hello,

 

I generated a sine sound and i am having problems trying to get the sound balance to work (which speaker sound comes out of left or right) it would be nice if it could be random if not i would like to be able to control it on the interface 

0 Kudos
Message 1 of 10
(3,136 Views)
What hardware are you using? What does your code look like?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 10
(3,106 Views)

This is the code that i have so far and there is no sound playing

0 Kudos
Message 3 of 10
(3,031 Views)

right now i am using headphones temporarily then i am using speakers 

0 Kudos
Message 4 of 10
(3,028 Views)

Well look at your code.  You simulate a waveform, then replace the Y values with an array full of zeroes.  Of course you hear nothing.

 

Also, your simulated wave is NOT stereo.  Probe the output and you will see it's only 1 array so your Index Channel VI can't possibly work the way you want it to.  Give it another shot though, you're getting there...

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 5 of 10
(3,023 Views)

Well i have been going by this vi that i found as a guide. But it is an input sond file. This must not be helping much 

0 Kudos
Message 6 of 10
(3,019 Views)

that project that i am using as a guide was given to me by tech support with labview

0 Kudos
Message 7 of 10
(3,013 Views)

Almost time for me to go home but I slapped this together to show you how to create waves and manipulate them before you send them to your sound card.  The main issue is that you need to prepare your waves to do what you want BEFORE you send them to the sound VIs.  Once you load a wave to be played, it's in your soundcard buffer and there's not much you can do with it without stopping playback and re-configuring.  If you create two waves and then build them into an array before hand, you can get smooth playback.

 

Note that ALL the Sample rates and # of Samples variables combine to change the frequency and length of time the waves play.  You need to learn how the math works to generate predictible outputs.

 

CAUTION:  TURN DOWN YOUR VOLUME BEFORE YOU RUN THIS VI!!!  Especially with headphone on.  It's defaults are pretty mild but can still generate some rather discordant noises.

 

EDIT:  No Really.  TURN THE VOLUME DOWN. I just realized mine was set to 25 but when I cranked it back to 100 this VI can be painful.  Please be careful.  Smiley Wink

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 8 of 10
(2,999 Views)

can you please make your file backwards compatible with 2012 labview full development application. we cannot open the file to see what you did. Thanks

0 Kudos
Message 9 of 10
(2,931 Views)

Here you go.  Sorry for the delay, my email was down for a couple days and I didn't even notice. Smiley Embarassed

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 10 of 10
(2,878 Views)