mirror of
https://github.com/subhobhai943/SUB-OS.git
synced 2026-10-25 16:52:29 +00:00
feat: Massive OS expansion with IPC, Sound & TTS, Block layer, FAT32/ext2/sysfs, Signals, Syscalls, Modules, Drivers & 50+ LazyBox applets
This commit is contained in:
1 parent
5662be29f5
commit
d680335f05
64 files changed
+2370
-166
No files matched your search
@@ -0,0 +1,15 @@
|
||||
#ifndef _SOUND_AC97_H
|
||||
#define _SOUND_AC97_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#define AC97_PCI_VENDOR 0x8086
|
||||
#define AC97_PCI_DEVICE 0x2415 // Intel 82801AA AC'97 Audio
|
||||
|
||||
bool ac97_init(void);
|
||||
void ac97_set_master_volume(uint8_t left, uint8_t right);
|
||||
int ac97_play_pcm(const void* samples, size_t length);
|
||||
|
||||
#endif // _SOUND_AC97_H
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef _SOUND_PCM_H
|
||||
#define _SOUND_PCM_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#define PCM_BUFFER_SIZE 8192
|
||||
|
||||
typedef struct {
|
||||
uint32_t sample_rate;
|
||||
uint8_t channels;
|
||||
uint8_t bits;
|
||||
uint8_t buffer[PCM_BUFFER_SIZE];
|
||||
size_t length;
|
||||
} pcm_stream_t;
|
||||
|
||||
void pcm_init(void);
|
||||
int pcm_write(const void* data, size_t len);
|
||||
|
||||
#endif // _SOUND_PCM_H
|
||||
@@ -0,0 +1,23 @@
|
||||
#ifndef _SOUND_SOUND_H
|
||||
#define _SOUND_SOUND_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
typedef struct sound_device {
|
||||
char name[32];
|
||||
uint32_t sample_rate;
|
||||
uint8_t channels;
|
||||
uint8_t bits_per_sample;
|
||||
int volume;
|
||||
int (*play_sample)(const void* buffer, size_t length);
|
||||
int (*set_volume)(int volume);
|
||||
bool active;
|
||||
} sound_device_t;
|
||||
|
||||
void sound_init(void);
|
||||
int sound_register_device(sound_device_t* dev);
|
||||
sound_device_t* sound_get_default_device(void);
|
||||
|
||||
#endif // _SOUND_SOUND_H
|
||||
@@ -0,0 +1,18 @@
|
||||
#ifndef _SOUND_TTS_H
|
||||
#define _SOUND_TTS_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
typedef struct {
|
||||
char phoneme[4];
|
||||
uint32_t freq_f1;
|
||||
uint32_t freq_f2;
|
||||
uint32_t duration_ms;
|
||||
} tts_phoneme_t;
|
||||
|
||||
void tts_init(void);
|
||||
void tts_speak(const char* text);
|
||||
void tts_speak_letter(char c);
|
||||
|
||||
#endif // _SOUND_TTS_H
|
||||
Reference in new issue
Block a user