122e46e862
Core: aes67_tx_pink_noise(), a ready-made TX source: xorshift32 white noise through Paul Kellet's pink filter, -18 dBFS RMS (peaks about -6 dBFS), same on L and R. The player uses it like the tone (straight to TX, no volume or gain). Checked on the board: -18 dBFS RMS, octave bands 63 Hz-4 kHz flat within +-0.4 dB, L = R. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
18 lines
664 B
C
18 lines
664 B
C
// Project player: picks the audio source for AES67 TX (test tone, pink noise, silence, HLS, Spotify).
|
|
#pragma once
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
#include "cJSON.h"
|
|
#include "esp_err.h"
|
|
|
|
typedef enum { PLAYER_SRC_TONE, PLAYER_SRC_OFF, PLAYER_SRC_HLS, PLAYER_SRC_SPOTIFY, PLAYER_SRC_PINK } player_src_t;
|
|
|
|
esp_err_t player_init(void);
|
|
// Apply the "source" config group (mode etc.).
|
|
void player_apply(const cJSON *source);
|
|
// Source side: write 48 kHz stereo int32 frames, blocking while the ring is full.
|
|
// Frames from a source that is not the active one are dropped (returns n).
|
|
size_t player_write(player_src_t src, const int32_t *frames, size_t n);
|