diff --git a/conf.ini b/conf.ini index ae3eba6..e627e79 100644 --- a/conf.ini +++ b/conf.ini @@ -1,7 +1,7 @@ [main] # mission = i&v -mission = video -# mission = OGG +# mission = video +mission = OGG # mission = audio # mission = image # mission = rotate @@ -32,8 +32,8 @@ txt = txt [root] folder = /Users/zen/git image = /Volumes/noname -audio = /Users/zen/Downloads/Telegram Desktop -video = /mnt/f/Downloads/武林外传/50 +audio = /mnt/f/music/audio +video = /mnt/f/Downloads/武林外传/60 gif = /Users/zen/Downloads/Fugtrup collection/archive/webp txt = /Users/zen/Downloads/tele bilibili = /mnt/d/git/processAll/merge/downloads diff --git a/processAudio/ogg.go b/processAudio/ogg.go index 563af93..10cfab1 100644 --- a/processAudio/ogg.go +++ b/processAudio/ogg.go @@ -1,6 +1,8 @@ package processAudio import ( + "log/slog" + "os" "os/exec" "processAll/GetFileInfo" "processAll/replace" @@ -13,15 +15,15 @@ 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, "-c:a", "libvorbis", out) - _ = util.ExecCommand(cmd) - //if err == nil { - // if err = os.RemoveAll(in.FullPath); err != nil { - // slog.Warn("删除失败", slog.String("源文件", in.FullPath), slog.Any("错误", err)) - // } else { - // slog.Debug("删除成功", slog.String("源文件", in.FullPath)) - // } - //} + cmd := exec.Command("ffmpeg", "-i", in.FullPath, "-ac", "1", "-c:a", "libvorbis", out) + err := util.ExecCommand(cmd) + if err == nil { + if err = os.RemoveAll(in.FullPath); err != nil { + slog.Warn("删除失败", slog.String("源文件", in.FullPath), slog.Any("错误", err)) + } else { + slog.Debug("删除成功", slog.String("源文件", in.FullPath)) + } + } } func Audios2OGG(dir, pattern string) {