2009-12-02 18:11:53 +01:00
|
|
|
/*! compress.h
|
|
|
|
* interface to audio compression
|
|
|
|
*
|
|
|
|
* (c)2007 busybee (http://beesbuzz.biz/)
|
|
|
|
* Licensed under the terms of the LGPL. See the file COPYING for details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef COMPRESS_H
|
|
|
|
#define COMPRESS_H
|
|
|
|
|
2010-05-12 03:40:38 +02:00
|
|
|
#include <stdint.h>
|
2009-12-02 18:11:53 +01:00
|
|
|
|
|
|
|
//! Configuration values for the compressor object
|
|
|
|
struct CompressorConfig {
|
|
|
|
int target;
|
|
|
|
int maxgain;
|
|
|
|
int smooth;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Compressor;
|
|
|
|
|
2013-01-30 21:47:12 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2009-12-02 18:11:53 +01:00
|
|
|
//! Create a new compressor (use history value of 0 for default)
|
|
|
|
struct Compressor *Compressor_new(unsigned int history);
|
|
|
|
|
|
|
|
//! Delete a compressor
|
|
|
|
void Compressor_delete(struct Compressor *);
|
|
|
|
|
|
|
|
//! Set the history length
|
|
|
|
void Compressor_setHistory(struct Compressor *, unsigned int history);
|
|
|
|
|
|
|
|
//! Get the configuration for a compressor
|
|
|
|
struct CompressorConfig *Compressor_getConfig(struct Compressor *);
|
|
|
|
|
|
|
|
//! Process 16-bit signed data
|
|
|
|
void Compressor_Process_int16(struct Compressor *, int16_t *data, unsigned int count);
|
|
|
|
|
2013-01-30 21:47:12 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2009-12-02 18:11:53 +01:00
|
|
|
//! TODO: Compressor_Process_int32, Compressor_Process_float, others as needed
|
|
|
|
|
|
|
|
//! TODO: functions for getting at the peak/gain/clip history buffers (for monitoring)
|
2013-01-30 21:47:12 +01:00
|
|
|
|
2009-12-02 18:11:53 +01:00
|
|
|
#endif
|