mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-10-13 07:25:54 -04:00
AudioSequenceFactory: fix mono streamed tracks not playing (#7291)
In WriteMonoSingleSeq, layerPlaceholderOff was recorded before WriteNoshort, causing a stray 0x00 byte to be emitted into the mono channel script. The 0x00 decoded as a delay of 0 ticks, which deferred the subsequent ldlayer byte by one tick and left channel->instrument unset when the layer first processed its note, producing no sound. Move layerPlaceholderOff to after WriteNoshort so the placeholder writes the correct address, matching WriteStereoSingleSeq. Fixes #7264
This commit is contained in:
@@ -201,8 +201,8 @@ static void WriteMonoSingleSeq(Ship::BinaryWriter* writer, uint16_t delay, uint8
|
||||
writer->Seek(channelStart, Ship::SeekOffsetType::Start);
|
||||
|
||||
// Channel header
|
||||
layerPlaceholderOff = static_cast<uint16_t>(writer->GetBaseAddress());
|
||||
WriteNoshort(writer);
|
||||
layerPlaceholderOff = static_cast<uint16_t>(writer->GetBaseAddress());
|
||||
WriteLdlayer(writer, 0, 0);
|
||||
WritePan(writer, 64);
|
||||
WriteVolCHeader(writer, 127); // Max volume
|
||||
|
||||
Reference in New Issue
Block a user