diff --git a/.github/workflows/pya-ci.yaml b/.github/workflows/pya-ci.yaml index 2900e72..db56907 100644 --- a/.github/workflows/pya-ci.yaml +++ b/.github/workflows/pya-ci.yaml @@ -17,7 +17,7 @@ jobs: strategy: matrix: os: ["ubuntu-latest", "macos-latest"] - python-version: ["3.8", "3.9", "3.10"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v3 - name: Install portaudio Ubuntu diff --git a/pya/helper/helpers.py b/pya/helper/helpers.py index 1423954..ca18272 100644 --- a/pya/helper/helpers.py +++ b/pya/helper/helpers.py @@ -117,10 +117,10 @@ def device_info(): devs = [pa.get_device_info_by_index(i) for i in range(pa.get_device_count())] lines = [line1] for i, d in enumerate(devs): - p1 = f"{i:<4g}{d['name'].strip():24}{d['maxInputChannels']:4}{d['maxOutputChannels']:4}" - p2 = f" {int(d['defaultSampleRate'])} " - p3 = f"{d['defaultLowInputLatency']*1000:6.2g} {d['defaultHighInputLatency']*1000:6.0f}" - p4 = f"{d['defaultLowOutputLatency']*1000:6.2g} {d['defaultHighOutputLatency']*1000:6.0f}" + p1 = f"{i:<4g}{d['name'].strip():24}{d['maxinputchannels']:4}{d['maxoutputchannels']:4}" + p2 = f" {int(d['defaultsamplerate'])} " + p3 = f"{d['defaultLowInputLatency'] * 1000:6.2g} {d['defaultHighInputLatency'] * 1000:6.0f}" + p4 = f"{d['defaultLowOutputLatency'] * 1000:6.2g} {d['defaultHighOutputLatency'] * 1000:6.0f}" lines.append(p1 + p2 + p3 + p4) print(*lines, sep='\n') return devs diff --git a/tests/helpers.py b/tests/helpers.py index eea4a18..73786f5 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -15,6 +15,7 @@ def wait(condition: Callable[[], bool], seconds: float = 10, interval: float = 0 def check_for_input() -> bool: with contextlib.suppress(ImportError, OSError): import pyaudio + pyaudio.PyAudio().get_default_input_device_info() return True return False @@ -23,6 +24,7 @@ def check_for_input() -> bool: def check_for_output() -> bool: with contextlib.suppress(ImportError, OSError): import pyaudio + pyaudio.PyAudio().get_default_output_device_info() return True return False