Skip to content

Commit

Permalink
del scipy
Browse files Browse the repository at this point in the history
  • Loading branch information
sudoskys authored and lss233 committed Apr 8, 2023
1 parent 03155b8 commit 8eb518b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
4 changes: 1 addition & 3 deletions event.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import numpy as np
# import librosa
# import numpy as np
import scipy
import soundfile as sf
import torch
from graiax import silkcoder
Expand Down Expand Up @@ -273,7 +272,6 @@ def encode_audio(self, audio, sample_rate, audio_type):
sample_rate = self.hps_ms_config.data.sampling_rate if not sample_rate else sample_rate
sample_rate = int(sample_rate)
sample_rate = 24000 if sample_rate < 0 else sample_rate
# 使用 scipy 将 Numpy 数据写入字节流
if audio_type == "ogg":
sf.write(_file, audio, sample_rate, format='ogg', subtype='vorbis')
elif audio_type == "wav":
Expand All @@ -289,7 +287,7 @@ def encode_audio(self, audio, sample_rate, audio_type):
_file = BytesIO(initial_bytes=silkcoder.encode(byte_io))
del byte_io
else:
scipy.io.wavfile.write(_file, sample_rate, audio)
sf.write(_file, audio, sample_rate, format='wav', subtype='PCM_24')
_file.seek(0)
return _file

Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ Cython>=0.29.21
numba
librosa
numpy
scipy
torch
unidecode
pyopenjtalk
Expand Down

0 comments on commit 8eb518b

Please sign in to comment.