LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multitone RAW Audio File Generation Help

Can anyone take a look at the attached VI and determine what I am doing wrong?

 

The intention of the VI is to use the Multitone Generator function and allow you to selectively create either a Multitone WAV file or a Multitone RAW audio file (headerless RAW byte stream file). After I create a WAV file and RAW audio file using the exact same tone and sample settings the audio files don't sound alike. However I have experimented and this concept works just fine for single frequency sine wavforms using the Single Sine Wave Generator function. There has to be something wrong with the way I am scaling the Y waveform data for the RAW audio file that works for single sine waveforms but not Multitone but I can't seem to figure it out.

 

I have attached my Multitone VI (MultitoneGenerator.vi) and also a example single sine wavform VI (SingleSineGenerator.vi). I am using "Audacity" 1.2.6 located here HERE in order to play and compare both generated file types (WAV and RAW) files. My target RAW file and WAV files are 16-bit 1-channel Big Endian format @11025 sampling rate.  

0 Kudos
Message 1 of 6
(3,865 Views)

Aaron-

 

I will have to play around with your code to see if I can find any issues.  I will be looking into it within the next day and I will get back with you ASAP!

 

Thanks,

 

Sean Newton

Applications Engineering Specialist - Semiconductor Test
National Instruments
0 Kudos
Message 2 of 6
(3,852 Views)

Thanks Sean! Please let me know if you see anything wrong with it that would cause my issue. I have been working on this problem for about a week now with no luck. I have found that I can take a WAV file produced by this VI and convert it to a RAW file using a different audio file converter program and the audio matches my WAV file exactly (as seen in Audacity) however I would much rather have Labview do this conversion for me within the same app. creating my WAV files. 

0 Kudos
Message 3 of 6
(3,844 Views)

Aaron-

 

I have been playing around with it a bit and it doesn't seem to work for the single tone generation either.  I don't have much experience with creating .raw file, but I did verify that you are retaining all of your data points.  It is possible that there is something going on when Audacity encodes the raw data.  I'm still playing around with the code because its pretty interesting, but I must admit, I might have to seek some information from someone who has more experience dealing with this.

 

Thanks,

 

Sean

Applications Engineering Specialist - Semiconductor Test
National Instruments
0 Kudos
Message 4 of 6
(3,837 Views)

OK thanks for taking a look....If you know anyone else there in NI that would be able to help me out I'd appreciate it.

 

The RAW audio file is supposed to be just the Data chunk of a WAV file without the header. It is said that it is a "Headerless" PCM file. A WAV file of course is a data waveform chunk and also a header which contains samping information and also any info the creator decides to store about the artist/creator, album, track names, track numbers, etc That is part of the reason why WAV files are used for CD recordings because they can store the artist, album, and track info right in the file header. This is also why when you import the RAW file into Audacity you can't just say "Open file" and you have to instead choose "Import" and specify the sampling information because Audacity can't read a header to tell it what the sampling info is (because the header isn't there).

 

The data chuck of the RAW file is supposed to just be the raw bytes representing the waveform.

0 Kudos
Message 5 of 6
(3,834 Views)

 
Hello.
I was playing with your vis and Cool Edit (now adobe audition) ans single tone is OK.
 
I guess the problem with multitone is that your vi expects signal amplitud ranging from -1 to 1.
 
Multitone generator, by default in this case gives -10 to 10 due to number of tones and frequencies,
so the signal gets clipped and distorted.
 
Solution: in amplitude terminal of "multitone generator.vi" put a 1 so values range from -1 to 1.
This should solve your problem.
 
Best regards.
Alipio

---------------------------------------------------------
"Qod natura non dat, Salmantica non praestat"
---------------------------------------------------------
0 Kudos
Message 6 of 6
(3,825 Views)