-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(audio): Add AudioContext and MiniaudioContext
Co-Authored-By: João Miguel Nogueira <[email protected]>
- Loading branch information
1 parent
3b170fa
commit 107ae19
Showing
11 changed files
with
200 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#pragma once | ||
|
||
#include <cstddef> | ||
|
||
#include <miniaudio.h> | ||
|
||
#include <cubos/core/al/audio_context.hpp> | ||
|
||
namespace cubos::core::al | ||
{ | ||
/// Audio device implementation using miniaudio. | ||
class MiniaudioContext : public AudioContext | ||
{ | ||
public: | ||
MiniaudioContext(); | ||
~MiniaudioContext() override; | ||
|
||
std::shared_ptr<AudioDevice> createDevice(const std::string& specifier) override; | ||
|
||
static void enumerateDevices(std::vector<std::string>& devices); | ||
static std::string getDefaultDevice(); | ||
|
||
private: | ||
ma_context mContext; | ||
}; | ||
} // namespace cubos::core::al |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#include <cubos/core/al/miniaudio_context.hpp> | ||
|
||
using namespace cubos::core::al; | ||
|
||
std::shared_ptr<AudioContext> AudioContext::create() | ||
{ | ||
return std::make_shared<MiniaudioContext>(); | ||
} | ||
|
||
void AudioContext::enumerateDevices(std::vector<std::string>& devices) | ||
{ | ||
MiniaudioContext::enumerateDevices(devices); | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.