summaryrefslogtreecommitdiffstats
path: root/src/audio_core/time_stretch.h
diff options
context:
space:
mode:
authorJames Rowe <jroweboy@gmail.com>2018-01-12 03:21:20 +0100
committerJames Rowe <jroweboy@gmail.com>2018-01-13 03:11:03 +0100
commitebf9a784a9f7f4148a669dbb39e7cd50df779a14 (patch)
treed585685a1c0a34b903af1d086d62560bf56bb29f /src/audio_core/time_stretch.h
parentconfig: Default CPU core to Unicorn. (diff)
downloadyuzu-ebf9a784a9f7f4148a669dbb39e7cd50df779a14.tar
yuzu-ebf9a784a9f7f4148a669dbb39e7cd50df779a14.tar.gz
yuzu-ebf9a784a9f7f4148a669dbb39e7cd50df779a14.tar.bz2
yuzu-ebf9a784a9f7f4148a669dbb39e7cd50df779a14.tar.lz
yuzu-ebf9a784a9f7f4148a669dbb39e7cd50df779a14.tar.xz
yuzu-ebf9a784a9f7f4148a669dbb39e7cd50df779a14.tar.zst
yuzu-ebf9a784a9f7f4148a669dbb39e7cd50df779a14.zip
Diffstat (limited to 'src/audio_core/time_stretch.h')
-rw-r--r--src/audio_core/time_stretch.h60
1 files changed, 0 insertions, 60 deletions
diff --git a/src/audio_core/time_stretch.h b/src/audio_core/time_stretch.h
deleted file mode 100644
index c98b16705..000000000
--- a/src/audio_core/time_stretch.h
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright 2016 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-#include <cstddef>
-#include <memory>
-#include <vector>
-#include "common/common_types.h"
-
-namespace AudioCore {
-
-class TimeStretcher final {
-public:
- TimeStretcher();
- ~TimeStretcher();
-
- /**
- * Set sample rate for the samples that Process returns.
- * @param sample_rate The sample rate.
- */
- void SetOutputSampleRate(unsigned int sample_rate);
-
- /**
- * Add samples to be processed.
- * @param sample_buffer Buffer of samples in interleaved stereo PCM16 format.
- * @param num_samples Number of samples.
- */
- void AddSamples(const s16* sample_buffer, size_t num_samples);
-
- /// Flush audio remaining in internal buffers.
- void Flush();
-
- /// Resets internal state and clears buffers.
- void Reset();
-
- /**
- * Does audio stretching and produces the time-stretched samples.
- * Timer calculations use sample_delay to determine how much of a margin we have.
- * @param sample_delay How many samples are buffered downstream of this module and haven't been
- * played yet.
- * @return Samples to play in interleaved stereo PCM16 format.
- */
- std::vector<s16> Process(size_t sample_delay);
-
-private:
- struct Impl;
- std::unique_ptr<Impl> impl;
-
- /// INTERNAL: ratio = wallclock time / emulated time
- double CalculateCurrentRatio();
- /// INTERNAL: If we have too many or too few samples downstream, nudge ratio in the appropriate
- /// direction.
- double CorrectForUnderAndOverflow(double ratio, size_t sample_delay) const;
- /// INTERNAL: Gets the time-stretched samples from SoundTouch.
- std::vector<s16> GetSamples();
-};
-
-} // namespace AudioCore