vorbis and buffering

This commit is contained in:
Nishi 2025-11-24 22:36:29 +09:00
commit c6960ffb9f
Signed by: nishi
GPG key ID: 27EF69B208EB9343
7 changed files with 158 additions and 18 deletions

View file

@ -5,6 +5,7 @@
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
#endif

View file

@ -10,6 +10,7 @@ extern "C" {
typedef struct _MDESoundDriver MDESoundDriverRec, *MDESoundDriver;
typedef struct _MDESoundContext* MDESoundContext;
typedef struct _MDESound* MDESound;
typedef struct _MDESoundBuffer MDESoundBuffer;
struct _MDESoundContext {
int sample_rate;
@ -30,12 +31,20 @@ struct _MDESoundDriver {
void (*seek)(MDESoundContext context, int frames);
};
struct _MDESoundBuffer {
short* data;
int frames;
int seek;
};
struct _MDESound {
MDESoundContext context;
MDESoundDriver driver;
MDESoundBuffer* buffer;
};
extern MDESoundDriver MDESoundDriverMP3;
extern MDESoundDriver MDESoundDriverVorbis;
MDESound MDESoundOpen(const char* path);