summaryrefslogtreecommitdiff
path: root/src/audio_core/buffer.h
diff options
context:
space:
mode:
authorGravatar bunnei2018-07-27 20:25:32 -0700
committerGravatar GitHub2018-07-27 20:25:32 -0700
commite1d66ea7942800d51aff57c44d0e9ab9ffd949dc (patch)
treeaaff4a680cafbd1111baa602af8d0d2d7297f585 /src/audio_core/buffer.h
parentMerge pull request #696 from DarkLordZach/romfs (diff)
parentaudout: Implement IAudioOut interface with AudioCore. (diff)
downloadyuzu-e1d66ea7942800d51aff57c44d0e9ab9ffd949dc.tar.gz
yuzu-e1d66ea7942800d51aff57c44d0e9ab9ffd949dc.tar.xz
yuzu-e1d66ea7942800d51aff57c44d0e9ab9ffd949dc.zip
Merge pull request #842 from bunnei/audio-core
Initial implementation of Audio Core
Diffstat (limited to 'src/audio_core/buffer.h')
-rw-r--r--src/audio_core/buffer.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/audio_core/buffer.h b/src/audio_core/buffer.h
new file mode 100644
index 000000000..874ec787e
--- /dev/null
+++ b/src/audio_core/buffer.h
@@ -0,0 +1,37 @@
1// Copyright 2018 yuzu Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include <vector>
8
9#include "common/common_types.h"
10
11namespace AudioCore {
12
13/**
14 * Represents a buffer of audio samples to be played in an audio stream
15 */
16class Buffer {
17public:
18 using Tag = u64;
19
20 Buffer(Tag tag, std::vector<u8>&& data) : tag{tag}, data{std::move(data)} {}
21
22 /// Returns the raw audio data for the buffer
23 const std::vector<u8>& GetData() const {
24 return data;
25 }
26
27 /// Returns the buffer tag, this is provided by the game to the audout service
28 Tag GetTag() const {
29 return tag;
30 }
31
32private:
33 Tag tag;
34 std::vector<u8> data;
35};
36
37} // namespace AudioCore