0

I recently downloaded a PortAudio archive from the portaudio.com downloads section. I even took the initiative of running ./configure, make, and make install as instructed on the PortAudio website in my portaudio folder (FYI, I both downloaded and extracted the archive in my downloads folder).

I could not find any explicit information online on how to use PortAudio; My first unguided attempt was to compile this program (saved as portaudio.cpp):

#include <portaudio.h>
int main() {
    return 0;
}

I received this error:

C:\Users\PrivacyMatters\C++ Projects\portaudio>g++ portaudio.cpp -o portaudio.exe
portaudio.cpp:1:23: fatal error: portaudio.h: No such file or directory
 #include <portaudio.h>
                       ^
compilation terminated.

My end goal is to build a program that plays music files - whether they be .wav, .mp3 or whatever - through my headphone's mic so I can play music in counter-strike 1.6; I have tried programs like VB-Cable but I was a bit impatient and couldn't get that to work and thought that this would be a fun project anyway. I chose C++ because a) I'm trying to learn it and b) because I've been told it runs faster than python; something I am willing to sacrifice if push comes to shove.

Have a nice day, and my apologies for the headaches I'm probably inducing.

P.S. I wouldn't mind any helpful resources for actually programming with PortAudio once I've solved this issue ;)

  • if all you want is to select audio output device for your music or videos, you can do that using already written apps like vlc – Gurhan Polat Jan 15 '21 at 09:49
  • 1
    have you tried to add your build/include(or idk exact path to your header) as include directory? Try add omething like [-I/path/to/your/build/include](https://stackoverflow.com/questions/12654013/how-to-make-g-search-for-header-files-in-a-specific-directory/12654056) flag when compiling your code – Deumaudit Jan 15 '21 at 14:46
  • @Богдан Хмельницький That worked, thanks! – marksmansnakeeyes Jan 15 '21 at 17:49
  • @GurhanPolat I could do that, but that's no fun and I don't have complete control over those apps. – marksmansnakeeyes Jan 15 '21 at 18:14

0 Answers0