Skip to content

Commit e8b57f2

Browse files
fixed formatting issues in device_info()
1 parent afe8cd4 commit e8b57f2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pya/helper/helpers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,14 @@ def _try_initializing_pyaudio(fun_name):
113113
def device_info(verbose=True):
114114
"""Return a formatted string about available audio devices and their info"""
115115
pa = _try_initializing_pyaudio("device_info")
116-
line1 = (f"idx {'Device Name':25}{'INP':4}{'OUT':4} SR INP-(Lo|Hi) OUT-(Lo/Hi) (Latency in ms)")
116+
line1 = f"idx {'Device Name':25}{'INP':4}{'OUT':4} SR INP-(Lo|Hi) OUT-(Lo/Hi) (Latency in ms)"
117117
devs = [pa.get_device_info_by_index(i) for i in range(pa.get_device_count())]
118118
lines = [line1]
119119
for i, d in enumerate(devs):
120120
p1 = f"{i:<4g}{d['name'].strip():24}{d['maxInputChannels']:4}{d['maxOutputChannels']:4}"
121121
p2 = f" {int(d['defaultSampleRate'])} "
122-
p3 = f"{d['defaultLowInputLatency']*1000:6.2g} {d['defaultHighInputLatency']*1000:6.0f}"
123-
p4 = f"{d['defaultLowOutputLatency']*1000:6.2g} {d['defaultHighOutputLatency']*1000:6.0f}"
122+
p3 = f"{d['defaultLowInputLatency'] * 1000:6.2g} {d['defaultHighInputLatency'] * 1000:6.0f}"
123+
p4 = f"{d['defaultLowOutputLatency'] * 1000:6.2g} {d['defaultHighOutputLatency'] * 1000:6.0f}"
124124
lines.append(p1 + p2 + p3 + p4)
125125
if verbose:
126126
print(*lines, sep="\n")

0 commit comments

Comments
 (0)