Skip to content

Commit

Permalink
Fix interaction between pad_start, trim_start, and loop
Browse files Browse the repository at this point in the history
  • Loading branch information
qwertymodo committed Apr 20, 2024
1 parent 0b1a624 commit 0336543
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion msupcm++/AudioBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,8 @@ void AudioBase::render()
sox->normalize(m_normalization);
sox->fade(m_fade_in, m_fade_out);
sox->tempo(m_tempo);
sox->loop(m_trim_start + m_start_offset, m_loop);
sox->pad(m_pad_start, m_pad_end);
sox->loop(m_trim_start + m_start_offset, m_loop + m_pad_start);
sox->dither(m_dither_type);
sox->finalize();
}
Expand Down
2 changes: 1 addition & 1 deletion msupcm++/AudioSubChannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ void AudioSubChannel::render()
sox->normalize(m_normalization);
sox->fade(m_fade_in, m_fade_out);
sox->tempo(m_tempo);
sox->loop(m_trim_start + m_start_offset, m_loop);
sox->pad(m_pad_start, m_pad_end);
sox->loop(m_trim_start + m_start_offset, m_loop + m_pad_start);
sox->dither(m_dither_type);
sox->finalize();
}
Expand Down
2 changes: 1 addition & 1 deletion msupcm++/AudioSubTrack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ void AudioSubTrack::render()
sox->normalize(m_normalization);
sox->fade(m_fade_in, m_fade_out);
sox->tempo(m_tempo);
sox->loop(m_trim_start + m_start_offset, m_loop);
sox->pad(m_pad_start, m_pad_end);
sox->loop(m_trim_start + m_start_offset, m_loop + m_pad_start);
sox->dither(m_dither_type);
sox->finalize();
}
Expand Down
3 changes: 3 additions & 0 deletions msupcm++/SoxWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ bool SoxWrapper::pad(size_t start, size_t end)
delete[] args[0];
delete[] args[1];

if (m_loop)
m_loop += start;

return ret;
}

Expand Down

0 comments on commit 0336543

Please sign in to comment.