mirror of
https://github.com/2noise/ChatTTS.git
synced 2026-08-29 02:10:59 +08:00
chore(format): run black on dev (#560)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
40fbbc277a
commit
d089bd2492
@@ -31,6 +31,7 @@ def calculate_rms(data):
|
||||
logger.info("RM: %f", m)
|
||||
return np.sqrt(m)
|
||||
|
||||
|
||||
# 流式声音处理器
|
||||
class AudioStreamer:
|
||||
# 流式写入
|
||||
|
||||
+1
-1
@@ -6,6 +6,6 @@ from numba import jit
|
||||
|
||||
@jit
|
||||
def float_to_int16(audio: np.ndarray) -> np.ndarray:
|
||||
am = int(math.ceil(float(np.abs(audio).max()))*32768)
|
||||
am = int(math.ceil(float(np.abs(audio).max())) * 32768)
|
||||
am = 32767 * 32768 // am
|
||||
return np.multiply(audio, am).astype(np.int16)
|
||||
|
||||
Reference in New Issue
Block a user