Convert .raw file to .mp3 file or other audio format

2

I have an application that does audio recordings and stores it on a server. I need these files to be converted from the .raw extension to any audio format, preferably to the .mp3 extension, so that it can be downloaded to the client computer.

Note: My application is developed in JAVA Desktop.

    
asked by anonymous 20.01.2015 / 15:22

1 answer

1

First you will need to find out how many frames per second (sample rate) your audio was generated and what the proper bit rate, knowing these values you can develop an algorithm to encode ".RAW" for any other type, as long as you know the steps required to encode the audio extension of interest, this is not a simple task, there must be some ready class that performs encoding but never looked for anything like that in Java, the algorithm to encode files from raw to wav is not very complex ...

The simplest thing to do is to use some conversion software that accepts command line inputs to perform the conversion, I recommend sox

Here is an example of how to use:

sox -r 8000 –bits 16 –encoding signed-integer –endian big -t raw original.RAW convertido.wav

This example converts a raw file written in 16 bits and sampled at 8000 hertz to the extension ".wav"

    
20.01.2015 / 19:57