summaryrefslogtreecommitdiff
path: root/src/audio_core/buffer.h
diff options
context:
space:
mode:
authorGravatar bunnei2018-08-04 00:03:12 -0400
committerGravatar bunnei2018-08-04 18:22:58 -0400
commit1dee8ceda1e5ecd5ebaee464b1450f323e82305f (patch)
tree97275d9a1c055d067053831f50a09ab9628ebf8e /src/audio_core/buffer.h
parentaudio_core: Port codec code from Citra for ADPCM decoding. (diff)
downloadyuzu-1dee8ceda1e5ecd5ebaee464b1450f323e82305f.tar.gz
yuzu-1dee8ceda1e5ecd5ebaee464b1450f323e82305f.tar.xz
yuzu-1dee8ceda1e5ecd5ebaee464b1450f323e82305f.zip
audio_core: Use s16 where possible for audio samples.
Diffstat (limited to 'src/audio_core/buffer.h')
-rw-r--r--src/audio_core/buffer.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/audio_core/buffer.h b/src/audio_core/buffer.h
index 4bf5fd58a..a323b23ec 100644
--- a/src/audio_core/buffer.h
+++ b/src/audio_core/buffer.h
@@ -18,11 +18,16 @@ class Buffer {
18public: 18public:
19 using Tag = u64; 19 using Tag = u64;
20 20
21 Buffer(Tag tag, std::vector<u8>&& data) : tag{tag}, data{std::move(data)} {} 21 Buffer(Tag tag, std::vector<s16>&& samples) : tag{tag}, samples{std::move(samples)} {}
22 22
23 /// Returns the raw audio data for the buffer 23 /// Returns the raw audio data for the buffer
24 const std::vector<u8>& GetData() const { 24 std::vector<s16>& Samples() {
25 return data; 25 return samples;
26 }
27
28 /// Returns the raw audio data for the buffer
29 const std::vector<s16>& GetSamples() const {
30 return samples;
26 } 31 }
27 32
28 /// Returns the buffer tag, this is provided by the game to the audout service 33 /// Returns the buffer tag, this is provided by the game to the audout service
@@ -32,7 +37,7 @@ public:
32 37
33private: 38private:
34 Tag tag; 39 Tag tag;
35 std::vector<u8> data; 40 std::vector<s16> samples;
36}; 41};
37 42
38using BufferPtr = std::shared_ptr<Buffer>; 43using BufferPtr = std::shared_ptr<Buffer>;