MCPcopy Create free account
hub / github.com/modelscope/FunASR / new_core

Method new_core

runtime/funasr_api/funasr_api.py:58–72  ·  view source on GitHub ↗
(self,msg_callback=None)

Source from the content-addressed store, hash-verified

56
57
58 def new_core(self,msg_callback=None):
59 try:
60 if self.funasr_core is not None:
61 self.funasr_core.close()
62
63 if msg_callback==None:
64 msg_callback=self.msg_callback
65 funasr_core=FunasrCore(self.uri,msg_callback=msg_callback,timeout=self.timeout)
66 funasr_core.new_connection()
67 self.funasr_core=funasr_core
68 return funasr_core
69
70 except Exception as e:
71 print("init_core",e)
72 exit(0)
73
74 # rec buffer, set ffmpeg_decode=True if audio is not PCM or WAV type
75 def rec_buf(self,audio_buf,ffmpeg_decode=False):

Callers 3

create_streamMethod · 0.95
rec_bufMethod · 0.95
rec_fileMethod · 0.95

Calls 3

new_connectionMethod · 0.95
FunasrCoreClass · 0.90
closeMethod · 0.45

Tested by

no test coverage detected