Quantcast
Viewing all articles
Browse latest Browse all 4921

Beginners • Re: pyaudio doesnt like 16000 sampling rate

I was curious what device pyaudio was choosing, ran this script to tell me all of the devices pyaudio recognised and then which it was assigning as the default.

Code:

import pyaudiop = pyaudio.PyAudio()for i in range(p.get_device_count()):    info = p.get_device_info_by_index(i)    print(info['index'], info['name'], info['maxInputChannels'])# Get the default input device indexdefault_device_index = p.get_default_input_device_info()['index']print(f"\nDefault Input Device ID: {default_device_index}")# Print the default device informationprint("Default Input Device Info:")default_device_info = p.get_device_info_by_index(default_device_index)for key, value in default_device_info.items():    print(f"{key}: {value}")p.terminate()
the results of this script were....

Code:

0 vc4-hdmi-0: MAI PCM i2s-hifi-0 (hw:0,0) 01 USB PnP Sound Device: Audio (hw:2,0) 12 sysdefault 03 hdmi 04 pulse 325 default 32Default Input Device ID: 5Default Input Device Info:index: 5structVersion: 2name: defaulthostApi: 0maxInputChannels: 32maxOutputChannels: 32defaultLowInputLatency: 0.008684807256235827defaultLowOutputLatency: 0.008684807256235827defaultHighInputLatency: 0.034807256235827665defaultHighOutputLatency: 0.034807256235827665defaultSampleRate: 44100.0
so it is choosing device 5 but what is default 32?
again when i use arecord -l it only shows my USB mic. and when I disconnect the USB microphone and record again, there is no audio but still picks default 32.

Statistics: Posted by SmagicSman — Thu Mar 07, 2024 8:41 pm



Viewing all articles
Browse latest Browse all 4921

Trending Articles