diff --git a/AndroidMedia/build.gradle b/AndroidMedia/build.gradle index 181e8fa..81872ac 100644 --- a/AndroidMedia/build.gradle +++ b/AndroidMedia/build.gradle @@ -1,8 +1,8 @@ apply plugin: 'com.android.library' //apply plugin: 'com.android.application' -apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-android' +apply plugin: 'kotlin-android-extensions' android { compileSdkVersion rootProject.ext.compileSdkVersion diff --git a/app/build.gradle b/app/build.gradle index 8d259e3..a880e40 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,6 +1,6 @@ apply plugin: 'com.android.application' -apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-android' +apply plugin: 'kotlin-android-extensions' android { compileSdkVersion rootProject.ext.compileSdkVersion diff --git a/app/src/main/java/com/frank/ffmpeg/activity/AudioHandleActivity.kt b/app/src/main/java/com/frank/ffmpeg/activity/AudioHandleActivity.kt index 36e3688..1a82b79 100644 --- a/app/src/main/java/com/frank/ffmpeg/activity/AudioHandleActivity.kt +++ b/app/src/main/java/com/frank/ffmpeg/activity/AudioHandleActivity.kt @@ -261,7 +261,7 @@ class AudioHandleActivity : BaseActivity() { 12 -> { // audio waveform outputPath = PATH + File.separator + "waveform.png" val resolution = "1280x720" - commandLine = FFmpegUtil.showAudioWaveform(srcFile, resolution, outputPath) + commandLine = FFmpegUtil.showAudioWaveform(srcFile, resolution, 1, outputPath) } 13 -> { //audio encode val pcmFile = PATH + File.separator + "raw.pcm" diff --git a/app/src/main/java/com/frank/ffmpeg/util/FFmpegUtil.java b/app/src/main/java/com/frank/ffmpeg/util/FFmpegUtil.java index 7262420..f592cc7 100644 --- a/app/src/main/java/com/frank/ffmpeg/util/FFmpegUtil.java +++ b/app/src/main/java/com/frank/ffmpeg/util/FFmpegUtil.java @@ -870,9 +870,9 @@ public class FFmpegUtil { return insert(trimCmd.split(" "), 2, inputPath, outputPath); } - public static String[] showAudioWaveform(String inputPath, String resolution, String outputPath) { - String waveformCmd = "ffmpeg -i -filter_complex showwavespic=s=%s"; - waveformCmd = String.format(Locale.getDefault(), waveformCmd, resolution); + public static String[] showAudioWaveform(String inputPath, String resolution, int splitChannels, String outputPath) { + String waveformCmd = "ffmpeg -i -filter_complex showwavespic=s=%s:split_channels=%d"; + waveformCmd = String.format(Locale.getDefault(), waveformCmd, resolution, splitChannels); return insert(waveformCmd.split(" "), 2, inputPath, outputPath); }