summaryrefslogtreecommitdiff
path: root/src/audio_core/stream.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-06-23 11:31:12 -0700
committerGitHub <noreply@github.com>2021-06-23 11:31:12 -0700
commit809e5fd52317f0a925ca463eca85a0b67d744f9e (patch)
tree2be4647d9d8ca7b43643e2996a831b2c914c519b /src/audio_core/stream.h
parentd8d9bb0dfb4af17233b17bfa590198a63de5335e (diff)
parentba3af04da1ba020bdbb7285c8da73f75fcba68cc (diff)
Merge pull request #6504 from Kelebek1/samples-played
[audout] Implement GetAudioOutPlayedSampleCount
Diffstat (limited to 'src/audio_core/stream.h')
-rw-r--r--src/audio_core/stream.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/audio_core/stream.h b/src/audio_core/stream.h
index 559844b9b..dbd97ec9c 100644
--- a/src/audio_core/stream.h
+++ b/src/audio_core/stream.h
@@ -89,6 +89,11 @@ public:
return sample_rate;
}
+ /// Gets the number of samples played so far
+ [[nodiscard]] u64 GetPlayedSampleCount() const {
+ return played_samples;
+ }
+
/// Gets the number of channels
[[nodiscard]] u32 GetNumChannels() const;
@@ -106,6 +111,7 @@ private:
[[nodiscard]] std::chrono::nanoseconds GetBufferReleaseNS(const Buffer& buffer) const;
u32 sample_rate; ///< Sample rate of the stream
+ u64 played_samples{}; ///< The current played sample count
Format format; ///< Format of the stream
float game_volume = 1.0f; ///< The volume the game currently has set
ReleaseCallback release_callback; ///< Buffer release callback for the stream