FreeCalypso > hg > fc-magnetite
diff src/aci2/aci/ati_audio.c @ 239:e0b9c21d7908
AT@TONE and AT@TSTOP audio test commands implemented
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 22 Mar 2017 04:51:29 +0000 |
parents | 67fe1b3f4bd7 |
children | 9034c3a7267e |
line wrap: on
line diff
--- a/src/aci2/aci/ati_audio.c Mon Mar 20 04:00:10 2017 +0000 +++ b/src/aci2/aci/ati_audio.c Wed Mar 22 04:51:29 2017 +0000 @@ -139,4 +139,52 @@ return (ATI_FAIL); } +/* AT@TONE - exercise TONES through RiViera Audio Service API */ +GLOBAL T_ATI_RSLT atAtTONE ( char *cl, UBYTE srcId ) +{ + int tone_start[3], tone_stop[3], tone_freq[3], tone_ampl[3]; + int frame_dur, sequence_dur, period_dur, repetition; + int i; + T_AUDIO_TONES_PARAMETER t; + T_RV_RETURN return_path; + + cl = parse(cl, "DDDDDDDDDDDDDDDD", + &tone_start[0], &tone_stop[0], &tone_freq[0], &tone_ampl[0], + &tone_start[1], &tone_stop[1], &tone_freq[1], &tone_ampl[1], + &tone_start[2], &tone_stop[2], &tone_freq[2], &tone_ampl[2], + &frame_dur, &sequence_dur, &period_dur, &repetition); + if (!cl) + return (ATI_FAIL); + for (i = 0; i < 3; i++) { + t.tones[i].start_tone = tone_start[i]; + t.tones[i].stop_tone = tone_stop[i]; + t.tones[i].frequency_tone = tone_freq[i]; + t.tones[i].amplitude_tone = -tone_ampl[i]; + } + t.frame_duration = frame_dur; + t.sequence_duration = sequence_dur; + t.period_duration = period_dur; + t.repetition = repetition; + + return_path.addr_id = NULL; + return_path.callback_func = audio_callback; + if (audio_tones_start(&t, return_path) == AUDIO_OK) + return (ATI_CMPL); + else + return (ATI_FAIL); +} + +/* AT@TSTOP - stop tones started with AT@TONE */ +GLOBAL T_ATI_RSLT atAtTSTOP ( char *cl, UBYTE srcId ) +{ + T_RV_RETURN return_path; + + return_path.addr_id = NULL; + return_path.callback_func = audio_callback; + if (audio_tones_stop(return_path) == AUDIO_OK) + return (ATI_CMPL); + else + return (ATI_FAIL); +} + #endif /* ATI_AUDIO_C */