Lua
C++
Edit

LoadSound

Syntax

Parameter Description
path file name to load
stream stream to load the file from
flags optional loading flags, can be LOAD_DEFAULT or any combination of LOAD_UNMANAGED and LOAD_QUIET

Example

#include "UltraEngine.h"

using namespace UltraEngine;

int main(int argc, const char* argv[])
{
    //Get the displays
    auto displays = GetDisplays();

    //Create window
    auto window = CreateWindow("Ultra Engine", 0, 0, 800, 600, displays[0], WINDOW_TITLEBAR | WINDOW_CENTER);

    //Load sound
    auto sound = LoadSound("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Sound/notification.wav");

    //Play sound
    auto speaker = CreateSpeaker();
    speaker->SetSound(sound);
    speaker->SetLooping(true);
    speaker->Play();

    while (window->Closed() == false)
    {
        if (window->KeyDown(KEY_ESCAPE)) break;
    }
    return 0;
}
Copyright © 2024 Ultra Software.
All rights reserved.