summaryrefslogtreecommitdiff
path: root/core/math/audio_frame.h
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-02-06 16:40:59 +0100
committerGitHub <noreply@github.com>2022-02-06 16:40:59 +0100
commite38df41de8f20516ab8b2c91bedb4388cd9e41aa (patch)
treeb3823839f7d1ba31b3e118d5585de0233146a1a9 /core/math/audio_frame.h
parent762a31169d5e0939fda5bdaab537cec5ab39f870 (diff)
parent8c7268664da7ef98f802ec90fa2ba17b4d695847 (diff)
Merge pull request #57607 from reduz/fix-variant-vec-integer-float-mul-div
Diffstat (limited to 'core/math/audio_frame.h')
-rw-r--r--core/math/audio_frame.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/math/audio_frame.h b/core/math/audio_frame.h
index 94fc3de2b1..8b244e9fe4 100644
--- a/core/math/audio_frame.h
+++ b/core/math/audio_frame.h
@@ -140,4 +140,16 @@ struct AudioFrame {
_ALWAYS_INLINE_ AudioFrame() {}
};
+_ALWAYS_INLINE_ AudioFrame operator*(float p_scalar, const AudioFrame &p_frame) {
+ return AudioFrame(p_frame.l * p_scalar, p_frame.r * p_scalar);
+}
+
+_ALWAYS_INLINE_ AudioFrame operator*(int32_t p_scalar, const AudioFrame &p_frame) {
+ return AudioFrame(p_frame.l * p_scalar, p_frame.r * p_scalar);
+}
+
+_ALWAYS_INLINE_ AudioFrame operator*(int64_t p_scalar, const AudioFrame &p_frame) {
+ return AudioFrame(p_frame.l * p_scalar, p_frame.r * p_scalar);
+}
+
#endif // AUDIO_FRAME_H