mirror of
https://github.com/HiMeditator/auto-caption.git
synced 2026-02-04 12:24:42 +08:00
- 更新 GummyTranslator 类,优化字幕生成逻辑 - 移除 audioprcs 模块,音频处理功能转移到 utils 模块 - 重构 sysaudio 模块,提高音频流管理的灵活性和稳定性 - 修改 TODO.md,完成按时间降序排列字幕记录的功能 - 更新文档,说明因资源限制将不再维护英文和日文文档
19 lines
414 B
Python
19 lines
414 B
Python
import sys
|
|
import json
|
|
|
|
def stdout(text: str):
|
|
stdout_cmd("print", text)
|
|
|
|
def stdout_cmd(command: str, content = ""):
|
|
msg = { "command": command, "content": content }
|
|
sys.stdout.write(json.dumps(msg) + "\n")
|
|
sys.stdout.flush()
|
|
|
|
def stdout_obj(obj):
|
|
sys.stdout.write(json.dumps(obj) + "\n")
|
|
sys.stdout.flush()
|
|
|
|
def stderr(text: str):
|
|
sys.stderr.write(text + "\n")
|
|
sys.stderr.flush()
|