Skip to content

AudioEngine created using C++, FFMPEG and OpenAL for a student

License

Notifications You must be signed in to change notification settings

Darkx32/AudioEngine

Repository files navigation

AudioEngine

AudioEngine is a library made in C++, using FFMPEG and OpenAL. It consists of facilitating the handling of audio files for future applications. It is in its first version, it may present bugs or failures, but until then, I will try to adjust it every day.

  • Play any audio file (WAVE, OGG, MP3, ...).
  • Easy to use.
  • Modern libraries and versions.

How compile

  • Install and configure vcpkg, following instructions from repository.
  • Add the vcpkg root folder to the VCPKG_ROOT environment variable.
  • Install FFMPEG and OpenAL in vcpkg, following these commands:
./vcpkg install ffmpeg
./vcpkg install openal-soft
  • Clone this repository and build using CMake.
git clone https://github.com/Darkx32/AudioEngine.git
cd AudioEngine
cmake .
cmake --build .
  • Run example in output folder.

Example code

#include <AudioEngine/AudioEngine.h> // Import AudioEngine library

int main(int argc, char** argv)
{
    AudioEngine::AudioPlayer player; // Create player sound
    AudioEngine::AudioBuffer audioBuffer("<sound_file>"); // Create new audio buffer from file
    AudioEngine::AudioStream audioStream(audioBuffer); // Create the stream from audio buffer
    
    player.addStream(audioStream.getStream()); // Add stream to play
    player.playStream(audioStream.getStream()); // Play stream
    
    while(player.isRunningAudio()) // Detect if any sound is playing
    {
        player.updateSwaps(); // Player update
    }

    return 0;
}

To-do list Project

  • Audio control and management.
  • Play any file song.
  • Set volume and position.
  • Filter and reverb audio streams
  • Use microphone

About

AudioEngine created using C++, FFMPEG and OpenAL for a student

Resources

License

Stars

Watchers

Forks