mirror of
https://github.com/subhobhai943/SUB-OS.git
synced 2026-10-26 09:02:46 +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
+20
@@ -0,0 +1,20 @@
|
||||
#include <sound/pcm.h>
|
||||
#include <sound/sound.h>
|
||||
#include <lib/string.h>
|
||||
|
||||
static pcm_stream_t default_pcm;
|
||||
|
||||
void pcm_init(void) {
|
||||
memset(&default_pcm, 0, sizeof(default_pcm));
|
||||
default_pcm.sample_rate = 44100;
|
||||
default_pcm.channels = 2;
|
||||
default_pcm.bits = 16;
|
||||
}
|
||||
|
||||
int pcm_write(const void* data, size_t len) {
|
||||
sound_device_t* dev = sound_get_default_device();
|
||||
if (dev && dev->play_sample) {
|
||||
return dev->play_sample(data, len);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user