#2451 Importing sound ranges of different format than head by converting to uncompressed wav

This commit is contained in:
Jindra Petřík
2025-06-07 23:03:59 +02:00
parent ac9ceffae2
commit 2a8cddc7f9
7 changed files with 222 additions and 129 deletions

View File

@@ -163,7 +163,6 @@ import com.jpexs.decompiler.flash.tags.base.PlaceObjectTypeTag;
import com.jpexs.decompiler.flash.tags.base.RenderContext;
import com.jpexs.decompiler.flash.tags.base.ShapeTag;
import com.jpexs.decompiler.flash.tags.base.SoundImportException;
import com.jpexs.decompiler.flash.tags.base.SoundParametersMismatchException;
import com.jpexs.decompiler.flash.tags.base.SoundStreamHeadTypeTag;
import com.jpexs.decompiler.flash.tags.base.SoundTag;
import com.jpexs.decompiler.flash.tags.base.TextImportErrorHandler;
@@ -3056,8 +3055,6 @@ public class CommandLineArgumentParser {
}
System.err.println("Import FAILED. Input file has unsupported sampling rate (" + usre.getSoundRate() + "). Supported rates for this sound format: " + String.join(", ", supportedRatesStr) + ".");
System.exit(2);
} catch (SoundParametersMismatchException ex) {
System.err.println("Import FAILED. Input file has different format that target stream. Target stream format: " + ex.getMessage());
}
if (!ok) {
System.err.println("Import FAILED. Maybe unsupported media type? Only MP3 and uncompressed WAV are available.");
@@ -3124,9 +3121,6 @@ public class CommandLineArgumentParser {
SoundImporter soundImporter = new SoundImporter();
try {
ok = soundImporter.importSound(st, new ByteArrayInputStream(data), soundFormat, startFrame);
} catch (SoundParametersMismatchException spm) {
System.err.println("Import FAILED. " + spm.getMessage());
System.exit(3);
} catch (UnsupportedSamplingRateException usre) {
List<String> supportedRatesStr = new ArrayList<>();
for (int i : usre.getSupportedRates()) {