Ich suchte überall und ich konnte nicht herausfinden, wie MFCC-Funktion mit TarsosDSP auf Android zu extrahieren. Ich weiß, wie man FFT aus einer Datei holt. Irgendwelche Hilfe?Wie bekomme ich MFCC mit TarsosDSP?
2
A
Antwort
1
Siehe offizielle github page
MFCC-Test
public class MFCCTest {
// private static int counter = 0;
@Test
public void MFCCForSineTest() throws UnsupportedAudioFileException{
int sampleRate = 44100;
int bufferSize = 1024;
int bufferOverlap = 128;
final float[] floatBuffer = TestUtilities.audioBufferSine();
final AudioDispatcher dispatcher = AudioDispatcherFactory.fromFloatArray(floatBuffer, sampleRate, bufferSize, bufferOverlap);
final MFCC mfcc = new MFCC(bufferSize, sampleRate, 40, 50, 300, 3000);
dispatcher.addAudioProcessor(mfcc);
dispatcher.addAudioProcessor(new AudioProcessor() {
@Override
public void processingFinished() {
}
@Override
public boolean process(AudioEvent audioEvent) {
return true;
}
});
dispatcher.run();
}
}
und TestUtilities audioBufferSine()
public class TestUtilities {
/**
* Constructs and returns a buffer of a two seconds long pure sine of 440Hz
* sampled at 44.1kHz.
*
* @return A buffer of a two seconds long pure sine (440Hz) sampled at
* 44.1kHz.
*/
public static float[] audioBufferSine() {
final double sampleRate = 44100.0;
final double f0 = 440.0;
final double amplitudeF0 = 0.5;
final double seconds = 4.0;
final float[] buffer = new float[(int) (seconds * sampleRate)];
for (int sample = 0; sample < buffer.length; sample++) {
final double time = sample/sampleRate;
buffer[sample] = (float) (amplitudeF0 * Math.sin(2 * Math.PI * f0 * time));
}
return buffer;
}
0
Sie die mfcc unter dem Prozessereignis bekommen kann Datei, ich denke, dass es für jeden Rahmen
int sampleRate = 16000;
int bufferSize = 512;
int bufferOverlap = 128;
new AndroidFFMPEGLocator(this);
final List<float[]>mfccList = new ArrayList<>(200);
final AudioDispatcher dispatcher = AudioDispatcherFactory.fromPipe(audioFilePath, sampleRate, bufferSize, bufferOverlap);
final MFCC mfcc = new MFCC(bufferSize, sampleRate, 20, 50, 300, 3000);
dispatcher.addAudioProcessor(mfcc);
dispatcher.addAudioProcessor(new AudioProcessor() {
@Override
public void processingFinished() {
}
@Override
public boolean process(AudioEvent audioEvent) {
mfccList.add(mfcc.getMFCC());
return true;
}
});
dispatcher.run();
Verwandte Themen
- 1. Berechne MFCC mit Librosa
- 2. TarsosDSP Clap Detection
- 3. TarsosDSP Tonhöhenanalyse für Dummies
- 4. Wie man MFCC-Algorithmus macht?
- 5. RealTime Pitch Shifting mit TarsosDSP auf Android
- 6. Librosa: MFCC Merkmalsberechnung
- 7. MFCC Sampling-Frequenz
- 8. bedeuten MFCC Normalisierung
- 9. Train MFCC mit Machine Learning-Algorithmus
- 10. Audio-Deskriptor MFCC in C#
- 11. Spracherkennung mit LSTM mit in MFCC extrahierten Merkmalen
- 12. Sind für die Spracherkennung MFCC-Funktionen erforderlich?
- 13. MFCC Feature Deskriptoren für Audio-Klassifizierung mit Librosa
- 14. Plotten von MFCC Power Spektrogramm Python
- 15. Wie bekomme ich GenieACS?
- 16. Wie bekomme ich System.Web.Http.Owin?
- 17. Wie bekomme ich sal.h
- 18. Wie bekomme ich Butterknife?
- 19. Wie bekomme ich GetCustomAttributes?
- 20. Wie bekomme ich xjc?
- 21. Wie bekomme ich eine Subdomain mit window.location?
- 22. Wie bekomme ich alle elemets mit var_dump?
- 23. Wie bekomme ich Locale mit PHP
- 24. Wie bekomme ich den Attr mit jQuery?
- 25. Wie bekomme ich das Bildformat mit PIL?
- 26. Wie bekomme ich JSONArray Daten mit Retrofit2.0?
- 27. Wie bekomme ich spezielle Zeichenfolge mit RegExp?
- 28. Wie bekomme ich Checkboxen mit ng-touch?
- 29. Wie bekomme ich Image src mit simplexml
- 30. Wie bekomme ich bestimmte Daten mit Jsoup?