summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/audio.h1
-rw-r--r--firmware/export/enc_base.h1
-rw-r--r--firmware/pcm_record.c9
3 files changed, 8 insertions, 3 deletions
diff --git a/firmware/export/audio.h b/firmware/export/audio.h
index aedaffb..9530082 100644
--- a/firmware/export/audio.h
+++ b/firmware/export/audio.h
@@ -176,6 +176,7 @@ struct audio_recording_options
int rec_channels;
int rec_prerecord_time;
#if CONFIG_CODEC == SWCODEC
+ int rec_mono_mode;
int rec_source_flags; /* for rec_set_source */
struct encoder_config enc_config;
#else
diff --git a/firmware/export/enc_base.h b/firmware/export/enc_base.h
index e73e876..321421c 100644
--- a/firmware/export/enc_base.h
+++ b/firmware/export/enc_base.h
@@ -246,6 +246,7 @@ struct enc_inputs
{
unsigned long sample_rate; /* out - pcm frequency */
int num_channels; /* out - number of audio channels */
+ int rec_mono_mode; /* out - how to create mono */
struct encoder_config *config; /* out - encoder settings */
};
diff --git a/firmware/pcm_record.c b/firmware/pcm_record.c
index 045ace9..0e0102a 100644
--- a/firmware/pcm_record.c
+++ b/firmware/pcm_record.c
@@ -90,6 +90,7 @@ static int rec_source; /* current rec_source setting */
static int rec_frequency; /* current frequency setting */
static unsigned long sample_rate; /* Sample rate in HZ */
static int num_channels; /* Current number of channels */
+static int rec_mono_mode; /* how mono is created */
static struct encoder_config enc_config; /* Current encoder configuration */
static unsigned long pre_record_ticks; /* pre-record time in ticks */
@@ -1178,6 +1179,7 @@ static void pcmrec_set_recording_options(
rec_frequency = options->rec_frequency;
rec_source = options->rec_source;
num_channels = options->rec_channels == 1 ? 1 : 2;
+ rec_mono_mode = options->rec_mono_mode;
pre_record_ticks = options->rec_prerecord_time * HZ;
enc_config = options->enc_config;
enc_config.afmt = rec_format_afmt[enc_config.rec_format];
@@ -1526,17 +1528,18 @@ void enc_get_inputs(struct enc_inputs *inputs)
{
inputs->sample_rate = sample_rate;
inputs->num_channels = num_channels;
+ inputs->rec_mono_mode = rec_mono_mode;
inputs->config = &enc_config;
} /* enc_get_inputs */
-
+
/* set the encoder dimensions (called by encoder codec at initialization and
termination) */
void enc_set_parameters(struct enc_parameters *params)
{
size_t bufsize, resbytes;
-
+
logf("enc_set_parameters");
-
+
if (!params)
{
logf("reset");