diff options
| author | Matthias Geier <Matthias.Geier@gmail.com> | 2021-07-16 20:29:59 +0200 |
|---|---|---|
| committer | Matthias Geier <Matthias.Geier@gmail.com> | 2021-07-18 11:54:14 +0200 |
| commit | 817ff92ef997f22027999ddd2aa9f3d1cdcf16de (patch) | |
| tree | 72a505676375aff748a2b89b24156373e9b5f0e3 | |
| parent | bc07f8eecabe42fda0fe1219ce71f2e144c3c0ef (diff) | |
Show more meaningful error message if audio input has > 2 dimensions
| -rw-r--r-- | sounddevice.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sounddevice.py b/sounddevice.py index 3f34989..65ac26c 100644 --- a/sounddevice.py +++ b/sounddevice.py @@ -2461,6 +2461,9 @@ class _CallbackContext(object): data = np.asarray(data) if data.ndim < 2: data = data.reshape(-1, 1) + elif data.ndim > 2: + raise ValueError( + 'audio data to be played back must be one- or two-dimensional') frames, channels = data.shape dtype = _check_dtype(data.dtype) mapping_is_explicit = mapping is not None |
