# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## audio to binary conversion

Hello, i want to take audio input from microphone and convert it into binary data (stream of 0s and 1s).. Suggestions are welcomed. I'm using Labview 2011.

Message 1 of 9
(5,215 Views)

## Re: audio to binary conversion

Hi Jhareesh,

you get some U8 or U16 values from your "microphone". Convert them using NumberToBoolArray to get a "stream of bits"...

Best regards,
GerdW

using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 9
(5,214 Views)

## Re: audio to binary conversion

Hello GerdW,

i tried based on wht i understood from ur post.  but, i'm not getting stream of bits here.. please go through the pic and suggest the changes to be made. I would be glad if u can send a vi file for that. 🙂

Message 3 of 9
(5,193 Views)
Solution
Accepted by topic author Jharesh

## Re: audio to binary conversion

Hi Jhareesh,

you already get the bits for one sample of your sound data. When you need the bitstream for all samples you should

- not convert to a single sample but to a waveform/array of samples

- build an array of bits by concatenating them to a 1D array...

Best regards,
GerdW

using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 9
(5,186 Views)

## Re: audio to binary conversion

I needd conversion of audio to binary matrix for serial transmission of bits.The code snippet has been attatched but I'm failing to reproduce at the reciever end.I could not understand the faulty in it .Can any one help me in rectifying it.

Message 5 of 9
(4,943 Views)

## Re: audio to binary conversion

Hi Balaram,

what exactly are you trying to do?

You acquire some sound data (analog waveform!), then you convert the analog waveform to a digital waveform: but WHY are you wiring the inputs of this 2nd conversion with some wierd values? WHY are you ignoring the coercion dots?

General recommendation: Read the LabVIEW help for each function you are unfamiliar with!

Best regards,
GerdW

using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 9
(4,938 Views)

## Re: audio to binary conversion

Thanks GerW  for ur suggestion.A modifies snippet has been attatched.Look at it and help me in recieving the input waveform.

Message 7 of 9
(4,933 Views)

## Re: audio to binary conversion

Hi Balaram,

I don't know what you are trying to set with all those additional input constants.

When I use thissimple snippet:

I get the sine wave in the graph as expected…

General recommendation: try to stay away from ExpressVIs. They most often don't make your life easier… 😄

General recommendation: Do you notice the difference between your images and my snippet? Please attach VIs or snippets, but no plain images!

Best regards,
GerdW

using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 8 of 9
(4,927 Views)

## Re: audio to binary conversion

I'm least worried about the "Acquire sound",But i need only a digital format (o's,1's) as output at the transmitter(at the end ).

Message 9 of 9
(4,921 Views)