Ну, ребята, когда я использую TarsosDSP / TarsosDSP Android для обработки голосовых данных В типе байта [] я получаю ошибку voi c данные с большим количеством шума, это сводит меня с ума !! Вот мой код (в Android Studio):
public byte[] changeVoiceByte(byte[] inputData) {
byte[] outputData = new byte[inputData.length];
AudioFormat audioFormat = new AudioFormat(48000, 16, 1, false, false);
WaveformSimilarityBasedOverlapAdd.Parameters parameters = WaveformSimilarityBasedOverlapAdd.Parameters.speechDefaults(1.0, 48000);
WaveformSimilarityBasedOverlapAdd overlapAdd =
new WaveformSimilarityBasedOverlapAdd(parameters);
int inputBufferSize = overlapAdd.getInputBufferSize();
int overlap = overlapAdd.getOverlap();
try {
AudioDispatcher dispatcher = AudioDispatcherFactory.fromByteArray(
inputData, audioFormat, inputBufferSize, overlap);
overlapAdd.setDispatcher(dispatcher);
dispatcher.addAudioProcessor(overlapAdd);
dispatcher.addAudioProcessor(new RateTransposer(1.0));
AudioOutputToByteArray out = new AudioOutputToByteArray();
// To make the volume of voice more higher ↓↓↓
dispatcher.addAudioProcessor(new GainProcessor(10));
dispatcher.addAudioProcessor(out);
dispatcher.run();
outputData = out.getData();
} catch (Exception e) {
e.printStackTrace();
}
return outputData;
}