Add support for converting AC-4 files to mp3

This commit is contained in:
MBucari
2025-12-18 23:45:03 -07:00
parent cbbc45c3c5
commit 1087ffb150
9 changed files with 4 additions and 42 deletions

View File

@@ -13,7 +13,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AAXClean.Codecs" Version="2.1.1.1" />
<PackageReference Include="AAXClean.Codecs" Version="2.1.2.1" />
</ItemGroup>
<ItemGroup>

View File

@@ -125,7 +125,7 @@ public partial class DownloadOptions
//try to request a widevine content license using the user's audio settings
var aacCodecChoice = config.Request_xHE_AAC ? Codecs.xHE_AAC : Codecs.AAC_LC;
//Always use the ec+3 codec if converting to mp3
var spatialCodecChoice = config.SpatialAudioCodec is Configuration.SpatialCodec.AC_4 && !config.DecryptToLossy ? Codecs.AC_4 : Codecs.EC_3;
var spatialCodecChoice = config.SpatialAudioCodec is Configuration.SpatialCodec.AC_4 ? Codecs.AC_4 : Codecs.EC_3;
var contentLic
= await api.GetDownloadLicenseAsync(

View File

@@ -74,7 +74,7 @@ namespace FileLiberator
//If DrmType is not Adrm or Widevine, the delivered file is an unencrypted mp3.
OutputFormat
= licInfo.DrmType is not AudibleApi.Common.DrmType.Adrm and not AudibleApi.Common.DrmType.Widevine ||
(config.AllowLibationFixup && config.DecryptToLossy && licInfo.ContentMetadata.ContentReference.Codec != AudibleApi.Codecs.AC_4)
(config.AllowLibationFixup && config.DecryptToLossy)
? OutputFormat.Mp3
: OutputFormat.M4b;

View File

@@ -92,7 +92,6 @@
Margin="5,0,0,0"
Grid.Column="1"
VerticalAlignment="Center"
SelectionChanged="SpatialCodec_SelectionChanged"
ItemsSource="{CompiledBinding SpatialAudioCodecs}"
SelectedItem="{CompiledBinding SpatialAudioCodec}"/>
</Grid>

View File

@@ -23,15 +23,6 @@ namespace LibationAvalonia.Controls.Settings
}
}
private void SpatialCodec_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (_viewModel.SpatialAudioCodec.Value is Configuration.SpatialCodec.AC_4 && _viewModel.DecryptToLossy)
{
_viewModel.SpatialAudioCodec = _viewModel.SpatialAudioCodecs[0];
_viewModel.RaisePropertyChanged(nameof(AudioSettingsVM.SpatialAudioCodec));
}
}
private async void UseWidevine_IsCheckedChanged(object sender, Avalonia.Interactivity.RoutedEventArgs e)
{
if (sender is CheckBox cbox && cbox.IsChecked is true)

View File

@@ -145,18 +145,7 @@ namespace LibationAvalonia.ViewModels.Settings
public string StripAudibleBrandAudioTip => Configuration.GetHelpText(nameof(StripAudibleBrandAudio));
public bool StripUnabridged { get; set; }
public string StripUnabridgedTip => Configuration.GetHelpText(nameof(StripUnabridged));
public bool DecryptToLossy {
get => field;
set
{
this.RaiseAndSetIfChanged(ref field, value);
if (DecryptToLossy && SpatialAudioCodec.Value is Configuration.SpatialCodec.AC_4)
{
SpatialAudioCodec = SpatialAudioCodecs[0];
this.RaisePropertyChanged(nameof(SpatialAudioCodec));
}
}
}
public bool DecryptToLossy { get => field; set => this.RaiseAndSetIfChanged(ref field, value); }
public string DecryptToLossyTip => Configuration.GetHelpText(nameof(DecryptToLossy));
public bool MoveMoovToBeginning { get; set; }

View File

@@ -86,8 +86,6 @@ namespace LibationFileManager
The Dolby Digital Plus (E-AC-3) codec is more widely
supported than the AC-4 codec, but E-AC-3 files are
much larger than AC-4 files.
AC-4 cannot be converted to MP3.
""" },
{nameof(UseWidevine), """
Some audiobooks are only delivered in the highest

View File

@@ -178,12 +178,6 @@ namespace LibationWinForms.Dialogs
moveMoovAtomCbox.Enabled = convertLosslessRb.Checked;
lameOptionsGb.Enabled = !convertLosslessRb.Checked;
if (convertLossyRb.Checked && requestSpatialCbox.Checked)
{
// Only E-AC-3 can be converted to mp3
spatialAudioCodecCb.SelectedIndex = 0;
}
lameTargetRb_CheckedChanged(sender, e);
LameMatchSourceBRCbox_CheckedChanged(sender, e);
}
@@ -205,14 +199,6 @@ namespace LibationWinForms.Dialogs
}
}
private void spatialAudioCodecCb_SelectedIndexChanged(object sender, EventArgs e)
{
if (spatialAudioCodecCb.SelectedIndex == 1 && convertLossyRb.Checked)
{
// Only E-AC-3 can be converted to mp3
spatialAudioCodecCb.SelectedIndex = 0;
}
}
private void requestSpatialCbox_CheckedChanged(object sender, EventArgs e)
{
spatialAudioCodecCb.Enabled = requestSpatialCbox.Checked && useWidevineCbox.Checked;

View File

@@ -897,7 +897,6 @@
spatialAudioCodecCb.Name = "spatialAudioCodecCb";
spatialAudioCodecCb.Size = new System.Drawing.Size(173, 23);
spatialAudioCodecCb.TabIndex = 5;
spatialAudioCodecCb.SelectedIndexChanged += spatialAudioCodecCb_SelectedIndexChanged;
//
// moveMoovAtomCbox
//