SpectMorph
|
Encoder producing SpectMorph parametric data from sample data. More...
#include <smencoder.hh>
Public Member Functions | |
Encoder (const EncoderParams &enc_params) | |
void | debug_decode (const std::string &filename) |
bool | encode (const WavData &wav_data, int channel, int optimization_level, bool attack, bool track_sines) |
void | set_loop (Audio::LoopType loop_type, int loop_start, int loop_end) |
void | set_loop_seconds (Audio::LoopType loop_type, double loop_start, double loop_end) |
Error | save (const std::string &filename) |
Audio * | save_as_audio () |
Static Public Member Functions | |
static std::string | version () |
Public Attributes | |
std::vector< EncoderBlock > | audio_blocks |
current state, and end result of the encoding algorithm | |
std::vector< float > | original_samples |
Encoder producing SpectMorph parametric data from sample data.
The encoder needs to perform a number of analysis steps to get from the input signal to a parametric representation (which is built in audio_blocks). At the moment, this process needs to be controlled by the caller, but a simpler interface should be added.
Encoder::Encoder | ( | const EncoderParams & | enc_params | ) |
Constructor which initializes the Encoders parameters.
bool Encoder::encode | ( | const WavData & | wav_data, |
int | channel, | ||
int | optimization_level, | ||
bool | attack, | ||
bool | track_sines | ||
) |
This function calls all steps necessary for encoding in the right order.
dhandle | a data handle containing the signal to be encoded |
optimization_level | determines if fast (0), medium (1), or very slow (2) algorithm is used |
attack | whether to find the optimal attack parameters |
Error Encoder::save | ( | const std::string & | filename | ) |
This function saves the data produced by the encoder to a SpectMorph file.
Audio * Encoder::save_as_audio | ( | ) |
This function saves the data produced by the encoder, returning a newly allocated Audio object (caller must free this).