int audsrv_set_volume(int volume) { if (volume > MAX_VOLUME) { volume = MAX_VOLUME; } else if (volume < MIN_VOLUME) { volume = MIN_VOLUME; } return call_rpc_1(AUDSRV_SET_VOLUME, vol_values[volume/4]); }
int audsrv_on_fillbuf(int amount, audsrv_callback_t cb, void *arg) { int err; on_fillbuf = 0; on_fillbuf_arg = 0; err = call_rpc_1(AUDSRV_SET_THRESHOLD, amount); if (err != 0) { return err; } on_fillbuf = cb; on_fillbuf_arg = arg; return AUDSRV_ERR_NOERROR; }
/** Sets output volume @param vol volume in percentage @returns error code */ int audsrv_set_volume(int volume) { unsigned short vol_values[26] = { 0x0000, 0x0000, 0x0096, 0x0190, 0x0230, 0x0320, 0x042E, 0x0532, 0x05FA, 0x06C2, 0x088E, 0x09F6, 0x0BC2, 0x0DC0, 0x0FF0, 0x118A, 0x1482, 0x1752, 0x1B4E, 0x1F40, 0x2378, 0x28D2, 0x2EFE, 0x34F8, 0x3A5C, 0x3FFF }; if (volume > 100) { volume = 100; } else if (volume < 0) { volume = 0; } return call_rpc_1(AUDSRV_SET_VOLUME, vol_values[volume/4]); }
int audsrv_get_numtracks() { return call_rpc_1(AUDSRV_GET_NUMTRACKS, 0); }
int audsrv_stop_audio() { int ret; ret = call_rpc_1(AUDSRV_STOP_AUDIO, 0); return ret; }
int audsrv_adpcm_init() { return call_rpc_1(AUDSRV_INIT_ADPCM, 0); }
int audsrv_get_cd_type() { return call_rpc_1(AUDSRV_GET_CD_TYPE, 0); }
int audsrv_get_cd_status() { return call_rpc_1(AUDSRV_GET_CD_STATUS, 0); }
int audsrv_pause_cd() { return call_rpc_1(AUDSRV_PAUSE_CD, 0); }
int audsrv_resume_cd() { return call_rpc_1(AUDSRV_RESUME_CD, 0); }
/** Plays an adpcm sample already uploaded with audsrv_load_adpcm() @param adpcm exact same adpcm descriptor used in load() @returns zero on success, negative value on error The sample will be played in an unoccupied channel. If all 24 channels are used, then -AUDSRV_ERR_NO_MORE_CHANNELS is returned. Trying to play a sample which is unavailable will result in -AUDSRV_ERR_ARGS */ int audsrv_play_adpcm(audsrv_adpcm_t *adpcm) { /* on iop side, the sample id is like the pointer on ee side */ return call_rpc_1(AUDSRV_PLAY_ADPCM, (u32)adpcm); }
int audsrv_get_track_offset(int track) { return call_rpc_1(AUDSRV_GET_TRACKOFFSET, track); }
int audsrv_get_trackpos() { return call_rpc_1(AUDSRV_GET_TRACKPOS, 0); }
int audsrv_get_cdpos() { return call_rpc_1(AUDSRV_GET_CDPOS, 0); }
int audsrv_stop_cd() { int ret; ret = call_rpc_1(AUDSRV_STOP_CD, 0); return ret; }
int audsrv_play_cd(int track) { return call_rpc_1(AUDSRV_PLAY_CD, track); }
int audsrv_wait_audio(int bytes) { return call_rpc_1(AUDSRV_WAIT_AUDIO, bytes); }