RUVIDEO
Поделитесь видео 🙏

How to setup and use OpenAL for game audio in C++ (Using Visual Studio) tutorial

After watching this, if you're interested in seeing how I put together a simple audio system using OpenAL, then check out https://www.youtube.com/watch?v=5QT2veNjv80&feature=youtu.be

0:00 Start
0:30 Disclaimer and setting expectations
0:49 OpenAL Soft information
1:11 What is CMake
1:26 Getting OpenAL Soft
2:00 Generating OpenAL Soft project files with CMake
2:12 Building OpenAL with visual studio
2:51 Creating and setting up an OpenAL game test project (includes, libraries, dlls, etc)
3:00 Creating folders for OpenAL library and moving files
4:13 Configuring project include and linker settings
4:23 Set up includes
5:09 Set up library directory location
5:41 Set up linker
5:55 OpenAL set up is complete, testing include
6:07 What is OpenAL and how to load audio files
6:17 Setting up AudioFile (GPL) file loading library (I suggest using dr_lib instead, see end of video but this part should be watched to help understand what dr_lib is doing)
7:00 An example .wav sound to load
7:30 Fixing Audio file warnings
7:56 What is PCM data and how do I get it from a file?
8:29 Extracting PCM data by modifying AudioFile library
8:51 -- Begin OpenAL Code --
8:58 OpenAL error checking
9:15 getting OpenAL device and setting up context on the device
10:03 Setting up the Listener
11:03 mono vs stereo files for OpenAL buffers
11:24 load an audio file with AudioFile.h
11:34 load sound pcm data into OpenAL buffer
12:29 configuring an OpenAL audio source
13:22 playing a sound source and waiting for it to finish
13:48 cleaning up resources
14:14 testing 3D positioning
14:37 getting the project from the video
15:25 getting dr_lib (dr_wav) - a free audio file loading library that is public domain (less restrictive than gpl)
16:10 dr_wav file loading
17:06 using dr_wav loaded data with OpenAL

_____________________________________________________________________________________________
Twitter: https://twitter.com/mattstone2728
Instagram: https://www.instagram.com/mattstone2728/
_____________________________________________________________________________________________
My repository with the sample code:
https://github.com/mattstone22133/OpenAL_TestProject

An awesome paper talking about playing audio in OpenAL
https://research.ncl.ac.uk/game/mastersdegree/workshops/audio/Sound%20Workshop.pdf

OpenSoft github
https://github.com/kcat/openal-soft

Dr Wav (better audio library for loading audio files)
https://github.com/mackron/dr_libs/blob/master/dr_wav.h

Looks like there is also a dr_mp3 for converting mp3s, but I HAVE NOT TESTED IT.
https://github.com/mackron/dr_libs/blob/master/dr_mp3.h
_____________________________________________________________________________________________
AudioFile for loading audio files; this is a GPL license which I believe means you need to make your game open source; best to use dr_wav instead but since I used this in the beginning of the video (dr_wav at the end) here is a link.
https://github.com/adamstark/AudioFile

Complete guide to OpenAL
https://indiegamedev.net/2020/02/15/the-complete-guide-to-openal-with-c-part-1-playing-a-sound/

Some more OpenAL examples
https://ffainelli.github.io/openal-example/
https://github.com/ffainelli/openal-example/blob/master/openal-example.c
_____________________________________________________________________________________________
How is the time dilation swoosh done at the beginning of the video?

I have a global pitch multiplier that gets applied to all sources. I influence this global pitch by the current time dilation factor. Consider this code:

```
float AudioSystem::calculatePitch(float rawPitch)
{
return rawPitch * cachedTimeDilation;
}
```
then called like
```
//md is audio meta data I store
if (md.dirtyFlags.bPitch || bDirtyAllPitch)
{
float pitch = calculatePitch(ud.pitch + md.calculatedPitchVariation);
alec(alSourcef(src, AL_PITCH, pitch));
md.dirtyFlags.bPosition = false;
}
```
_____________________________________________________________________________________________

disclaimer: for my employment status please check my twitter information or youtube channel information. This content is not in any way associated with my employer and opinions are my own.

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «How to setup and use OpenAL for game audio in C++ (Using Visual Studio) tutorial», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.