01-28-2020 09:39 AM
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.
01-28-2020 10:22 AM
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.
01-28-2020 11:01 AM
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.
01-28-2020 12:04 PM - edited 01-28-2020 12:07 PM
@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?
01-28-2020 12:26 PM
If you can live with "only" 2x compression, you might be able to make use of the various lossless algorithms out there.
01-28-2020 12:40 PM
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.
01-29-2020 02:47 AM
@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?
01-29-2020 03:58 AM
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.
01-29-2020 04:33 AM
@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...
01-29-2020 06:59 AM
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.