I have extracted the data chunk from an WAV file which I want to play in java. The data is in a byte array. Is there any java API that could do this. Also I have sample rate of the file from the from format chunk.
Related
I have used this script to generate local and global descriptors from a point cloud. The script lets you save the descriptors in PCD format (line 105 of the script) but I'm having trouble loading the pcd files in Python to train a model [Opened a discussion here].
I'm thinking of an alternative. Does anyone know a way to save the descriptors as a txt file instead of pcd? Thanks!
#IBitMyBytes Thanks for the reply. I just saved it in default PCD format in PCL and then read it like a text file in Python and removed the headers.
I have a file (about 100k files, to be specific) containing a data from weather radars - one file is a one radar image. It is a mosaic of data from several radars, creating a map of a reflectivity over whole country.
The files have extension .cmax and I need to convert them to something more useful (eg. array of reflectivities) for further uses.
I have asked data provider how to read those files. They responded:
The standard product format in our system (.cmax) is the internal format of the company that provides us with the software. It consists of an xml and binary part. It can be read by reading as a stream of bytes. Firstly, parse the initial bytes as xml, then treat the rest (BLOBs) as a binary data compressed with the "qt" method. You need to unpack them using a library that supports this compression mode. In general, you have to work a little, but it can be done in virtually any programming language.
The main issue is with the binary part of data. I have tried to decompress it with zlib (googling qt compression it comes out) and reading as a binary data in C++. None of them worked. It also doesn't seem resonable to me to try reading that data as binary in Qt.
The file begins with those lines:
<product version="5.44.5" datetime="2017-01-01T18:00:00" datatype="dBZ" type="cmax" name="CMAX" owner="">
<data time="18:00:00" date="2017-01-01">
Then, there are radars specifications and image details (active radars, min and max reflectivity etc). XML part ends with:
</product>
<!-- END XML -->
<BLOB blobid="0" size="79617" compression="qt">(here are lots of binary data)</BLOB>
I'm looking for a way (tool?) to convert that binary data. For example, it could be that mentioned library.
Looking at the details, this is most likely Leonardo (Selex/Gematronic) Rainbow5 format. zlib is the right lib for decompression. But there are some tricks to it. A python reader is implemented in the wradlib library (https://github.com/wradlib). Maybe you can adapt from that code. Disclaimer: I'm one of the wradlib devs.
Did you try simply using the qUncompress() function? https://doc.qt.io/qt-5/qbytearray.html#qUncompress
mp3 to WAV is easy by monitoR::readMP3 and tuneR::writeWave. What about Wave object to mp3?
I have done some audio splitting with R tuneR::Wave objects, and want to output them as mp3 files. I don't need the resolution as in WAV file which takes up a lot of unnecessary space.
As quoted in the "Developer Guide" of Amazon EMR, the files in the input directory should be formatted as plain text. Does it mean that i cannot upload some binary files or .png files and parse them by python script?
Likely not. See for example: https://groups.google.com/a/cloudera.org/forum/?fromgroups=#!topic/cdh-user/AUUZ0DKiJGw
what you can do is to have an input data be the file names themselves (either in S3 or HDFS). The Hadoop streaming script will get file names as input that it can open and process as it sees fit.
I am using jlayer to convert mp3 file to wav format. The code is working good but the size of wav file is increased about 5 times the size of mp3 file. For converting i have used the jar file provided by the jlayer.
Anyone please tell how to optimize the size of the file.
You cannot optimize the size of a WAV file, its size depends on the audio data written into it. The higher the quality of audio, the larger the file. The longer the length of audio, the larger the file.
WAV files contain PCM encoded digital audio. The reason we use MP3 and other audio encoding formats is to reduce the file size, in exchange of quality.
So when you convert a file from WAV to MP3, you get a smaller file but you lose audio quality.
If you convert the resulting file from MP3 to WAV (which is what you do), you always get a larger file and you never get back to the original audio quality.