From ec572b874ba51cc08fc1f8f5756abe7b9cbc5a8f Mon Sep 17 00:00:00 2001 From: Dominik Polakovics Date: Sat, 16 Nov 2024 01:24:44 +0100 Subject: [PATCH 1/2] feat: add 7.1.2 possibility --- internal/logic/sync-7.1.2.go | 8 ++++++++ internal/logic/sync.go | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 internal/logic/sync-7.1.2.go diff --git a/internal/logic/sync-7.1.2.go b/internal/logic/sync-7.1.2.go new file mode 100644 index 0000000..5b852d7 --- /dev/null +++ b/internal/logic/sync-7.1.2.go @@ -0,0 +1,8 @@ +package logic + +func get7_1_2Arguments() []string { + return []string{ + "-filter_complex", + "[1:a]apad[a2];[0:a][a2]amerge=inputs=2,pan=7.1.2|FL=c0+c10|FR=c1+c11|FC=c2|LFE=c3|BL=c6|BR=c7|SL=c4|SR=c5|TFL=c8|TFR=c9[out]", + } +} diff --git a/internal/logic/sync.go b/internal/logic/sync.go index 99b7692..f569eb9 100644 --- a/internal/logic/sync.go +++ b/internal/logic/sync.go @@ -169,10 +169,12 @@ func getChannelArguments(channels int) ([]string, error) { return getStereoArguments(), nil case 6: return get5_1Arguments(), nil + case 10: + return get7_1_2Arguments(), nil case 12: return get7_1_4Arguments(), nil } - return nil, fmt.Errorf("Currently only stereo, 5.1 and 7.1.4 Soundscapes are supported") + return nil, fmt.Errorf("Currently only stereo, 5.1, 7.1.2 and 7.1.4 Soundscapes are supported") } func getCoverArtArguments(file1 string, file2 string) []string { From 2f2bc040f40562213f7b004cd23c3bf1f1c36e2f Mon Sep 17 00:00:00 2001 From: Dominik Polakovics Date: Sat, 16 Nov 2024 02:09:47 +0100 Subject: [PATCH 2/2] fix: an issue where ffmpeg throws 234 when trying to add a cover image to wav --- internal/logic/sync.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/logic/sync.go b/internal/logic/sync.go index f569eb9..327c932 100644 --- a/internal/logic/sync.go +++ b/internal/logic/sync.go @@ -87,7 +87,9 @@ func CombineFiles(folder1 string, folder2 string, outputFolder string, progress } arguments = append(arguments, channelArguments...) arguments = append(arguments, getBaseArguments()...) - arguments = append(arguments, getCoverArtArguments(file, files2[index])...) + if ext == ".mp3" || ext == ".flac" { + arguments = append(arguments, getCoverArtArguments(file, files2[index])...) + } arguments = append(arguments, newFileName) cmd := exec.CommandContext(ctx, ffmpeg, arguments...) cmd.SysProcAttr = getSysProcAttr()