FFmpeg-Android icon indicating copy to clipboard operation
FFmpeg-Android copied to clipboard

My exported music does not quality

Open mahdizareeii opened this issue 5 years ago • 0 comments

Hello, my friend I mixing two music with this code,

//***************************************************

public void mix(Context context, String firstFile, String secondFile, String finalFile) {

    File finalAudio = new File(finalFile);
    String[] command = new String[]{
            "-i",
            firstFile,
            "-i",
            secondFile,
            "-shortest",
            "-filter_complex",
            "[0:a]volume=8.0[a0];[1:a]volume=1.0[a1];[a0][a1]amix=inputs=2:duration=shortest",
            finalAudio.getAbsolutePath()
    };

    FFmpeg fFmpeg = FFmpeg.getInstance(context);
    FFtask ffTask = fFmpeg.execute(command, new FFcommandExecuteResponseHandler() {
        @Override
        public void onSuccess(String message) {
            Toast.makeText(context, "success, Toast.LENGTH_SHORT).show();
        }

        @Override
        public void onProgress(String message) {
        }

        @Override
        public void onFailure(String message) {
            Toast.makeText(context, "failed", Toast.LENGTH_SHORT).show();
        }

        @Override
        public void onStart() {
            Toast.makeText(context, "mixing started", Toast.LENGTH_SHORT).show();
        }

        @Override
        public void onFinish() {
            Toast.makeText(context, "end", Toast.LENGTH_SHORT).show();
        }
    });
    ffTask.isProcessCompleted();
}

//*************************************************** and my first file and second file extensions are ''.m4a" and my final file extension is ".wav" but my exported music does not good quality

please help me thanks

mahdizareeii avatar Dec 19 '19 17:12 mahdizareeii