I was having trouble installing this because my project was running on older versions of python and Python-Dev toools on Ubuntu 24.04 lts.
I have done following steps to install this.
Check you python version.
run sudo apt-get update.
As my base python version was 3.10. So i have install sudo apt-get install python3.10-dev.
Then, try to install pip install pyaudio. it will install successfully.