OpenAL Tutorial pt.1 | Init and Play Sound Effects

Sdílet
Vložit
  • čas přidán 14. 06. 2024
  • Thanks for checking out a video on Code, Tech, and Tutorials.
    OpenAL Playlist: • OpenAL Tutorial pt.1 |...
    Source Code: github.com/codetechandtutoria...
    REFERENCES
    -----------------------------------------------------------
    openal: openal.org/
    openal-soft github: github.com/kcat/openal-soft
    openal pdf doc: www.openal.org/documentation/...
    indiegamedev guide: indiegamedev.net/2020/02/15/t...
    thinmatrix guide: • OpenAL 3D Audio Tutori...
    vcpkg: github.com/microsoft/vcpkg
    my vcpkg guide: • VCPKG TUTORIAL | Easy ...
    visual studio community: visualstudio.microsoft.com/vs...
    -----------------------------------------------------------
    TIMESTAMPS
    --------------------
    0:00 - intro
    0:11 - expectations
    0:58- resource references
    3:54 - visual studio and vcpkg
    6:01 - init visual studio project
    7:15 - SoundDevice class code
    8:16 - SoundDevice class code explained
    9:32 - SoundBuffer class code
    10:35 - SoundBuffer class code explained
    14:41 - Load a sound
    17:02 - SoundSource class code
    18:12 - SoundSource class code explained
    22:20 - Testing final results
    23:10 - outro
    --------------------
    Help this channel on Patreon: / codetechtuts
    Business inquiries: codetechtuts@gmail.com
  • Věda a technologie

Komentáře • 26

  • @rocknry523
    @rocknry523 Před 3 lety +10

    Thanks for the walkthrough, Gilfoyle! Glad to see you landed on your feet after the collapse of Pied Piper.

  • @GetIntoGameDev
    @GetIntoGameDev Před 2 lety +5

    Thanks for the video, it was super helpful! I'm working on a game and left the audio to last because "audio's easier than graphics". Just a note, I'm sure this is mentioned in future videos but I had fun with it: if multiple sounds are played at once within a game loop with the same sound source, then race conditions seem to be messing with the sound selection. The ideal solution is probably semaphores or something, but ain't nobody got time for that, so I created a sound source for each different sound (within reason).

  • @0ia
    @0ia Před rokem +1

    Thank you! Appreciate this clarification, got it working in my project immediately :)

  • @deadmarshal
    @deadmarshal Před 3 lety +1

    Great video!

  • @NonTwinBrothers
    @NonTwinBrothers Před rokem +1

    glad I'm from the FUTURE™
    I read the indiegamedev article, and now I so wanna rewrite the code to use Concepts instead of the ugly enable_if clauses
    I'll be sure to give it a try

  • @Labadabadubdub
    @Labadabadubdub Před 3 lety

    Thanks a lot!

  • @TiramisuCorleone
    @TiramisuCorleone Před 2 lety

    When I try to use this as a dll module for Lua, then sf_open in SoundBuffer::addSoundEffect does not work properly.
    Any ideas?

  • @user-os9ik2jp2c
    @user-os9ik2jp2c Před rokem +1

    Hello I’m studying openAL for C++
    if I using multi soundDevice how to init device?

  • @gx0408
    @gx0408 Před 2 lety +1

    Hi my friend,
    I notice that the sound will lost after plugging/unplugging headphone.
    It may be fine after having OpenAL upgraded to the latest version( openal32.dll + wrap_oal.dll ). But my tests confirmed that OpenAL did not fix the problem for all hardwares, particularly audio adapter jack headphone.
    would you mind to take a look at this issue, and give your idea, please?
    Regards,

    • @lysy-zn2gg
      @lysy-zn2gg Před 6 měsíci

      I noticed it is a pretty common issue in older games. Unless OpenAL didn't provided some way to detect if device was somewhat changed I think it isn't possible to fix. If there is a callback or some flag that is changed or something else then I think you would need to reinitiailize entire OpenAL device, context etc.

  • @snnoo14
    @snnoo14 Před 2 lety +1

    Does this also work on Linux Ubuntu ?
    I cant find a way to make sounds on Linux and only getting OpenAL suggestions but no one is showing how to use at Linux CPP

    • @CodeTechandTutorials
      @CodeTechandTutorials  Před 2 lety +1

      should work - you'll need this `sudo apt-get install libopenal-dev`
      optionally there is sdl2_mixer, fmod, and probably more. I haven't used them all.

  • @Conqueran
    @Conqueran Před 2 lety

    I am using Ubuntu 20.04 and entered the code of the first part of the tutorial with the Sound Device class. When I run the program I get
    [ALSOFT] (WW) Failed to open playback device: Could not open /dev/dsp: No such file or directory
    [ALSOFT] (WW) Error generated on device (nil), code 0xa004
    terminate called after throwing an instance of 'char const*'
    Aborted (core dumped)
    Any idea why this is happening?

    • @simonmaracine4721
      @simonmaracine4721 Před rokem +1

      Make sure that OpenAL Soft can find an audio backend like, for example, PulseAudio.

  • @northernresistance_
    @northernresistance_ Před 3 lety +2

    It installed by me automatically. Will anything bad happen when i uninstall it?

    • @5taEspadaDR
      @5taEspadaDR Před 2 měsíci

      It is now 3 years years 2024, and I find myself asking this same question. How the heck did it got in my system? Can I remove it? What would happen if I do?

    • @northernresistance_
      @northernresistance_ Před 2 měsíci

      @@5taEspadaDRHey, I uninstalled it and I believe nothing happened

  • @luvtv7433
    @luvtv7433 Před 2 lety

    I actually thought you meant effects like reverb, chorus or distortion

    • @CodeTechandTutorials
      @CodeTechandTutorials  Před 2 lety +3

      I would like to get to that sometime but recently I've been mostly studying graphics and software architecture