Audio added to firmware, Website File handling

This commit is contained in:
2026-04-01 16:06:40 +02:00
parent 01448223ad
commit 947346777f
22 changed files with 951 additions and 123 deletions

View File

@@ -0,0 +1,33 @@
#ifndef AUDIO_H
#define AUDIO_H
#include <zephyr/kernel.h>
#include "fs_mgmt.h"
/** Audio command message structure */
struct audio_cmd_msg
{
char filename[CONFIG_FS_MGMT_MAX_PATH_LENGTH]; // Wenn leer, nutze Fallback-Sound
bool is_interrupt; // True = sofort abbrechen, False = Enqueue
};
/**
* @brief Queues an audio playback command to the audio thread
* @param filename Name of the audio file to play. If empty, a random sound will be played
* @param is_interrupt If true, the command will interrupt any currently playing audio. If
* false, it will be enqueued and played after the current audio finishes
* @return 0 on success, negative error code on failure
*/
int audio_queue_play(const char *filename, bool is_interrupt);
/**
* @brief Starts playback of a random audio file from the audio directory. This is a non-blocking call that signals the audio thread to select and play a random sound.
*/
void audio_start_random_playback(void);
/**
* @brief Refreshes the list of available audio files
*/
void audio_refresh_files(void);
#endif /* AUDIO_H */