Skip to content

Instantly share code, notes, and snippets.

View foowaa's full-sized avatar
:octocat:
thinking

Chunlin TIAN foowaa

:octocat:
thinking
View GitHub Profile
@dangom
dangom / matlab_engine_python_3_6.org
Last active May 21, 2020 14:32
Installing matlab-engine on python 3.6

How to install Matlab Engine on Python 3.6

Preparation

If you’ve tried recently to install matlab engine on a Python 3.6, you’ve seen a message saying that the platform is not supported. That doesn’t make any sense, since Python 3.5 is supported, right?

The problem is that Mathworks hardcodes a list with valid versions, I guess to reduce pressure on their customer service in case something goes wrong with untested versions. Well, that doesn’t mean that we shouldn’t be allowed to try it anyway, right?

@hadware
hadware / bytes_to_wav.py
Last active April 26, 2024 10:50
Convert wav in bytes for to numpy ndarray, then back to bytes
from scipy.io.wavfile import read, write
import io
## This may look a bit intricate/useless, considering the fact that scipy's read() and write() function already return a
## numpy ndarray, but the BytesIO "hack" may be useful in case you get the wav not through a file, but trough some websocket or
## HTTP Post request. This should obviously work with any other sound format, as long as you have the proper decoding function
with open("input_wav.wav", "rb") as wavfile:
input_wav = wavfile.read()