MCPcopy Create free account
hub / github.com/modelscope/modelscope / encode_pcm_to_base64

Function encode_pcm_to_base64

modelscope/utils/service_utils.py:107–112  ·  view source on GitHub ↗
(bytes_data)

Source from the content-addressed store, hash-verified

105
106
107def encode_pcm_to_base64(bytes_data):
108 from scipy.io.wavfile import write
109 with BytesIO() as out_mem_file:
110 write(out_mem_file, 16000, bytes_data)
111 base64_str = str(base64.b64encode(out_mem_file.getvalue()), 'utf-8')
112 return 'data:audio/pcm;base64,' + base64_str
113
114
115def encode_url_to_base64(url):

Callers 1

service_data_encoderFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…