02-03-2020 10:13 AM - edited 02-03-2020 10:14 AM
I have been looking for an example that will allow me to generate two different tones right and left channel using a sound card.
All of the examples I can find generate a mono signal of the exact same frequency and amplitude on both channels. The Sound Output Configure.vi lets you pick one or two channels but if I select one channel what channel is selected right or left? How do I select the Right channels for a 1khz tone and the left channels for a 5Khz tone?
BTW: I need to generate the tones not playback a waveform or recorded stereo sound file
02-03-2020 11:53 AM
After reacquainting myself with the Generate Sound example, I seem to remember that Sound Output Write will take an array of waveforms as input (one for each channel).
02-03-2020 12:03 PM
Is this what you need?
02-03-2020 04:26 PM - edited 02-03-2020 04:28 PM
@Mancho00 wrote:
After reacquainting myself with the Generate Sound example, I seem to remember that Sound Output Write will take an array of waveforms as input (one for each channel).
I will look into that , Thanks!
02-03-2020 04:27 PM
@LucianM wrote:
Is this what you need?
Sure that might work but I want to know how to do it.
Can you give me an example without using Express VI's?
02-03-2020 06:02 PM - edited 02-03-2020 06:03 PM
You can right-click the ExpressVI and select "Show Front Panel" to view the contents. It's using the same Sound Output Configure and Sound Output Write that you've mentioned using already in the Graphics and Sound -> Sound -> Output palettes.
The Help for Sound Output Write says:
data writes any sound data to the internal buffers. For multi-channel sound data, data is an array of waveforms where each element of the array is a single channel. |
I'm not sure how to tell it which waveform you want on left or right, but I'd guess it would be consistent oce you figure out which way it goes.
Edit: Why the heck is there so much whitespace on this post?
02-04-2020 12:05 AM
02-04-2020 02:33 AM
02-04-2020 02:38 AM - edited 02-04-2020 02:39 AM
Off topic...
@BertMcMahan wrote:
Edit: Why the heck is there so much whitespace on this post?
<div id="styleDivScrolling" style="height: 766px;">
<p>Edit: Why the heck is there so much whitespace on this post?</p>
</div>
style="height: 766px;" caused the problem.
Not sure how that ended up there. Selecting everything and then clicking "clear formatting" (the Tx icon) should remove all formatting. Or go into the HTML view...
With modified HTML:
<div id="styleDivScrolling">
<p>Edit: Why the heck is there so much whitespace on this post?</p>
</div>
@BertMcMahan wrote:
Edit: Why the heck is there so much whitespace on this post?
02-04-2020 09:13 AM
@Dataflow_G wrote:
You can use two copies of Basic Function Generator.vi, then build an array of waveforms to create a stereo pair (where index 0 is the left channel). The array of waveforms can then be written to the sound device configured in continuous sample mode.
This is basically what I tried at home last night. One tone at a time was always fine regardless of which tone.
But whenever I had two channels there was an annoying pop sound during playback.
I see you put the Phase in a shift register, I will try that.