bastibe / SoundCard

A Pure-Python Real-Time Audio Library
https://soundcard.readthedocs.io
BSD 3-Clause "New" or "Revised" License
689 stars 70 forks source link

TypeError(f'Invalid kind: {kind}' observed when importing soundcard #37

Closed vasudev2222 closed 5 years ago

vasudev2222 commented 5 years ago

I have installed python soundcard module and when importing soundcard I see the below error:

C:\Users\HP>pip install soundcard Requirement already satisfied: soundcard in c:\python27\lib\site-packages (0.1.2) Requirement already satisfied: numpy in c:\python27\lib\site-packages (from soundcard) (1.13.1+mkl) Requirement already satisfied: cffi in c:\python27\lib\site-packages (from soundcard) (1.11.5) Requirement already satisfied: pycparser in c:\python27\lib\site-packages (from cffi->soundcard) (2.18)

C:\Users\HP>python Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:24:40) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

import soundcard as sd Traceback (most recent call last): File "", line 1, in File "C:\Python27\lib\site-packages\soundcard__init__.py", line 8, in from soundcard.mediafoundation import * File "C:\Python27\lib\site-packages\soundcard\mediafoundation.py", line 196 raise TypeError(f'Invalid kind: {kind}') ^ SyntaxError: invalid syntax

Warniz commented 5 years ago

The project is written for python3, that's probably the reason for the syntax error. Try installing it with python3

bastibe commented 5 years ago

Exactly, SoundCard is Pyhon 3 only.