ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
visualization.h
Go to the documentation of this file.
1#pragma once
2
3#include <stddef.h>
4#include <stdbool.h>
5#include <stddef.h>
6
15
16#define AUDIO_VISUALIZATION_SAMPLE_RATE 48000
17
18#define AUDIO_VISUALIZATION_COLOR_STANDARD 0
19#define AUDIO_VISUALIZATION_COLOR_DARKER 1
20#define AUDIO_VISUALIZATION_COLOR_BRIGHTER 2
21
22/* Publish mono float PCM without taking ownership of the caller's buffer. */
23void audio_visualization_submit(audio_visualization_source_t source, const float *samples, size_t count);
24
25/* Read the latest samples from one source, or combine the source groups. */
26void audio_visualization_read(audio_visualization_source_t source, float *samples, size_t count);
27
28/* Build a terminal-ready waveform frame. The caller owns the returned buffer. */
29char *audio_visualization_render_waveform(unsigned int width, unsigned int height, audio_visualization_source_t source,
30 bool use_color, int color_mode, bool flip_x, bool flip_y);
31
32/* Build a terminal-ready scrolling frequency display. The caller owns the returned buffer. */
33char *audio_visualization_render_fft(unsigned int width, unsigned int height, audio_visualization_source_t source,
34 bool use_color, int color_mode, bool flip_x, bool flip_y);
ClangTool/LibTooling compatibility shim for stdbool.h.
void audio_visualization_submit(audio_visualization_source_t source, const float *samples, size_t count)
audio_visualization_source_t
@ AUDIO_VISUALIZATION_SOURCE_MIX
@ AUDIO_VISUALIZATION_SOURCE_MEDIA
@ AUDIO_VISUALIZATION_SOURCE_LOCAL_MIX
@ AUDIO_VISUALIZATION_SOURCE_COUNT
@ AUDIO_VISUALIZATION_SOURCE_MIC
@ AUDIO_VISUALIZATION_SOURCE_REMOTE
char * audio_visualization_render_waveform(unsigned int width, unsigned int height, audio_visualization_source_t source, bool use_color, int color_mode, bool flip_x, bool flip_y)
void audio_visualization_read(audio_visualization_source_t source, float *samples, size_t count)
char * audio_visualization_render_fft(unsigned int width, unsigned int height, audio_visualization_source_t source, bool use_color, int color_mode, bool flip_x, bool flip_y)