Add equalizer to test application

This commit is contained in:
Johannes Schriewer 2024-03-01 01:31:35 +01:00
parent c3a015b616
commit e07ad5a599

View file

@ -4,18 +4,84 @@
#include "audio_source_file.h"
#include "audio_demuxer_mp3.h"
#include "audio_decoder_mp3.h"
#include "audio_filter_param_eq.h"
#include "audio_filter_resample.h"
#include "audio_sink_libao.h"
#include "audio_sink_file.h"
int main(int argc, char **argv) {
AudioPipeline *pipeline;
EQBand bands[] = {
{
.type = EQTypeLowShelf,
.frequency = 32.0,
.Q = 1.41,
.gain = -4.47
},
{
.type = EQTypePeak,
.frequency = 64.0,
.Q = 1.41,
.gain = 2.15
},
{
.type = EQTypePeak,
.frequency = 125.0,
.Q = 1.41,
.gain = 5.13
},
{
.type = EQTypePeak,
.frequency = 250.0,
.Q = 1.41,
.gain = 5.13
},
{
.type = EQTypePeak,
.frequency = 500.0,
.Q = 1.41,
.gain = -3.48
},
{
.type = EQTypePeak,
.frequency = 1000.0,
.Q = 1.41,
.gain = -4.14
},
{
.type = EQTypePeak,
.frequency = 2000.0,
.Q = 1.41,
.gain = 0
},
{
.type = EQTypePeak,
.frequency = 4000.0,
.Q = 1.41,
.gain = 3.14
},
{
.type = EQTypePeak,
.frequency = 8000.0,
.Q = 1.41,
.gain = 3.14
},
{
.type = EQTypeHighShelf,
.frequency = 16000.0,
.Q = 1.41,
.gain = 3.14
},
};
pipeline = audio_pipeline_assemble(
audio_source_file("/Users/dark/test2.mp3", 512),
audio_demuxer_mp3(),
audio_decoder_mp3(),
// audio_filter_resample(48000),
audio_filter_resample(48000),
audio_filter_param_eq(bands, 10, -6.5),
audio_sink_libao(),
//audio_sink_file("/Users/dark/out.raw"),
NULL
);