LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to write wav file from output of Build Waveform

Solved!
Go to solution

Hi There,

 

I am trying to write to a wav file from output of Build Waveform.    I can play the audio from the output of build waveform but when I try to write to wav file using the simple write I get 

 

Error 42 occurred at Sound File Write Open.vi->Sound File Write Simple.vi->write and play wav.vi

 

How do I address this?

0 Kudos
Message 1 of 5
(4,093 Views)

Error 42 is a "generic error".  So it doesn't tell us anything.  Any chance it was error 43 which is "cancelled by user"?  That is more likely when dealing with file operations.

 

It would be better if you attached your VI so we can see what you are doing and suggest where you might be doing it wrong.

0 Kudos
Message 2 of 5
(4,064 Views)

How do I create a new wav file in labview so that I can refer to it in path and write to it in Write simple ?

0 Kudos
Message 3 of 5
(4,064 Views)

I can get around the problem by referring to an existing file to over write in path of wav file in Sound Write Simple.   I would like the VI to create a NEW file rather than overwrite an existing one.  Is this possible?

0 Kudos
Message 4 of 5
(4,058 Views)
Solution
Accepted by Whitenova

Hi Whitenova,

 


@Whitenova wrote:

I can get around the problem by referring to an existing file to over write in path of wav file in Sound Write Simple.   I would like the VI to create a NEW file rather than overwrite an existing one.  Is this possible?


Yes, it's possible.

Just provide a "new" filepath:

check.png

This snippets creates the wav file on first call…

(Thie filepath control in your VI was empty, so the WriteWAV function will return an error 42 because of wrong filepath…)

 

Btw. no need to create one more thread for the very same problem! So I merged both threads…

(One thread per problem, one problem per thread.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 5
(4,053 Views)