mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-26 03:21:02 +00:00
Fixed #2153 FLA Export - sound streams were limited to first stream block
This commit is contained in:
@@ -149,6 +149,9 @@ public class SoundStreamHead2Tag extends SoundStreamHeadTypeTag {
|
||||
@Override
|
||||
public SoundExportFormat getExportFormat() {
|
||||
if (streamSoundCompression == SoundFormat.FORMAT_MP3) {
|
||||
if (getInitialLatency() > 0) {
|
||||
return SoundExportFormat.WAV;
|
||||
}
|
||||
return SoundExportFormat.MP3;
|
||||
}
|
||||
if (streamSoundCompression == SoundFormat.FORMAT_ADPCM) {
|
||||
@@ -293,6 +296,6 @@ public class SoundStreamHead2Tag extends SoundStreamHeadTypeTag {
|
||||
|
||||
@Override
|
||||
public int getInitialLatency() {
|
||||
return 0;
|
||||
return latencySeek;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,8 +147,11 @@ public class SoundStreamHeadTag extends SoundStreamHeadTypeTag {
|
||||
}
|
||||
|
||||
@Override
|
||||
public SoundExportFormat getExportFormat() {
|
||||
public SoundExportFormat getExportFormat() {
|
||||
if (streamSoundCompression == SoundFormat.FORMAT_MP3) {
|
||||
if (getInitialLatency() > 0) {
|
||||
return SoundExportFormat.WAV;
|
||||
}
|
||||
return SoundExportFormat.MP3;
|
||||
}
|
||||
if (streamSoundCompression == SoundFormat.FORMAT_ADPCM) {
|
||||
@@ -302,6 +305,6 @@ public class SoundStreamHeadTag extends SoundStreamHeadTypeTag {
|
||||
|
||||
@Override
|
||||
public int getInitialLatency() {
|
||||
return 0;
|
||||
return latencySeek;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1977,7 +1977,7 @@ public class XFLConverter {
|
||||
soundRate = head.getSoundRate();
|
||||
soundType = head.getSoundType();
|
||||
soundSize = head.getSoundSize();
|
||||
soundSampleCount = head.getSoundSampleCount();
|
||||
soundSampleCount = 0; //head.getSoundSampleCount();
|
||||
boolean found = false;
|
||||
for (Tag t : tags) {
|
||||
if (found && (t instanceof SoundStreamBlockTag)) {
|
||||
@@ -2105,16 +2105,22 @@ public class XFLConverter {
|
||||
logger.log(Level.SEVERE, null, ex);
|
||||
}
|
||||
|
||||
byte[] decodedData = null;
|
||||
try {
|
||||
decodedData = st.getSoundFormat().decode(null, st.getRawSoundData(), seekSamples);
|
||||
if (soundSampleCount == 0) {
|
||||
soundSampleCount = decodedData.length / (2 * (st.getSoundType() ? 2 : 1));
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
logger.log(Level.SEVERE, null, ex);
|
||||
}
|
||||
|
||||
|
||||
String datFileName = null;
|
||||
if (seekSamples > 0) {
|
||||
if (seekSamples > 0 && decodedData != null) {
|
||||
long ts = getTimestamp(swf);
|
||||
datFileName = "M " + (datfiles.size() + 1) + " " + ts + ".dat";
|
||||
try {
|
||||
byte[] decodedData = st.getSoundFormat().decode(null, st.getRawSoundData(), seekSamples);
|
||||
datfiles.put(datFileName, decodedData);
|
||||
} catch (IOException ex) {
|
||||
logger.log(Level.SEVERE, null, ex);
|
||||
}
|
||||
datfiles.put(datFileName, decodedData);
|
||||
}
|
||||
|
||||
String symbolFile = symbol.getFlaExportName() + "." + exportFormat;
|
||||
|
||||
Reference in New Issue
Block a user