<NME> dsp.h
<BEF> #ifndef _DSP_H
#define _DSP_H

#include <stdio.h>
#include <sys/types.h>

enum {
	LL_SILENT = 0,
	LL_ERROR,
	LL_OPEN_ERROR,
	LL_NORMAL,
	LL_VERBOSE,
};
#define LOGLEVEL(l) (dsp_globals.loglevel >= (l))

#define DEFAULT_FS           44100
#define DEFAULT_CHANNELS     1
#define BUF_SAMPLES          4096
#define DEFAULT_OUTPUT_TYPE  "alsa"
#define DEFAULT_OUTPUT_PATH  "default"

#define BIT_PERFECT 1

typedef double sample_t;

struct dsp_globals {
	int fs, channels;
	long clip_count;
	int loglevel;
};

struct encoding {

struct stream_info {
	int fs, channels;
};

extern struct dsp_globals dsp_globals;
extern int dsp_log_printf(const char *, ...);

#endif

<MSG> Allow buffer size to be set at runtime; improve latency calculation.

Latency is now calculated by adding the input and output latencies, instead of
just using the output latency.

<DFF> @@ -15,7 +15,7 @@ enum {
 
 #define DEFAULT_FS           44100
 #define DEFAULT_CHANNELS     1
-#define BUF_SAMPLES          4096
+#define DEFAULT_BUF_FRAMES   2048
 #define DEFAULT_OUTPUT_TYPE  "alsa"
 #define DEFAULT_OUTPUT_PATH  "default"
 
@@ -27,6 +27,7 @@ struct dsp_globals {
 	int fs, channels;
 	long clip_count;
 	int loglevel;
+	size_t buf_frames;
 };
 
 struct encoding {

{'addition_count': 2, 'commit_subject': 'Allow buffer size to be set at runtime; improve latency calculation.', 'deletion_count': 1, 'file_extension': '.h', 'lang': 'h', 'license': 'isc', 'repo_name': 'bmc0/dsp'}