LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Audio compression

Hi!

I'm a student doing a radiocommunication Project for audio broadcasting in Labview NXG 3, but I need to compress the audio before sending it, in order to reduce the requirement bitrate. As far as I've found, LabVIEW only support for playback of wav-files. Is there a way to compress wav-files in LabVIEW into any format that LabVIEW can also convert back to wav, or play directly? That is, without having to implement the compression scheme myself.

0 Kudos
Message 1 of 11
(3,752 Views)

I'd use .NET, especially (1st hit on google) system.io.compression.deflatestream or system.io.compression.gzipstream.

 

Those are mentioned to be suitable for continuous compressed data streaming, although I'm not 100% convinced.

Message 2 of 11
(3,724 Views)

I was thinking more in the direction of lossy, audio-specific compression, as you usually can get much higher compression rates with those.

Also, I have no experience with .net whatsoever, so that looks a bit too complicated to dive into.

0 Kudos
Message 3 of 11
(3,677 Views)

@stianke2 wrote:

I was thinking more in the direction of lossy, audio-specific compression, as you usually can get much higher compression rates with those.

Also, I have no experience with .net whatsoever, so that looks a bit too complicated to dive into.


So you want to compress an audio file before "sending it". 

 

How about using the system exec and fraunhofer or Lame mp3 command line compression utilities?

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 11
(3,656 Views)

If you can live with "only" 2x compression, you might be able to make use of the various lossless algorithms out there.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 11
(3,639 Views)

Yes, compress the audio before sending it. Your solution sound promising, I'll be sure to test it next time I'm at the lab.

0 Kudos
Message 6 of 11
(3,634 Views)

@stianke2 wrote:

Yes, compress the audio before sending it. Your solution sound promising, I'll be sure to test it next time I'm at the lab.


Does it need to be continues streaming?

 

Or does it suffice to compress the data and than send it?

0 Kudos
Message 7 of 11
(3,423 Views)

It is going to be continious streaming, but we will divide the audio into packets before sending anyway, so each packet can be compressed as a seperate file.

This will cause the receiver to lag behind with some delay, depending on the size but that is ok. 

0 Kudos
Message 8 of 11
(3,405 Views)

@stianke2 wrote:

It is going to be continious streaming, but we will divide the audio into packets before sending anyway, so each packet can be compressed as a seperate file.

This will cause the receiver to lag behind with some delay, depending on the size but that is ok. 


I'd definitely prefer a continuous streaming solution, but suit yourself. There will always be a lag, there's no such thing as 'real time', only 'relative real time'.

 

There are existing streaming audio solutions (NAudio), but these kind of solutions are usually presented as source code. Creators usually don't anticipate us LabVIEW programmers that require a dll (regular, AX or .NET), because they simply compile the code statically.

 

You could consider a lossless compression method, combined with some method to reduce the data entropy. For audio, that would probably mean removing relative small frequencies. This can increase the compression ratios dramatically. You might be better equipped to come up with something...

0 Kudos
Message 9 of 11
(3,399 Views)

You may be able to adapt this code to your needs: https://forums.ni.com/t5/Example-Programs/FFMPEG-scripting-in-LabVIEW-NET/ta-p/3515713

It uses FFMPEG and dotNET to stream video, but I think its a pretty good starting point for your task. Basically it uses dotnet to create a process that runs ffmpeg and captures the output stream.

0 Kudos
Message 10 of 11
(3,383 Views)