I have just started learning Java and I have to deliver a assignment in Which I have to read an Audio (.wav) File and Create echo effect of the audio file and save it without using any external library. Kindly guide me from where exactly to start. Although I have a basic knowledge about C++ upto functions and a little about Classes & Objects. Looking forward for the right direction as I am short of time!
Thanks.
You can find a working example here : http://www.java2s.com/Code/Java/Development-Class/Anexampleofplayingasoundwithanechofilter.htm
Related
I am having some trouble figuring out how to convert audio data stream captured as 128 byte by a device to a .wav file and then how to save that .wav file. I am using eclipse with JRE8 to create a java project. Please let me know if any additional information would be helpful.
Here is the code I have thus far:
public void StartStreaming(){
{if(device !=null)}
{device.startAudioInput();}}
public void ConvertToWav()
{
//NEED HELP HERE
}
public void SaveWav()
{
//NEED HELP HERE TOO
}}
I have reviewed the tutorial on capturing sound but I cannot figure out how to convert the data to a .wav file and then save it.
I am not a coder by training so I would greatly appreciate if you could explain things as if you were talking to a beginner/non-coder/idiot. Thanks in advance for your help!
Here's a strategy you could take:
Find a command line tool which can do the conversion for you. The tool doesn't have to be written in java, but it can be executed from the command line (dos shell, bash shell, etc). Try it from the command line first and make sure it works as you expect. You'll have to research a little and find a tool which works for your purposes. If this is going to run in production on a different operating system than your development computer, make sure the tool works in all OS. Here's just one example. I am not advocating it as I've never used it. http://www.coolutils.com/CommandLine/TotalAudioConverter
You can invoke native commands from java, ie, the tool you just found in #1. Warning, this is not beginner java programming. However, it will accomplish your task. Here's an example:http://www.mkyong.com/java/how-to-execute-shell-command-from-java/
I've been learning Java for a month now. I've already managed to code some very simple stuff like prime number generator and a simple calculator. Now i'd love to try working on something more complex.
Here's my idea - I'd love to make a program that can copy pictures from SD card or USB with a single click (something that my parents can use very easily to copy all their photos to a folder without my help)
I was brainstorming quite a bit about it and before i start i want to ask following questions:
1. Are there any inbuilt Java methods that can help me with the following task?
2. What are the other (non-beginner) Java features that i'd need to read about?
I want to start it from the scratch, make it simple at first and progressively add more features to practice and learn some more.
Any pointers or tips much appreciated.
I'd suggest doing this as a script. The script can invoke java if you'd like to improve your java skills. However, scripting languages can also copy/move files very easily. If you choose java, read about file I/O, reading files, writing files, etc.
Here's a link for windows. Not sure what your operating system is, but you could create an executable script on mac, linux, etc.
http://www.wikihow.com/Write-a-Batch-File
Has anyone managed to use acoustid (http://acoustid.org/chromaprint) in an Java application? Accessing the chromaprint clib should be easy but I can't just pass in the audio file. I requires the raw uncompressed audio data.
I've tried using xuggler to get the uncompressed audio but didn't get anywhere. Basically I have no idea how to get the raw audio from encoded files like mp3/m4a/etc
Has anybody managed to make this work? Anyone mind sharing their code?
I suggest you use the fpcalc command line tool (included in Chromaprint, binaries for Windows/Mac/Linux are included on the website), run it in a subprocess from your Java application. You get output like this, which should be easy to parse:
FILE=/path/to/file.mp3
DURATION=398
FINGERPRINT=AQADtEqkRIkkrQ...
That's how most programs integrate AcoustID and I believe it's the easiest way.
I am about to make an app on android but I have 0 experience about it.
This project is important and kind of a big challenge to me.
With that being said, I will try my best to explain about it so you guyz can give me an accurate approach
So assuming I have a program written in C,C++. Either an .exe or bunch of library.
What this executable do is to process the data and generate a file with bunch of binary and weird output. This process is called pre-processing.
Then result file will then be fed into Matlab or python and the graphical result will be generated. This is called post-processing and also the final goal.
Right now I can't afford to get matlab installed so my boss only asked me to go up to the pre-processing part.
The project will be displaying the pre-processing on the screen of a android device even if it might be unreadable.
I have done some research and found several ways to accomplish this:
1/ write a simple app using java and use JNI to call the main function of the .exe
2/ write a simple app using c++ and get the result straight from the .exe
That's all i can come up with, can any expert give me some suggestions please.
I am looking for a solution that would get me pass the pre-processing phase but also be efficient and easy if I get a chance to work on post-processing phase later.
Thank you very much
I have been working on a music app for android devices for the past few months. I have written a considerable amount of code so far. However, I have been stuck for almost a month on the mixing part of the code. Since Android does not offer a way to mix audio (merge sounds into one file so that they play at the same time) I decided to add the Jmusic library to the project and use it to manipulate audio files. Unfortunately, every time I try to read an audio file from the sdcard, the app crashes. I have been looking for resource online to solve this problem, but I can't find a good one. I am thinking that maybe Android does not support the use of other libraries. Can any of you guys suggest an alternative solution if that's the case. An example code (with explanation) using Java would be greatly appreciated. What I am mainly doing is declaring a float array (data) and reading the audio file as such
data = Read.Audio("string that holds the path of the file on the sd card");
what i think is android doesn't support javaSE environment..after the compilation process
Android produces dalvik code while java has it's byte code both of them being significantly different.