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.
Related
I want to create a video from sequence of images, the images are of same size and I don't want to add any audio file to it so that's going to not hard.
What I need to do for that please explain, what line of code should I need to use for this, or if you have the sample code for it?
I suggest use ffmpeg. https://github.com/bramp/ffmpeg-cli-wrapper
This is a wapper library for 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.
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
I'm searching a java framework for manipulate audio and video files, I need functions like:
Split video and audio files
Get a frame from a video
Key Frame extraction
I tried Xuggle and I want to know if there are other frameworks.
any advice?
I found Xuggler: http://www.xuggle.com/xuggler/
Which audio and video format you are dealing with? For MPEG-2, Project X may be a solution.
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.