ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PWM to Soundcard ?

I need a Width-modulated Pulse Signal (square) at the Line-out Plug of my
Soundcard.
My Vis makes only crash-Sounds but no fine Signal.
I took a normal Function-Generator and put it to Sount-Write...but it does
not work.

Has somebody an Idea or a ready made VI for this Problem ?

Best regards

Message Edited by Support on 09-24-2008 03:55 PM
0 Kudos
Message 1 of 5
(3,578 Views)
I did this exact thing with a sine wave.

You have to be sure you use the correct sample rate and amplitude based on the settings you use. Also remember that sound files are not 0-(max), they are centered on 0.
0 Kudos
Message 2 of 5
(3,578 Views)
Sine-Wave is also ok.
Could you send me this vi, please?

Greetings




> I did this exact thing with a sine wave.
>
> You have to be sure you use the correct sample rate and amplitude
> based on the settings you use. Also remember that sound files are not
> 0-(max), they are centered on 0.
Message Edited by Support on 09-24-2008 03:55 PM
0 Kudos
Message 3 of 5
(3,578 Views)
It wouldn't be helpful to you if I sent the VI.

I started with "Multitone Waveform Example.vi" which I downloaded from NI's website.

I then altered the VI to generate tones in the dynamic range of the sound format I chose. In my case, I chose 8 bit stereo. I setup the VI to create a waveform with an amplitude of 255, however; this is centered about zero. 8 bit stereo requires a signal that is 0-255 (16 bit is centered about 0?). So all I did was to add 127.5 to the output of the waveform generator, and then create a 2D array by using the same waveform for each channel. I then put this waveform into the "Snd Write Waveform.vi" along with the appropriate format and other inputs.

If you have any specific questions, please feel free
to ask.
0 Kudos
Message 4 of 5
(3,578 Views)
> It wouldn't be helpful to you if I sent the VI.
Why not ? Please try it 😉 You can send it to my e-mail Adress of this
News-Mail.
>
> I started with "Multitone Waveform Example.vi" which I downloaded from
> NI's website.
I think this is standard in Labview 6
>
> I then altered the VI to generate tones in the dynamic range of the
> sound format I chose. In my case, I chose 8 bit stereo. I setup the
> VI to create a waveform with an amplitude of 255, however; this is
> centered about zero. 8 bit stereo requires a signal that is 0-255 (16
> bit is centered about 0?). So all I did was to add 127.5 to the
> output of the waveform generator, and then create a 2D array by using
> the same waveform for each channel. I then put this
waveform into the
> "Snd Write Waveform.vi" along with the appropriate format and other
> inputs.
I need 8 Bit Mono, because its only for driving a Motor. But 8 Bit Stereo is
also ok, because the second channel is not in use.

>
> If you have any specific questions, please feel free to ask.
0 Kudos
Message 5 of 5
(3,578 Views)