Loading...
Searching...
No Matches
Whisperization.h
Go to the documentation of this file.
// Copyright (c) 2008-2019 OpenShot Studios, LLC
//
// SPDX-License-Identifier: LGPL-3.0-or-later
#ifndef OPENSHOT_WHISPERIZATION_AUDIO_EFFECT_H
#define OPENSHOT_WHISPERIZATION_AUDIO_EFFECT_H
#define _USE_MATH_DEFINES
#include <memory>
#include <mutex>
#include <string>
#include "../EffectBase.h"
#include "../Json.h"
#include "../KeyFrame.h"
#include "../Enums.h"
#include "STFT.h"
namespace juce {
namespace dsp {
class FFT;
}
}
namespace openshot
{
class Frame;
class Whisperization : public EffectBase
{
private:
void init_effect_details();
public:
openshot::FFTSize fft_size;
openshot::HopSize hop_size;
openshot::WindowType window_type;
Whisperization();
Whisperization(openshot::FFTSize fft_size,
openshot::HopSize hop_size,
openshot::WindowType window_type);
std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number) override {
return GetFrame(std::make_shared<openshot::Frame>(), frame_number);
}
std::shared_ptr<openshot::Frame>
GetFrame(std::shared_ptr<openshot::Frame> frame, int64_t frame_number) override;
// Get and Set JSON methods
std::string Json() const override;
void SetJson(const std::string value) override;
Json::Value JsonValue() const override;
void SetJsonValue(const Json::Value root) override;
std::string PropertiesJSON(int64_t requested_frame) const override;
class WhisperizationEffect : public STFT
{
public:
WhisperizationEffect(Whisperization& p) : parent (p) { }
private:
void modification(const int channel) override;
Whisperization &parent;
};
std::recursive_mutex mutex;
WhisperizationEffect stft;
std::unique_ptr<juce::dsp::FFT> fft;
};
}
#endif
STFT.h
openshot::EffectBase
This abstract class is the base class, used by all effects in libopenshot.
Definition EffectBase.h:53
openshot::STFT
Definition STFT.h:22
openshot::Whisperization::WhisperizationEffect
Definition Whisperization.h:77
openshot::Whisperization::WhisperizationEffect::WhisperizationEffect
WhisperizationEffect(Whisperization &p)
Definition Whisperization.h:79
openshot::Whisperization
This class adds a whisperization effect into the audio.
Definition Whisperization.h:42
openshot::Whisperization::fft
std::unique_ptr< juce::dsp::FFT > fft
Definition Whisperization.h:89
openshot::Whisperization::GetFrame
std::shared_ptr< openshot::Frame > GetFrame(int64_t frame_number) override
This method is required for all derived classes of ClipBase, and returns a new openshot::Frame object...
Definition Whisperization.h:60
openshot::Whisperization::SetJsonValue
void SetJsonValue(const Json::Value root) override
Load Json::Value into this object.
Definition Whisperization.cpp:131
openshot::Whisperization::Whisperization
Whisperization()
Default constructor.
Definition Whisperization.cpp:20
openshot::Whisperization::Json
std::string Json() const override
Generate JSON string of this object.
Definition Whisperization.cpp:93
openshot::Whisperization::window_type
openshot::WindowType window_type
Definition Whisperization.h:50
openshot::Whisperization::stft
WhisperizationEffect stft
Definition Whisperization.h:88
openshot::Whisperization::mutex
std::recursive_mutex mutex
Definition Whisperization.h:87
openshot::Whisperization::JsonValue
Json::Value JsonValue() const override
Generate Json::Value for this object.
Definition Whisperization.cpp:100
openshot::Whisperization::PropertiesJSON
std::string PropertiesJSON(int64_t requested_frame) const override
Definition Whisperization.cpp:147
openshot::Whisperization::SetJson
void SetJson(const std::string value) override
Load JSON string into this object.
Definition Whisperization.cpp:114
openshot::Whisperization::fft_size
openshot::FFTSize fft_size
Definition Whisperization.h:48
openshot::Whisperization::hop_size
openshot::HopSize hop_size
Definition Whisperization.h:49
juce
Definition Robotization.h:29
openshot
This namespace is the default namespace for all code in the openshot library.
Definition Compressor.h:29
openshot::FFTSize
FFTSize
This enumeration determines the FFT size.
Definition Enums.h:92
openshot::HopSize
HopSize
This enumeration determines the hop size.
Definition Enums.h:105
openshot::WindowType
WindowType
This enumeration determines the window type.
Definition Enums.h:112