(bytes_data)
| 105 | |
| 106 | |
| 107 | def 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 | |
| 115 | def encode_url_to_base64(url): |
no outgoing calls
no test coverage detected
searching dependent graphs…