Encrypt and garble audio file using JAVA - java

I'm currently working on a project to encrypt MP3 audio using JAVA and produce garbled sound from that encrypted MP3 file. So far, I can encrypt the whole MP3 file using DES encryption method. However, this encrypted file is not playable using MP3 player. I know that MP3 file has some structure (header and data, etc), but I have no idea to implement encryption on this file without breaking the whole MP3 structure.
How to make this encrypted MP3 file playable?

Some more info about parsing and mp3 stream in java: JavaLayer is an mp3 decoder that naturally implements stream processing mostly with javazoom.jl.decoder.Bitstream class. It will skip all tag data and give you raw bytes for each frame.
Another library that does some mp3 stream parsing is jaudiotagger, maybe you can scavenge some code from there too.
Both of these libraries are distributed under LGPL, so just be aware of licensing issues.

Related

unable to convert mp3 files to text format only support .wav files in java

I have created an application but it is only support .wav files to convert audio to text. It is not showing any answers when giving .mp3 files .. I am using sphinx for to convert audio files to text. My question is that why it is not converting to text from .MP3?
As it is specified in the CMU Sphinx documents, only the linear PCM WAV audio format is accept by its speech recognizer. Therefore, any MP3 audio file will be decoded to obtain the linear PCM format, of 16khz sampling rate, 16bit/frame, little-endian and one channel (mono).
This decoding is achieved by the Tarsos Transcoder 1.2. This library uses many Apache utilities, therefore beside the TarsosTranscoder.jar, mp3plugin.jar also has to be included in the project building path.

Listening to OPUS encoded stream

Currently, I am working on an application that is taking a stream of audio (RAW encoded bytes) and is applying some transformations to it (resampling, converting stereo to mono etc..). I have implemented encoding raw bytes using opus codec thanks to JNI but I have a little problem:
Is there a way to listen to opus encoded stream saved to a file? I am aware that if I add some file headers and do some additional operations I should be able to save it as OGG file, but I do not want to waste time implementing functionality just to listen audio in the test.
Ideally, I would like to find a tool that would be able to play such stream, like audacity is playing RAW (after adding encoding parameters of course).
Thank you.
Did you try the opusdec utility from the OPUS tools package?
This utility should allow you to take opus stream and play it out as PCM encoded wav file which you should be able to pipe to a command-line .wav player and listen to it.
No need for any implementation, just a shell command executed via Runtime.Exec(),
Should do it
e.g. For a system with pulseaudio installed
yourstream.opus | padsp opusdec -
if no pulseaudio any wav player can use the wav stream output and play it.
For e.g.
opusdec --force-wav yourinput.opus - | <YOUR WAV Stream Accepting Player>

Java .wav get binary data

I'm using the Microsoft Project Oxford Speaker Recognition API REST, in order to create an enrollment I need to send a Binary Data of a .wav file. I already have the class that records and saves the .wav file, now I have to POST it, I just dunno how do I kinda "decode" the .wav file I have to that Binary Data that I want...
Appreciate any help.
Here's the link to what I'm trying to do: Speaker Recognition Create Enrollment.
In the documentation of the API, it is mentioned that the "body" of the request is the raw binary data for the *.wav file that you have recorded. This means you just need to send the file as is without any decoding.

Using JLayer (AKA JavaLayer) to analyze mp3 files in java?

I would like to perform a FFT on frames of an MP3 file using Java (think spectrum analyzer). I found JLayer which seems to fit the requirement of MP3 Decoding, but I'm not sure how to use it (Most examples are simply players that use the higher level helper, but that's not what I am looking for). FFT seems easy compared to decoding MP3 files ;)
My question is basically this: How would I take an MP3 file in java, and decode it to raw audio data for analysis in Java using JLayer
I am on the same Boat - trying to decode and analyze MP3 files using Java. You may want to check out MP3 SPI from the same author. There is a good example of getting the raw decoded PCM data from an MP3 file in his page:
http://www.javazoom.net/mp3spi/documents.html
Good luck,
Uri

audio processing using java

We have a requirement where we need to convert from .wav file to .mp3 and we are currently using "Tritonus" library to do that . The concern with that library is that requires "installation" of some "dll" files to the class path.
I am wondering are there any API's those allow better processing without local installation.
And other question is ,having mp3 format files will make it easier to join the files into a single file than having .wav files ?
As a former contributor to the JLayer MP3 Library, I'm fairly sure that it doesn't do WAV to MP3 - just MP3 playback and conversion to WAV. (I spent some time optimizing the decoder :-)
Regarding appending files (and possibly other operations), it is generally better to perform edit operations using the uncompressed format, and compress at the end.
I think the spec allows mp3 files to be concatenated, since they are a series of frames, but behaviour may vary from player to player.
So, to be safe, and maintain quality, I'd concat using WAVs and then compress the final result to MP3. Concating files is not so straightforward - you have to at least make sure they are at the same percieved volume, or you will get a noticible shift in volume from one file to the next. Such operations are definitely best performed on the uncompressed data.
The JLayer MP3 Library appears to support several operations on MP3 and WAV files including conversion, with no native libraries to install.
You can use MP3SPI to do this. This is a java sound plugin, just include the jar into the classpath, and you can use java sound api to convert between wav and mp3.

Categories

Resources