nieldeokar / whatsappaudiorecorder Goto Github PK
View Code? Open in Web Editor NEWSimple audio recorder using Android's AudioRecorder with .aac File extention.
Simple audio recorder using Android's AudioRecorder with .aac File extention.
Hello Nieldeokar,
Can you tell me how to calculate amplitude from your code ? I have added this code , I am getting Amplitude but not more than 55 in any case
private boolean handleCodecInput(AudioRecord audioRecord,
MediaCodec mediaCodec, ByteBuffer[] codecInputBuffers,
boolean running) throws IOException {
byte[] audioRecordData = new byte[bufferSize];
int length = audioRecord.read(audioRecordData, 0, audioRecordData.length);
computedbAmp(audioRecordData); ///this is amplitude code
if (length == AudioRecord.ERROR_BAD_VALUE ||
length == AudioRecord.ERROR_INVALID_OPERATION ||
length != bufferSize) {
if (length != bufferSize) {
if (onRecorderFailedListener != null) {
Log.d(TAG, "length != BufferSize calling onRecordFailed");
onRecorderFailedListener.onRecorderFailed();
}
return false;
}
}
//code
//compute here
public double computedbAmp(byte[] audioData) {
//System.out.println("::::: audioData :::::"+audioData);
double amplitude = 0;
double sum=0;
for (int i = 0; i < audioData.length/2; i++) {
double y = (audioData[i2] | audioData[i2+1] << 8);
sum += yy;
}
double rms = sum / audioData.length/2;
amplitude = 20.0Math.log10(rms/32768.0);
return amplitude;
}
I would like to integrate the library in my application with a minSdkVersion 16, some tips or recommendations ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.