Hello, My name is Tamir Friedman, and I suggest to fix a bug in PlaySound in winsound library. It's doesn't support the SND_MEMORY feature because its accepts only "str" and rejects "bytes" type. therefore i include the fixed source file: OLD: ---------------------------------------------------------------------------- static PyObject * sound_playsound(PyObject *s, PyObject *args) { wchar_t *wsound; int flags; int ok; if (PyArg_ParseTuple(args, "Zi:PlaySound", &wsound, &flags)) { if (flags & SND_ASYNC && flags & SND_MEMORY) { /* Sidestep reference counting headache; unfortunately this also prevent SND_LOOP from memory. */ PyErr_SetString(PyExc_RuntimeError, "Cannot play asynchronously from memory"); return NULL; } Py_BEGIN_ALLOW_THREADS ok = PlaySoundW(wsound, NULL, flags); Py_END_ALLOW_THREADS if (!ok) { PyErr_SetString(PyExc_RuntimeError, "Failed to play sound"); return NULL; } Py_INCREF(Py_None); return Py_None; } return NULL; } ---------------------------------------------------------------------------- NEW: ---------------------------------------------------------------------------- static PyObject * sound_playsound(PyObject *s, PyObject *args) { wchar_t *wsound; int flags; int ok; if (PyArg_ParseTuple(args, "z*i:PlaySound", &wsound, &flags)) { if (flags & SND_ASYNC && flags & SND_MEMORY) { /* Sidestep reference counting headache; unfortunately this also prevent SND_LOOP from memory. */ PyErr_SetString(PyExc_RuntimeError, "Cannot play asynchronously from memory"); return NULL; } Py_BEGIN_ALLOW_THREADS ok = PlaySoundW(wsound, NULL, flags); Py_END_ALLOW_THREADS if (!ok) { PyErr_SetString(PyExc_RuntimeError, "Failed to play sound"); return NULL; } Py_INCREF(Py_None); return Py_None; } return NULL; } ----------------------------------------------------------------------------