Closed devvuphan closed 2 years ago
Hi @devvuphan. Please, provide this raw mp3 file. I'd like to test it
thanks for you feedback. It's a file i copied from internet. Are there any requires for the audio file to use with your lib? https://tainhac123.com/tai-bai-hat-de-vuong-dinh-dung-ft-acv-mp3/w8lmuII1Yn2G.html
Hmm, library processed file without errors.
I/System.out: Start Progress
I/System.out: Decode resource: 1%
I/System.out: Decode resource: 2%
// ...
I/System.out: Decode resource: 99%
I/System.out: Decode resource: 100%
I/System.out: Process audio: 1%
I/System.out: Process audio: 2%
// ...
I/System.out: Process audio: 99%
I/System.out: Process audio: 100%
I/System.out: Stop Progress
I/System.out: Audio info:
millis = 262031
seconds = 262
source = 2131492864
source type = RESOURCE
Amplitudes:
size: = 266
list: = [0, 0, 5, 5, 6, 3, 5, 5, 6, 5, 11, 8, 10, 6, 8, 9, 11, 10, 15, 15, 9, 5, 17, 13, 9, 6, 14, 13, 10, 3, 15, 15, 11, 4, 13, 14, 14, 4, 14, 17, 11, 4, 14, 17, 14, 4, 14, 17, 14, 5, 26, 33, 34, 19, 30, 29, 29, 25, 28, 32, 31, 26, 23, 33, 29, 32, 19, 34, 33, 29, 27, 32, 32, 29, 26, 38, 33, 32, 25, 37, 33, 32, 32, 32, 24, 32, 27, 32, 26, 20, 15, 24, 24, 35, 28, 32, 29, 25, 19, 24, 20, 20, 10, 25, 18, 23, 6, 26, 15, 26, 5, 29, 14, 26, 6, 12, 15, 18, 7, 15, 14, 16, 7, 12, 17, 17, 8, 12, 18, 20, 16, 16, 38, 37, 34, 32, 36, 35, 33, 33, 32, 32, 28, 22, 31, 32, 33, 19, 34, 34, 33, 22, 37, 28, 35, 19, 38, 32, 37, 24, 36, 32, 34, 32, 34, 29, 31, 33, 33, 30, 23, 13, 22, 31, 33, 34, 36, 32, 28, 17, 26, 35, 33, 28, 29, 33, 29, 32, 30, 34, 32, 29, 26, 37, 33, 35, 24, 35, 35, 30, 29, 33, 33, 31, 30, 40, 34, 34, 28, 37, 35, 33, 32, 34, 27, 49, 39, 39, 31, 47, 36, 32, 33, 38, 37, 43, 29, 36, 37, 23, 16, 22, 38, 42, 32, 37, 35, 43, 34, 38, 36, 39, 41, 28, 17, 17, 11, 10, 6, 9, 14, 10, 5, 8, 16, 10, 12, 10, 14, 13, 12, 9, 4, 1, 0, 0]
Please, try to process this file directly with Amplituda. You can use java code below:
Amplituda amplituda = new Amplituda(this);
amplituda.processAudio(
R.raw.test,
Compress.withParams(Compress.AVERAGE, 1),
new AmplitudaProgressListener() {
@Override
public void onStartProgress() {
super.onStartProgress();
System.out.println("Start Progress");
}
@Override
public void onStopProgress() {
super.onStopProgress();
System.out.println("Stop Progress");
}
@Override
public void onProgress(ProgressOperation operation, int progress) {
String currentOperation = "";
switch (operation) {
case PROCESSING: currentOperation = "Process audio"; break;
case DECODING: currentOperation = "Decode resource"; break;
case DOWNLOADING: currentOperation = "Download audio from url"; break;
}
System.out.printf("%s: %d%% %n", currentOperation, progress);
}
}
).get(result -> { printResult(result);
}, exception -> { exception.printStackTrace(); });
Thanks lincollincol. I will try with your code
Hello, i get this message error when i build my app in release mode.
No pending exception expected: java.lang.NoSuchFieldError: no "Ljava/lang/String;" field "amplitudes" in class "Llinc/com/amplituda/AmplitudaResultJNI;" or its superclasses. But app correctly works on Dev build. What should i do?
Thanks!
Hello! Please, update Amplituda to 2.1.3
and try again
implementation 'com.github.lincollincol:Amplituda:2.1.3'
@henockbongi @devvuphan
Hello,
I tried but still not works i don't know why
Hmm, library processed file without errors.
I/System.out: Start Progress I/System.out: Decode resource: 1% I/System.out: Decode resource: 2% // ... I/System.out: Decode resource: 99% I/System.out: Decode resource: 100% I/System.out: Process audio: 1% I/System.out: Process audio: 2% // ... I/System.out: Process audio: 99% I/System.out: Process audio: 100% I/System.out: Stop Progress I/System.out: Audio info: millis = 262031 seconds = 262 source = 2131492864 source type = RESOURCE Amplitudes: size: = 266 list: = [0, 0, 5, 5, 6, 3, 5, 5, 6, 5, 11, 8, 10, 6, 8, 9, 11, 10, 15, 15, 9, 5, 17, 13, 9, 6, 14, 13, 10, 3, 15, 15, 11, 4, 13, 14, 14, 4, 14, 17, 11, 4, 14, 17, 14, 4, 14, 17, 14, 5, 26, 33, 34, 19, 30, 29, 29, 25, 28, 32, 31, 26, 23, 33, 29, 32, 19, 34, 33, 29, 27, 32, 32, 29, 26, 38, 33, 32, 25, 37, 33, 32, 32, 32, 24, 32, 27, 32, 26, 20, 15, 24, 24, 35, 28, 32, 29, 25, 19, 24, 20, 20, 10, 25, 18, 23, 6, 26, 15, 26, 5, 29, 14, 26, 6, 12, 15, 18, 7, 15, 14, 16, 7, 12, 17, 17, 8, 12, 18, 20, 16, 16, 38, 37, 34, 32, 36, 35, 33, 33, 32, 32, 28, 22, 31, 32, 33, 19, 34, 34, 33, 22, 37, 28, 35, 19, 38, 32, 37, 24, 36, 32, 34, 32, 34, 29, 31, 33, 33, 30, 23, 13, 22, 31, 33, 34, 36, 32, 28, 17, 26, 35, 33, 28, 29, 33, 29, 32, 30, 34, 32, 29, 26, 37, 33, 35, 24, 35, 35, 30, 29, 33, 33, 31, 30, 40, 34, 34, 28, 37, 35, 33, 32, 34, 27, 49, 39, 39, 31, 47, 36, 32, 33, 38, 37, 43, 29, 36, 37, 23, 16, 22, 38, 42, 32, 37, 35, 43, 34, 38, 36, 39, 41, 28, 17, 17, 11, 10, 6, 9, 14, 10, 5, 8, 16, 10, 12, 10, 14, 13, 12, 9, 4, 1, 0, 0]
Please, try to process this file directly with Amplituda. You can use java code below:
Amplituda amplituda = new Amplituda(this); amplituda.processAudio( R.raw.test, Compress.withParams(Compress.AVERAGE, 1), new AmplitudaProgressListener() { @Override public void onStartProgress() { super.onStartProgress(); System.out.println("Start Progress"); } @Override public void onStopProgress() { super.onStopProgress(); System.out.println("Stop Progress"); } @Override public void onProgress(ProgressOperation operation, int progress) { String currentOperation = ""; switch (operation) { case PROCESSING: currentOperation = "Process audio"; break; case DECODING: currentOperation = "Decode resource"; break; case DOWNLOADING: currentOperation = "Download audio from url"; break; } System.out.printf("%s: %d%% %n", currentOperation, progress); } } ).get(result -> { printResult(result); }, exception -> { exception.printStackTrace(); });
I also tried this code but Android Studio told me that it cannot resolve classes and asked me to create Amplituda Class
How can i try directly try to process file directly with Amplituda? First, i will try to process from an url to see what will happened, then i'll tell you what i got.
Consumer rules updated in 2.1.4
version. So, this should solve the error
@devvuphan @henockbongi
version 2.2.2 Still crashing
I'm trying to apply waveformSeekBar + Amplituda to my project. Your description is very cool. But i can't run it with mp3 raw folder.
Added:
And i got this error:
Are there any changes i need to do more? Or i missed any guideline?
Thank you.