#include <stdio.h>
#include <string.h>
#include <kernel.h>
#include <sifrpc.h>
#include <loadfile.h>
#include <tamtypes.h>
#include <audsrv.h>
Go to the source code of this file.
◆ fillbuffer()
static int fillbuffer |
( |
void * |
arg | ) |
|
|
static |
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 29 of file playwav2.c.
43 printf(
"sample: kicking IRXs\n");
45 printf(
"libsd loadmodule %d\n", ret);
47 printf(
"sample: loading audsrv\n");
49 printf(
"audsrv loadmodule %d\n", ret);
54 printf(
"sample: failed to initialize audsrv\n");
63 printf(
"set format returned %d\n", err);
76 printf(
"audsrv_on_fillbuf failed with err=%d\n", err);
80 wav = fopen(
"host:song_22k.wav",
"rb");
83 printf(
"failed to open wav file\n");
88 fseek(wav, 0x30, SEEK_SET);
90 printf(
"starting play loop\n");
95 ret = fread(chunk, 1,
sizeof(chunk), wav);
102 if (ret <
sizeof(chunk))
113 printf(
"\r%d bytes sent..", bytes);
116 if (played == 512)
break;
122 printf(
"sample: stopping audsrv\n");
125 printf(
"sample: ended\n");
const char * audsrv_get_error_string()
#define AUDSRV_ERR_NOERROR
int audsrv_play_audio(const char *chunk, int bytes)
int audsrv_set_volume(int volume)
int audsrv_on_fillbuf(int amount, audsrv_callback_t cb, void *arg)
int audsrv_set_format(struct audsrv_fmt_t *fmt)
int SifLoadModule(const char *path, int arg_len, const char *args)
s32 CreateSema(ee_sema_t *sema)
s32 WaitSema(s32 sema_id)
static int fillbuffer(void *arg)
void SifInitRpc(int mode)
References AUDSRV_ERR_NOERROR, audsrv_get_error_string(), audsrv_init(), audsrv_on_fillbuf(), audsrv_play_audio(), audsrv_quit(), audsrv_set_format(), audsrv_set_volume(), audsrv_fmt_t::bits, audsrv_fmt_t::channels, CreateSema(), fillbuffer(), audsrv_fmt_t::freq, ee_sema_t::init_count, ee_sema_t::max_count, MAX_VOLUME, NULL, ee_sema_t::option, SifInitRpc(), SifLoadModule(), and WaitSema().