bastibe / SoundCard

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

macOS recording error #64

Closed jaylmiller closed 4 years ago

jaylmiller commented 5 years ago

Just trying out the lib and getting an error immediately upon trying to record. error during recording: -10863

Here's my code

import soundcard as sc

default_mic = sc.default_microphone()
with default_mic.recorder(48000, channels=[0]) as mic:
    data = mic.record(1024)
    print(data)

Here's the stack trace:

Traceback (most recent call last):
  File "main.py", line 5, in <module>
    data = mic.record(1024)
  File "/usr/local/lib/python3.7/site-packages/soundcard/coreaudio.py", line 877, in record
    data = numpy.concatenate(blocks, axis=0)
ValueError: all the input arrays must have same number of dimensions

I'm on macOS 10.14.3 and running Python 3.7.4. Any suggestions?

jaylmiller commented 5 years ago

Btw, setting samplerate to 44100 seemed to alleviate this issue on my machine.

bastibe commented 5 years ago

Sorry for the late response, I was on vacation.

Are you running the very latest version? I thought I fixed this error in May.