diff --git a/processAudio/aac.go b/processAudio/aac.go index 27bc41b..be2c4b0 100644 --- a/processAudio/aac.go +++ b/processAudio/aac.go @@ -14,7 +14,7 @@ func Audio2AAC(in GetFileInfo.BasicInfo) { // 执行转换 fname := replace.ForFileName(in.PurgeName) out := strings.Join([]string{in.PurgePath, fname, ".ogg"}, "") - cmd := exec.Command("ffmpeg", "-i", in.FullPath, "-c:a", "libvorbis", "-ac", "1", out) + cmd := exec.Command("ffmpeg", "-i", in.FullPath, "-ac", "1", out) err := util.ExecCommand(cmd) if err == nil { diff --git a/processAudio/louder.go b/processAudio/louder.go index e1cd6fe..94d9e86 100644 --- a/processAudio/louder.go +++ b/processAudio/louder.go @@ -52,7 +52,7 @@ func LouderAudio(in GetFileInfo.BasicInfo) { 仅使用输入输出和增大电平 */ func Louder(in, out string) { - cmd := exec.Command("ffmpeg", "-i", in, "-filter:a", "volume=3.0", "-c:a", "libvorbis", "-map_metadata", "-1", out) + cmd := exec.Command("ffmpeg", "-i", in, "-filter:a", "volume=3.0", "-map_metadata", "-1", out) util.ExecCommand(cmd) if err := os.RemoveAll(in); err != nil { slog.Warn("删除失败", slog.String("源文件", in), slog.Any("错误内容", err)) diff --git a/processAudio/ogg.go b/processAudio/ogg.go index 7023706..7de393b 100644 --- a/processAudio/ogg.go +++ b/processAudio/ogg.go @@ -15,7 +15,7 @@ func Audio2OGG(in GetFileInfo.BasicInfo) { fname := replace.ForFileName(in.PurgeName) //fname=r out := strings.Join([]string{in.PurgePath, fname, ".ogg"}, "") - cmd := exec.Command("ffmpeg", "-i", in.FullPath, "-ac", "1", "-c:a", "libvorbis", "-map_metadata", "-1", out) + cmd := exec.Command("ffmpeg", "-i", in.FullPath, "-ac", "1", "-map_metadata", "-1", out) err := util.ExecCommand(cmd) if err == nil { if err = os.RemoveAll(in.FullPath); err != nil { diff --git a/processAudio/speedUp.go b/processAudio/speedUp.go index 357a858..cec27c3 100644 --- a/processAudio/speedUp.go +++ b/processAudio/speedUp.go @@ -62,13 +62,13 @@ func SpeedupAudio(in GetFileInfo.BasicInfo, speed string) { func speedUp(in, out string, speed string) { ff := audition2ffmpeg(speed) atempo := strings.Join([]string{"atempo", ff}, "=") - cmd := exec.Command("ffmpeg", "-i", in, "-filter:a", atempo, "-vn", "-c:a", "libvorbis", "-ac", "1", "-map_metadata", "-1", out) + cmd := exec.Command("ffmpeg", "-i", in, "-filter:a", atempo, "-vn", "-ac", "1", "-map_metadata", "-1", out) util.ExecCommand(cmd) - if err := os.RemoveAll(in); err != nil { - slog.Warn("删除失败", slog.String("源文件", in), slog.Any("错误内容", err)) - } else { - slog.Debug("删除成功", slog.String("源文件", in)) - } + //if err := os.RemoveAll(in); err != nil { + // slog.Warn("删除失败", slog.String("源文件", in), slog.Any("错误内容", err)) + //} else { + // slog.Debug("删除成功", slog.String("源文件", in)) + //} } /* diff --git a/processAudio/unit_test.go b/processAudio/unit_test.go new file mode 100644 index 0000000..d0908db --- /dev/null +++ b/processAudio/unit_test.go @@ -0,0 +1,8 @@ +package processAudio + +import "testing" + +func TestLouderAudios(t *testing.T) { + //LouderAllAudios("/Users/zen/container/useWget", "mp3") + SpeedUpAllAudios("/Users/zen/container/useWget", "ogg", "65") +}