Skip to content

Commit

Permalink
early return in render
Browse files Browse the repository at this point in the history
  • Loading branch information
Yosshi999 committed Nov 17, 2024
1 parent ce545a9 commit 6d45309
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/voicevox_core/src/synthesizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,10 @@ mod inner {
end: usize,
) -> Result<Vec<u8>> {
// TODO: 44.1kHzなどの対応
if (start..end).is_empty() {
// 指定区間が空のときは早期リターン
return Ok(vec![]);
}
let spec_segment = crop_with_margin(audio, start..end);
let wave_with_margin = self
.render_audio_segment(spec_segment.to_owned(), audio.style_id)
Expand Down

0 comments on commit 6d45309

Please sign in to comment.