comparison src/g23m-aci/aci/ati_audio.c @ 564:ade27cd84b97

aci3: implemented loopback option for AT@E1 and AT@E2
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 07 Jan 2019 00:47:48 +0000
parents d648cafa30cf
children f18b29e27be5
comparison
equal deleted inserted replaced
563:d648cafa30cf 564:ade27cd84b97
218 218
219 /* AT@E1 - play an E1 format melody */ 219 /* AT@E1 - play an E1 format melody */
220 GLOBAL T_ATI_RSLT atAtE1 ( char *cl, UBYTE srcId ) 220 GLOBAL T_ATI_RSLT atAtE1 ( char *cl, UBYTE srcId )
221 { 221 {
222 T_AUDIO_MELODY_E1_PARAMETER e1_param; 222 T_AUDIO_MELODY_E1_PARAMETER e1_param;
223 T_RV_RETURN return_path; 223 int loopback = 0;
224 224 T_RV_RETURN return_path;
225 cl = parse(cl, "S", (LONG)(sizeof(e1_param.melody_name)), 225
226 e1_param.melody_name); 226 cl = parse(cl, "Sd", (LONG)(sizeof(e1_param.melody_name)),
227 e1_param.melody_name, &loopback);
227 if (!cl || !e1_param.melody_name[0]) 228 if (!cl || !e1_param.melody_name[0])
228 return (ATI_FAIL); 229 return (ATI_FAIL);
229 e1_param.loopback = AUDIO_MELODY_NO_LOOPBACK; 230 e1_param.loopback = loopback;
230 e1_param.melody_mode = AUDIO_MELODY_NORMAL_MODE; 231 e1_param.melody_mode = AUDIO_MELODY_NORMAL_MODE;
231 232
232 return_path.addr_id = NULL; 233 return_path.addr_id = NULL;
233 return_path.callback_func = audio_callback; 234 return_path.callback_func = audio_callback;
234 if (audio_melody_E1_start(&e1_param, return_path) == AUDIO_OK) { 235 if (audio_melody_E1_start(&e1_param, return_path) == AUDIO_OK) {
260 261
261 /* AT@E2 - play an E2 format melody */ 262 /* AT@E2 - play an E2 format melody */
262 GLOBAL T_ATI_RSLT atAtE2 ( char *cl, UBYTE srcId ) 263 GLOBAL T_ATI_RSLT atAtE2 ( char *cl, UBYTE srcId )
263 { 264 {
264 T_AUDIO_MELODY_E2_PARAMETER e2_param; 265 T_AUDIO_MELODY_E2_PARAMETER e2_param;
265 T_RV_RETURN return_path; 266 int loopback = 0;
266 267 T_RV_RETURN return_path;
267 cl = parse(cl, "S", (LONG)(sizeof(e2_param.melody_E2_name)), 268
268 e2_param.melody_E2_name); 269 cl = parse(cl, "Sd", (LONG)(sizeof(e2_param.melody_E2_name)),
270 e2_param.melody_E2_name, &loopback);
269 if (!cl || !e2_param.melody_E2_name[0]) 271 if (!cl || !e2_param.melody_E2_name[0])
270 return (ATI_FAIL); 272 return (ATI_FAIL);
271 e2_param.E2_loopback = AUDIO_MELODY_NO_LOOPBACK; 273 e2_param.E2_loopback = loopback;
272 e2_param.melody_E2_mode = AUDIO_MELODY_NORMAL_MODE; 274 e2_param.melody_E2_mode = AUDIO_MELODY_NORMAL_MODE;
273 275
274 return_path.addr_id = NULL; 276 return_path.addr_id = NULL;
275 return_path.callback_func = audio_callback; 277 return_path.callback_func = audio_callback;
276 if (audio_melody_E2_start(&e2_param, return_path) == AUDIO_OK) { 278 if (audio_melody_E2_start(&e2_param, return_path) == AUDIO_OK) {