OpenAL tutorial in C++ (without alut.h)
Why Stack Overflow recommends it
Stack Overflow users link it when asking about or answering OpenAL setup and WAV loading in C and C++, especially when alut.h is missing.
Recommended by 2 people across 2 different months, 2013 to 2018.
What it is
A short 2011 screencast showing how to set up OpenAL in C++ to play 3D positional sound without the alut.h helper library. It walks through a small example project and links code, the OpenAL downloads, the programmer's guide and two videos on loading WAVE files. It is a quick tutorial by an individual uploader.
What people said
Recommends user2081554 · 2013-09 · Stack Overflow · on “OpenAL/OpenAL Soft”
OpenAL.org && creative dev website is down. I choose alternative version OpenAL Soft [LINK] . I'm worried because in binary installation of OpenAL Soft I can't find the alut.h header. What is the purpose of the alut.h header? What change this header make if I had one? Oh and one more thing. I take a simple code from this (ZIP in description) tutorial [this video] and translate in C language. I actually get a sound but it's deformed. I wonder what is wrong with my code? #include <stdio.h> #include <stdlib.h> #include <windows.h> #include <OPENAL/al.h> #include <OPENAL/alc.h> int main(int argc, char *argv[]) { FILE *fp = NULL; fp=fopen("WAVE/Sound.wav","rb"); char type[4]; DWORD size,chunkSize; sho
Recommends user8620802 · 2018-11 · Stack Overflow · on “Playing a Frequency in OpenAL in C”
I eventually found a video on properly reading form a WAV file ( huge credit to this video [this video] ) and how a WAV file is formatted ( explained here in detail [LINK] ) and did some trial-and-error work until I figured out how to do it. I figured that if I could make a WAV-style file with the frequencies in them and set up the OpenAL buffer and source manually, it would work. I ran into some trouble when I found that the format differed from the first explanation of WAV file format [LINK] I found, as some apparently have additional meta-data [LINK] , which I had to test for and skip over when trying to load a WAV file. Then I made a WAV file containing the frequencies and played it, which wo
Cites A.Appel · 2018-05 · Stack Overflow · on “OpenAL not playing sound”
I had the same issue today and found this post on google. After two more hours of searching I finally got this working so let me answer this for future googlers. If OpenAL initializes but the generated buffers do not start at 1, then it is likely the device was not setup. Here is a handy tutorial I found that shows how to explicitly select a valid device instead of saying alcOpenDevice(NULL): [LINK] I used the list_audio_devices() function and got "OpenAL Soft" which I passed to alcOpenDevice() and I was able to generate buffers for sources and buffers. After I got OpenAL working I tried writing a parser and ran into more trouble. Let me help out anyone looking to do .wav parsing as well...