1

I get this error message when I try to run the following script, or any script with import sounddevice at top. I installed sound device at cmd as admin with pip install sounddevice and I verified it is there with pip list

Assertion failed!

Program: C:\Program Files\Python37\python.exe
File: src/hostapi/wdmks/pa_win_wdmks.c, Line 1061

Expression: FALSE

Example program:

import sounddevice

sounddevice.get_portaudio_version()
input('enter to exit')

Another example prog (from 1):

import sounddevice as sd
import soundfile as sf

data, fs = sf.read('ImperialMarch60.wav')
sd.play(data, fs)
status = sd.wait()

update/Further clarification:

I've tried reinstalling sounddevice and python as well as using sounddevice 0.3.12 or python 3.8.3 instead. I only have 1 ver of python installed at a time. I've had Audacity for a long time and that works.

Downloaded a whl from https://www.lfd.uci.edu/~gohlke/pythonlibs/#sounddevice and ran pip install sounddevice-0.3.15-cp37-cp37m-win_amd64.whl which installed but produced the same "assertion failed" error. I didn't think this was related but I couldn't do pip install pyaudio bc it said Microsoft Visual C++ 14.0 is required even though I installed Visual Studio Build Tools 2019, so I downloaded the gohlke whl for pyaudio and suddenly sounddevice works... so this is somewhat resolved but I don't get it. Perhaps portaudio is not "automagically" included in sounddevice for Windows as the sounddevice documentation says2?

Update2: I uninstalled the sounddevice whl and reinstalled using pypl version using pip install sounddevice and now it works too...

rfii
  • 562
  • 3
  • 14
  • See [issue #7](https://github.com/spatialaudio/python-sounddevice/issues/7). – Matthias Jun 16 '20 at 17:47
  • I tried the methods in that thread which still seems unresolved itself and they also did not work for me. I edited my original post to include what I tried from that thread – rfii Jun 16 '20 at 18:35
  • Just to be sure, `pip install sounddevice-0.3.15-cp37-cp37m-win_amd64.whl` will not install the wheel unless the sounddevice is first uninstalled with `pip uninstall sounddevice` – cgohlke Jun 17 '20 at 03:28
  • I did uninstall first before trying the whl. BTW, thank you for the repository and all your work; critical enabler for me! – rfii Jun 17 '20 at 19:41

0 Answers0