mirror of
https://github.com/TriM-Organization/Musicreater.git
synced 2026-04-21 00:36:03 +00:00
websocket播放支持
This commit is contained in:
20
example_websocket.py
Normal file
20
example_websocket.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import Musicreater
|
||||
import Musicreater.plugin
|
||||
import Musicreater.plugin.websocket
|
||||
|
||||
import os
|
||||
|
||||
dire = input("midi目录:")
|
||||
|
||||
print(
|
||||
Musicreater.plugin.websocket.to_websocket_server(
|
||||
[
|
||||
Musicreater.MidiConvert.from_midi_file(
|
||||
os.path.join(dire,names), old_exe_format=False
|
||||
) for names in os.listdir(dire,) if names.endswith((".mid",".midi"))
|
||||
],
|
||||
input("服务器地址:"),
|
||||
int(input("服务器端口:")),
|
||||
Musicreater.DEFAULT_PROGRESSBAR_STYLE,
|
||||
)
|
||||
)
|
||||
Reference in New Issue
Block a user