Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
realtime_time_stretch.hpp
Go to the documentation of this file.
1#pragma once
2
9
10#include <cstdint>
11#include <memory>
12
13namespace pulp::audio {
14
15enum class RealtimeTimeStretchQuality : std::uint8_t {
18};
19
29
36
43
50
56
65
70
71inline constexpr int kRealtimeTimeStretchMaximumChannels = 64;
72
74 const RealtimeTimeStretchConfig& config, std::uint64_t requested_max_bytes,
76
82 public:
89
91 double sample_rate, const RealtimeTimeStretchConfig& config,
92 std::uint64_t requested_max_bytes);
93
94 void reset() noexcept;
95 void set_time_ratio(float ratio) noexcept;
96 RealtimeTimeStretchStreamFeedStatus feed(const float* const* input,
97 int num_samples) noexcept;
98 int available_stretched() const noexcept;
99 int output_free_space() const noexcept;
103 int read_stretched(float* const* output, int num_samples) noexcept;
104
105 private:
107 const RealtimeTimeStretchConfig&, std::uint64_t,
109 struct Impl;
110 std::unique_ptr<Impl> impl_;
111};
112
113} // namespace pulp::audio
int samples_until_next_analysis_frame() const noexcept
RealtimeTimeStretchStreamFeedStatus feed(const float *const *input, int num_samples) noexcept
void set_time_ratio(float ratio) noexcept
int read_stretched(float *const *output, int num_samples) noexcept
RealtimeTimeStretchStreamFinalizeStatus finalize(int max_samples) noexcept
friend RealtimeTimeStretchPrepareStatus checked_realtime_time_stretch_prepared_geometry(const RealtimeTimeStretchConfig &, std::uint64_t, RealtimeTimeStretchPreparedGeometry &) noexcept
RealtimeTimeStretchPrepareStatus prepare(double sample_rate, const RealtimeTimeStretchConfig &config, std::uint64_t requested_max_bytes)
RealtimeTimeStretchStreamFinalizePlan plan_finalize(int max_samples) const noexcept
Definition analyzer_provider.hpp:12
constexpr int kRealtimeTimeStretchMaximumChannels
Definition realtime_time_stretch.hpp:71
RealtimeTimeStretchStreamFinalizeStatus
Definition realtime_time_stretch.hpp:37
@ draining
Definition realtime_time_stretch.hpp:38
@ complete
Definition realtime_time_stretch.hpp:40
RealtimeTimeStretchPrepareStatus
Definition realtime_time_stretch.hpp:20
@ unrepresentable_capacity
Definition realtime_time_stretch.hpp:27
@ invalid_channel_count
Definition realtime_time_stretch.hpp:23
@ invalid_spectral_geometry
Definition realtime_time_stretch.hpp:26
@ invalid_sample_rate
Definition realtime_time_stretch.hpp:22
@ invalid_max_time_ratio
Definition realtime_time_stretch.hpp:25
@ prepared
Definition realtime_time_stretch.hpp:21
@ invalid_max_block
Definition realtime_time_stretch.hpp:24
RealtimeTimeStretchQuality
Definition realtime_time_stretch.hpp:15
@ low_latency
Definition realtime_time_stretch.hpp:17
@ quality
Definition realtime_time_stretch.hpp:16
RealtimeTimeStretchStreamFeedStatus
Definition realtime_time_stretch.hpp:30
@ accepted
Definition realtime_time_stretch.hpp:31
@ invalid_request
Definition realtime_time_stretch.hpp:34
@ input_closed
Definition realtime_time_stretch.hpp:33
@ backpressure
Definition realtime_time_stretch.hpp:32
RealtimeTimeStretchPrepareStatus checked_realtime_time_stretch_prepared_geometry(const RealtimeTimeStretchConfig &config, std::uint64_t requested_max_bytes, RealtimeTimeStretchPreparedGeometry &prepared) noexcept
RealtimeTimeStretchStreamFinalizePlanStatus
Definition realtime_time_stretch.hpp:44
@ needs_drain
Definition realtime_time_stretch.hpp:46
@ invalid_request
Definition realtime_time_stretch.hpp:48
@ ready
Definition realtime_time_stretch.hpp:45
STL namespace.
Definition realtime_time_stretch.hpp:57
int max_block
Definition realtime_time_stretch.hpp:60
float max_time_ratio
Definition realtime_time_stretch.hpp:61
RealtimeTimeStretchQuality quality
Definition realtime_time_stretch.hpp:58
int fft_size
Definition realtime_time_stretch.hpp:62
int analysis_hop
Definition realtime_time_stretch.hpp:63
int channels
Definition realtime_time_stretch.hpp:59
Definition realtime_time_stretch.hpp:66
std::uint64_t retained_bytes
Definition realtime_time_stretch.hpp:68
int maximum_stream_output_lag_samples
Definition realtime_time_stretch.hpp:67
Definition realtime_time_stretch.hpp:51
int samples
Definition realtime_time_stretch.hpp:54
RealtimeTimeStretchStreamFinalizePlanStatus status
Definition realtime_time_stretch.hpp:52