PyAudio Not Listing Devices Even Though aplay -L and Audio Playback Work on i.MX8M Plus

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

PyAudio Not Listing Devices Even Though aplay -L and Audio Playback Work on i.MX8M Plus

1,730件の閲覧回数
mn063
Contributor I

Hi,

Context:
I have prepared an SD card boot setup for the i.MX8M Plus platform. My goal is to install PyAudio and run a real-time speech-to-text application using OpenAI's services.

While doing  this

when i try to record or play an audio using the commands

arecord -D sysdefault:CARD=wm8960audio -f cd -t wav -d 5 MJ_recorded.wav

aplay -D sysdefault:CARD=wm8960audio  MJ_recorded.wav

is working well

Below is the screenshot for sound devices listed using aplay 

mn063_0-1746707228036.png

 

while,

trying to get the sound devices list using pyaudio i got nothing

(Installation done by usng pip install pyaudio)


code i have used :

import pyaudio

p = pyaudio.PyAudio()

print("Available Audio Devices:")
for i in range(p.get_device_count()):
    info = p.get_device_info_by_index(i)
    print(f"Device {i}: {info['name']}")

 

the above code doesnt list anything...

Kindly give me some suggestions...

 

TIA

0 件の賞賛
返信
2 返答(返信)

1,684件の閲覧回数
mn063
Contributor I

Hi,

Thanks for the quick replay @JorgeCas 
1.  i have installed pyaudio by using the pip command --> pip3 install pyaudio
But..

mn063_2-1746772837442.png

 

2. While installing the pyaudio ,it is asking for the portaudio ,So i download the latest portaudio v19 from the link
https://files.portaudio.com/archives/pa_stable_v190700_20210406.tgz. and starts installing.

While running the comand ./configure 
i got the log 

mn063_0-1746772377509.png

3. The ALSA version in the board is 

mn063_1-1746772557288.png

How i will properly install the pyaudio ?
TIA

 

0 件の賞賛
返信

1,707件の閲覧回数
JorgeCas
NXP TechSupport
NXP TechSupport

Hello,

The PyAudio is not supported by default on our BSP. I suggest you confirm that have added the corresponding packages correctly to support this feature and contact software provider to troubleshoot this issue.

Best regards.

0 件の賞賛
返信