SpectMorph
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
SpectMorph::Encoder Class Reference

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)
 
Audiosave_as_audio ()
 

Static Public Member Functions

static std::string version ()
 

Public Attributes

std::vector< EncoderBlockaudio_blocks
 current state, and end result of the encoding algorithm
 
std::vector< float > original_samples
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Encoder()

Encoder::Encoder ( const EncoderParams enc_params)

Constructor which initializes the Encoders parameters.

Member Function Documentation

◆ encode()

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.

Parameters
dhandlea data handle containing the signal to be encoded
optimization_leveldetermines if fast (0), medium (1), or very slow (2) algorithm is used
attackwhether to find the optimal attack parameters

◆ save()

Error Encoder::save ( const std::string &  filename)

This function saves the data produced by the encoder to a SpectMorph file.

◆ save_as_audio()

Audio * Encoder::save_as_audio ( )

This function saves the data produced by the encoder, returning a newly allocated Audio object (caller must free this).


The documentation for this class was generated from the following files: