The G3N engine audio support currently depends on the following external libraries:
OpenAL
- for spatial audiolibogg
- for Ogg container formatlibvorbis
- for vorbis decoder supportlibvorbisfile
- for reading/decoding ogg vorbis files
These libraries are easily installed in Linux systems using the distribution package manager.
For Windows you can build these libraries from sources using the following procedure or if you are a trusting person you can simply use the dlls in this directory which were built using this procedure (we used Microsoft Studio 14 2015).
In any case it is recommended that you copy these dlls to the directory from which will run your application and avoid copying them to the Windows system directory.
You may also need to download the Microsoft Visual C++ 2015 Redistributable or Microsoft Visual C++ 2017 Redistributable.
-
Download and install Microsoft Studio Community from https://www.visualstudio.com/downloads/. Under the Workloads tab, select Desktop development with C++. We are assuming here that Microsoft Studio 2017 will be used. If you are using the previous version of Microsoft Studio replace Microsoft Studio 15 2017 by Microsoft Studio 14 2015 in the CMake command line in item 5.
-
Download and install CMake from https://cmake.org/download/.
-
Download OpenAL soft from http://kcat.strangesoft.net/openal-releases/openal-soft-1.17.2.tar.bz2 and decompress it in a folder. You may need a tool to decompress the file such as http://www.7zip.org. Alternatively you can clone the git respository: https://github.com/kcat/openal-soft and checkout the latest tagged release:
>git checkout tags/openal-soft-1.17.2
-
Execute the Developer Command Prompt for VS 2017 (or the equivalent for the 2015 version) installed by Microsoft Visual Studio. It is a command prompt window with environment variables correctly initialized to use the MS compiler and tools.
-
In the command prompt navigate to the build directory inside the OpenAL directory. Then execute one the of following commands depending on your platform architecture.
>cmake -G "Visual Studio 15 2017 Win64" .. # To build 64 bit dll OR` >cmake -G "Visual Studio 15 2017" .. # To build 32 bit dll`
It is important to check in the messages generated by CMake that OpenAL will be built with support for DirectSound. If everything is OK, a file named
OpenAL.sln
should have been generated in this directory (along with many others). -
Execute Visual Studio and from its menu select Open -> Project/Solution.... Select the file
OpenAL.sln
generated previously by CMake. In the Visual Studio toolbar, below the menu, select the build mode Release. Also in the toolbar select the desired architecture: x64 or Win32. Then select Build -> Build Solution in the menu to start the build. Once the build is complete the fileOpenAL.dll
should have been generated in the directorybuild/Release
. -
Download libogg and libvorbis from https://xiph.org/downloads/. We used these versions:
-
Extract both files inside the same directory and rename the two directories to remove the version suffix:
rename libogg-1.3.2 libogg rename libvorbis-1.3.5 libvorbis
It is important for the root directory of both libraries to be in the same directory:
+ parent_directory + libogg + doc + include ... + libvorbis + doc + include ...
libvorbis depends on libogg and its build system assumes this directory configuration.
-
Execute Visual Studio and from its menu select Open -> Project/Solution.... Select the file
libogg\win32\VS2010\libogg_dynamic.sln
. In the Visual Studio toolbar, below the menu, select the build mode Release. Also in the toolbar select the desired architecture: x64 or Win32. Then select the menu Build -> Build Solution to start the build. If during the build Visual Studio indicates an error related to the installed platform toolset you may need to retarget the solution, selecting the menu Project -> Retarget solution" and then try to build again. If everything goes OK thenlibogg.dll
should be in the directory:libogg\win32\VS2010\x64\Release
for 64 bits orlibogg\win32\VS2010\Win32\Release
for 32 bits. -
Execute Visual Studio and from its menu select Open -> Project/Solution.... Select the file
libvorbis\win32\VS2010\vorbis_dynamic.sln
. In the Visual Studio toolbar, below the menu, select the build mode Release. Also in the toolbar select the desired architecture: x64 or Win32. Then select the menu Build -> Build Solution to start the build. If during the build Visual Studio indicates an error related to the installed platform toolset you may need to retarget the solution, selecting the menu Project -> Retarget solution" and then try the build again. If everything goes OK, thenlibvorbis.dll
andlibvorbisfile.dll
should be in the directory:libvorbis\win32\VS2010\x64\Release
for 64 bits orlibvorbis\win32\VS2010\Win32\Release
for 32 bits. -
Copy the dlls:
OpenAL32.dll, libogg.dll, libvorbis.dll
andlibvorbisfile.dll
to the directory from which you will execute a G3N application.