Skip to content

Commit

Permalink
Merge pull request #794 from AznamirWoW/split_audio_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
blaisewf authored Oct 8, 2024
2 parents dc447ee + 10709b7 commit 3e7ac4a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion rvc/lib/tools/split_audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ def merge_audio(audio_segments, intervals, sr_orig, sr_new):
"""
sr_ratio = sr_new / sr_orig if sr_new > sr_orig else 1.0

merged_audio = audio_segments[0]
merged_audio = np.zeros(
int(intervals[0][0] * sr_ratio if intervals[0][0] > 0 else 0),
dtype=audio_segments[0].dtype
)

merged_audio = np.concatenate((merged_audio, audio_segments[0]))

for i in range(1, len(intervals)):
silence_duration = int((intervals[i][0] - intervals[i - 1][1]) * sr_ratio)
Expand Down

0 comments on commit 3e7ac4a

Please sign in to comment.