Is it possible to make a sound using only standard c++ libraries?

May 1, 2015 at 3:15am
It seems like libraries such as PortAudio and STK doesn't support MinGW for Windows. So I was wondering if C++ standard libraries support audio programming. I know that Python supports audio input/output and generating actual waveforms...

if not, is there's some audio libraries that supports MinGW(Windows not Linux)?
May 1, 2015 at 3:37am
I use MinGW with PortAudio :)
May 1, 2015 at 3:43am
Are you using Windows? if so, where do I find the dll file? i'm getting undefined reference errors...
May 1, 2015 at 3:27pm
Make sure you include the .a library file, I am on windows, and use the static version without dlls.

I built the library from source and you can too - just use msys.bat in your mingw bin folder to build it (basically configure --disable-shared then make) and it will make the .a library to include in your project build options.
Last edited on May 1, 2015 at 3:28pm
May 1, 2015 at 8:49pm
I'm sorry but I still don't get it. I have MSYS.bat inside msys folder and I typed configure --disable-shared and it gives me "./configure: no such file or directory"

Do I have to use this in my PortAudio folder? (sorry for the newb question)
May 1, 2015 at 10:04pm
Oh sorry, I'll give you more of an explanation:

PortAudio is an open source library, so we have the option to compile the code ourselves, to do that you'll need the source, not just the binary distribution.

http://www.portaudio.com/archives/pa_stable_v19_20140130.tgz

here's the latest source as of today (May 1, 2015)

Once you have the source untarred (unzipped) you need to open your command line and go directly to the folder's base directory (make sure you see a file called "configure" in your dir listing). In the base directory you'll want to type configure (for most libraries if you want to do a static build you'll --enable-static and --disable-shared, but I just checked and it didn't seem to affect my portaudio configure) once that is complete, in the same command line window type make.

Make will actually compile the code using the makefile that was configured with out configure command. Makefiles are black magic, look it up- you can do some cool stuff. They are ... kinda standardized, but mostly not standardized at all, for portaudio you'll find libportaudio.a inside the lib\.libs\ folder.

Inside code::blocks, go to the project menu > build options > (choose your project name on the left pane, not debug or release) > linker settings > add > (choose libportaudio.a)

Once that's done you maaaay need to include libwinmm.a from the lib directory of your mingw installation folder.

Next add the "include" folder in your portaudio folder to your search directory under the compiler tab (this is project > build options > search directories > compiler > add > (portaudio\include folder))

Then you should be able to use portaudio without any issues. They have some pretty good tutorials, once the library is set up you should be able to include the header file and be on with your life.
Last edited on May 1, 2015 at 10:05pm
May 1, 2015 at 10:35pm
Thanks!!! it worked. I guess I have to study more about how libraries work :)
May 1, 2015 at 11:46pm
Glad to hear it! For how important libraries are it is quite interesting how difficult it is to find reliable documentation on how to use them.
Topic archived. No new replies allowed.