FreeCalypso > hg > fc-magnetite
comparison 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 |
comparison
equal
deleted
inserted
replaced
238:828a6898241e | 239:e0b9c21d7908 |
---|---|
137 return (ATI_CMPL); | 137 return (ATI_CMPL); |
138 else | 138 else |
139 return (ATI_FAIL); | 139 return (ATI_FAIL); |
140 } | 140 } |
141 | 141 |
142 /* AT@TONE - exercise TONES through RiViera Audio Service API */ | |
143 GLOBAL T_ATI_RSLT atAtTONE ( char *cl, UBYTE srcId ) | |
144 { | |
145 int tone_start[3], tone_stop[3], tone_freq[3], tone_ampl[3]; | |
146 int frame_dur, sequence_dur, period_dur, repetition; | |
147 int i; | |
148 T_AUDIO_TONES_PARAMETER t; | |
149 T_RV_RETURN return_path; | |
150 | |
151 cl = parse(cl, "DDDDDDDDDDDDDDDD", | |
152 &tone_start[0], &tone_stop[0], &tone_freq[0], &tone_ampl[0], | |
153 &tone_start[1], &tone_stop[1], &tone_freq[1], &tone_ampl[1], | |
154 &tone_start[2], &tone_stop[2], &tone_freq[2], &tone_ampl[2], | |
155 &frame_dur, &sequence_dur, &period_dur, &repetition); | |
156 if (!cl) | |
157 return (ATI_FAIL); | |
158 for (i = 0; i < 3; i++) { | |
159 t.tones[i].start_tone = tone_start[i]; | |
160 t.tones[i].stop_tone = tone_stop[i]; | |
161 t.tones[i].frequency_tone = tone_freq[i]; | |
162 t.tones[i].amplitude_tone = -tone_ampl[i]; | |
163 } | |
164 t.frame_duration = frame_dur; | |
165 t.sequence_duration = sequence_dur; | |
166 t.period_duration = period_dur; | |
167 t.repetition = repetition; | |
168 | |
169 return_path.addr_id = NULL; | |
170 return_path.callback_func = audio_callback; | |
171 if (audio_tones_start(&t, return_path) == AUDIO_OK) | |
172 return (ATI_CMPL); | |
173 else | |
174 return (ATI_FAIL); | |
175 } | |
176 | |
177 /* AT@TSTOP - stop tones started with AT@TONE */ | |
178 GLOBAL T_ATI_RSLT atAtTSTOP ( char *cl, UBYTE srcId ) | |
179 { | |
180 T_RV_RETURN return_path; | |
181 | |
182 return_path.addr_id = NULL; | |
183 return_path.callback_func = audio_callback; | |
184 if (audio_tones_stop(return_path) == AUDIO_OK) | |
185 return (ATI_CMPL); | |
186 else | |
187 return (ATI_FAIL); | |
188 } | |
189 | |
142 #endif /* ATI_AUDIO_C */ | 190 #endif /* ATI_AUDIO_C */ |