#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.
|
int | main (int argc, char **argv) |
|
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 23 of file playwav.c.
34 printf(
"sample: kicking IRXs\n");
36 printf(
"libsd loadmodule %d\n", ret);
38 printf(
"sample: loading audsrv\n");
40 printf(
"audsrv loadmodule %d\n", ret);
45 printf(
"sample: failed to initialize audsrv\n");
54 printf(
"set format returned %d\n", err);
59 wav = fopen(
"host:song_22k.wav",
"rb");
62 printf(
"failed to open wav file\n");
67 fseek(wav, 0x30, SEEK_SET);
69 printf(
"starting play loop\n");
73 ret = fread(chunk, 1,
sizeof(chunk), wav);
80 if (ret <
sizeof(chunk))
92 if (played == 512)
break;
97 printf(
"sample: stopping audsrv\n");
100 printf(
"sample: ended\n");
const char * audsrv_get_error_string()
int audsrv_play_audio(const char *chunk, int bytes)
int audsrv_set_volume(int volume)
int audsrv_wait_audio(int bytes)
int audsrv_set_format(struct audsrv_fmt_t *fmt)
int SifLoadModule(const char *path, int arg_len, const char *args)
void SifInitRpc(int mode)
References audsrv_get_error_string(), audsrv_init(), audsrv_play_audio(), audsrv_quit(), audsrv_set_format(), audsrv_set_volume(), audsrv_wait_audio(), audsrv_fmt_t::bits, audsrv_fmt_t::channels, audsrv_fmt_t::freq, MAX_VOLUME, NULL, SifInitRpc(), and SifLoadModule().