Mixing audio on android with Jmusic - java

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.

Related

Recording over existing audio file in android

I am currently building an app in android, and I am trying to record my audio over an existing audio file (without changing the length of the file), does anyone know how is it possible to do that? Everything I tried just puts the audio files one after another in one file.
A. You should use GGmpeg for Android, for example. Here you have some questions like yours.
question with code
more detailed tutorial
Google Group
another question
B. Another approach, although limited, is Android SoundPool. Check documentation here.
The sound pool requires you to manage multiple files rather than doing
mixdowns and playback of a single file. It would be cool if the
soundpool let you grap the output as a IOStream but, alas, the SDK
doesn't seem to allow it. Further, it would be nice if the
AudioRecorder allowed you to grab a stream from the music layer...but
that doesn't look possible either. List of audio inputs:
http://developer.android.com/reference/android/media/MediaRecorder.AudioSource.html
SOURCE: https://stackoverflow.com/a/2254086/9415337
C. Others suggest also doing it in a backend server.
D. This might also help you.

Java Audio file read and Creating Echo effect

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

JAVA MP2 playback (native)

I have a problem with MP2 audio files and JAVA. Audio seems to be a pain in JAVA anyway. I tried using JavaLayer and Xuggler to decode and transcode the MP2 file to WAV. Both of which failed. And development of those seems to be not active. Although many are still using these. JMF or FMJ I haven't tried yet. I was wishing for more native approach.
I ended up forking JavaLayer to my project. And with a small code change I managed to seemingly get it to read all the frames from the MP2. But trying to convert it to WAV resulted in a file playable only in VLC and well, it was recognizable but distorted.
Anyway, a broad question, I apologize. I guess I'm asking that is there any JAVA + JavaLayer + MP2 gurus out there who can help me?
Original MP2: https://dl.dropboxusercontent.com/u/90134918/horng014.mp2
Failed WAV conversion: https://dl.dropboxusercontent.com/u/90134918/horng014_fail.wav
I have a public GitHub account for this project, but I haven't posted this broken code there yet.
Meanwhile theres's a new Java Media Framework here:
https://sourceforge.net/projects/doppio/
with a high level API for players and a low level API for using only decoders.
This player here https://sourceforge.net/projects/xamp2/ based on this media framework and can play mentioned file. Also the stuff is open source.
After stepping through jlayer1.01 in debugger, I conclude there are only two possibilities:
Either jlayer decodes the header word wrong, or jlayers tables and code are correct and the file's parameters deviate from what the standard defines. I lack the knowledge and time to find out wich of the two is the case.
Just because jlayer hasn't been updated for a few years does not necessarily mean its abandoned; it generally works very well with the average MP3. Why should there be an update if there aren't any known bugs left?
MP2 isn't exactly common these days; actually it hasn't even been that common 15 years ago, so it might well be the case there is a still unknown bug. Try filing a bug report and give it some time.
The MP2 file is is correct and MP2 is common these days, the MP2 Encoder twolame is up to date with enhanced VBR encoding. You can play the file with common players. There are two different bugs in JLayer: 1. The frame size calculation is wrong and 2. A Bit allocation table for MP2 Low Sampling Frequency (Mpeg2-Layer2) is buggy.

Android app that called external .exe

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

1-D barcode scanner(using images from a capturing device) implementation in java

I am a student and as a project i have to implement a barcode(1-D) based attendance marking system.While surfing across the web i came to know that barcode readers are a bit costly toys to purchase,so now what I want to do is I want to capture images of barcodes through a capturing device(mostly a webcam) and then process them to get the content stored in it.
I found a few projects on the internet that do the same but they use .NET f/w and I am not so familiar with .NET technology. The only project that uses java is http://sourceforge.net/projects/javabarcoderead/ but somehow i am not able to run the jar file they are providing.
SO, I would like to know about the algorithms or methods that can be used for the same or even any project from where i can get some insight on how to move further with this...
Happy Coding...
You're right, it would be very difficult to use a library with no documentation and no source code.
I'd suggest using ZXing. It's a well-documented library with lots of examples.

Categories

Resources