Create video from audio with Xuggler - java

I'm trying to pragmatically create a video from an audio file (probably WAV). The video will be nothing fancy, just a few lines of text on a black background. It'll last the entirety of the audio clip and then save it to a file (ideally MP4).
My problem is that I'm not entirely sure where to start. Like, I've read the tutorials and whatnot but I still don't know where to start. I assume you need to create a reader, a writer, and a tool to place in the chain to put text on the screen. However, I don't know if you can just create images and Xuggler will automatically realize that it's dealing with a video file, not just an audio file. Also, I'm not sure how to load in an audio file in Xuggler.
Thank you for any help you're able to provide.

Related

Convert mp3 to static image waveform

I am new to android studio and I'm doing my university project in it. Essentially what I am trying to do is allow the user to import an mp3 file from their device and then generate a static waveform image from the mp3 file.
I have searched around but all I can seem to find is animated visualizers that illustrate the waveform as the mp3 is playing on the device. I just want a static image that the user can save to their phone.Please see attached image.
waveform image
If anyone can assist me with this or direct me towards some resources that I could use it would be greatly appreciated.
The best library you can use is FFMPEG, its an application you run by command line.
Here some source code for the library: source 1, source 2
About the waveform image, ffmpeg have some resources to extract images from video/audio, you have to search for the command and see how to do it.
I never made something like that, so I don't know the exactly command but I know the better library you can use to make what you want to make, is ffmpeg.
If you have any other question about ffmpeg, feel free to ask me.

Java sound visualizer

i'm trying to make a java sound visualizer, but I have absolutely no idea on how to get the bytes from the audio extracted, immediately after they are procressed in real-time. I could synchronize the program with an wav file, but that is not what I want to do, I want to generate the sound with the program, then play it, without saving it anywhere.
Thanks for the help!
This article can help you understand the structure of sound files: Build an Audio Waveform Display

Mix sound files on android

I was trying to make a program that would take a recording from the microphone, and overlay it on an existing wav file. How would this be possible?
If you don't have to save the file as one file and just want to play it together, you can simply create 2 MediaPlayers and play them at the same time.
If you want to actually create a new file, you would need to read about WAV file structure and go from there.

Video converting into mp3 on Java, Android

I need to convert mp4/flv files info mp3 in my Android application, but I don't know C/C++ and Android NDK. Do you know libraries/methods for easy converting on Java? Thank you for anyway.
Your question is how to extract audio from MP4/ FLV files and save as mp3 file. Right ?
Then, very sorry, Android SDK does not provide any API for transformating or track extraction.
Also using available media framework to achieve the same is also not trivial (and even if you do, you will lose portability).
What I would suggest is to use your MP4 & FLV Parser to extract audio track, do transcoding (if audio track is non-mp3), and save the transcoded (if audio track extracted is mp3, then extracted data) data.
Or you can port FFMPEG code base and use the same. This again may be overkill for your small task.
Suppose you just want to extract mp3 track from MP4, then you understand the native mp4 parser and use the APIs for extraction. You may have to replicate some code from stagefright / opencore.
Shash
it's probably irrelevant for you anymore but if some one still need a mp4 to mp3 parser here's an api that can do the job

Display sound (.wav/.mp3) as graph in Java

I need to display a graph of a sound file - i.e. a wave form as displayed by audio editors such as Audacity.
How should I go about this? Is there anything in the Java Sound API that can help me?
In Java Sound API poke around AudioSystem.getAudioInputStream
which will return AudioInputStream which shows you how to open audio files form within Java. It is good enough to read .wav files, but not quite so for mp3s.
It lets you read bytes one by one directly. Also getAudioFormat will return object that has sample rate, bit/sample, etc. After reading your waveform you can draw it in your favorite way on the screen (Swing, AWT, png file on the web, etc.).
In the end I found code to do exactly what I wanted in Chapter 10 of the book Swing Hacks.

Categories

Resources