From 011606c5cf32b01573ba269d1ce99f0f26462842 Mon Sep 17 00:00:00 2001 From: kevin Date: Mon, 30 Nov 2020 10:13:59 -0500 Subject: [PATCH] rt_note_analysis.py : Change to support stereo signals. --- rt_note_analysis.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rt_note_analysis.py b/rt_note_analysis.py index 0feabac..900211a 100644 --- a/rt_note_analysis.py +++ b/rt_note_analysis.py @@ -30,10 +30,14 @@ class RT_Analyzer: if result: - sigV = result.value + # convert the audio signal vector to contain only the first (left) channel + if len(sigV.shape)>1: + sigV = sigV[:,0].squeeze() + anlArgs = types.SimpleNamespace(**anlArgD) + rmsDbV, rms_srate, binHz = audio_harm_rms( audioDev.srate, np.squeeze(sigV), anlArgs.rmsWndMs, anlArgs.rmsHopMs, anlArgs.dbLinRef, midi_pitch, anlArgs.harmCandN, anlArgs.harmN )