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:
github-actions[bot]
2024-07-10 16:53:29 +09:00
committed by GitHub
parent 40fbbc277a
commit d089bd2492
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -31,6 +31,7 @@ def calculate_rms(data):
logger.info("RM: %f", m)
return np.sqrt(m)
# 流式声音处理器
class AudioStreamer:
# 流式写入
+1 -1
View File
@@ -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)