Piasy / AudioMixer

A cross-platform audio mixer, supports Android, iOS, macOS and Windows. Powered by WebRTC, FFmpeg and Djinni.
MIT License
187 stars 70 forks source link

Android: Issue with multiple MixerSource.TYPE_RECORD sources recording #5

Open pintukumarpatil opened 4 years ago

pintukumarpatil commented 4 years ago

Hello Team, I am getting issue in case of two recording sources: The voice is not clear

mixer= new AudioMixer(new MixerConfig( new ArrayList<>(Arrays.asList( new MixerSource(MixerSource.TYPE_RECORD, 1, 1, outputFile, sampleRate, channelCount), new MixerSource(MixerSource.TYPE_RECORD, 2, 1, outputFile, sampleRate, channelCount) )), sampleRate, channelCount, 10 ));

And writing buffer like

try { byte[] data = audioSamples.getData(); mixer.addRecordedData(ssrc, data, data.length); AudioBuffer buffer = mixer.mix(); if (buffer.getSize() > 0) { mixerDump.write(buffer.getBuffer(), 0, buffer.getSize()); } } catch (Exception e) { e.printStackTrace(); }