// start playback of the red alert voice void red_alert_voice_play() { if ( !Briefing_voice_enabled ) { return; } if ( Red_alert_voice < 0 ) { // play simulated speech? if (fsspeech_play_from(FSSPEECH_FROM_BRIEFING)) { if (fsspeech_playing()) { return; } fsspeech_play(FSSPEECH_FROM_BRIEFING, Briefing->stages[0].text.c_str()); Red_alert_voice_started = 1; } } else { if (audiostream_is_playing(Red_alert_voice)) { return; } audiostream_play(Red_alert_voice, Master_voice_volume, 0); Red_alert_voice_started = 1; } }
int cmd_brief_check_stage_done() { if (!Voice_good_to_go) return 0; if (Cmd_brief_paused) return 0; if (Voice_ended_time && (timer_get_milliseconds() - Voice_ended_time >= 1000)) return 1; // check normal speech if (Briefing_voice_enabled && (Cmd_brief_last_voice >= 0)) { if (audiostream_is_playing(Cmd_brief_last_voice)) { return 0; } if (!Voice_ended_time) { Voice_ended_time = timer_get_milliseconds(); } return 0; } // check simulated speech if (Briefing_voice_enabled && (Cmd_brief_last_stage >= 0)) { if (fsspeech_playing()) { return 0; } if (!Voice_ended_time) { Voice_ended_time = timer_get_milliseconds(); } return 0; } // if we get here, there is no voice, so we simulate the time it would take instead if (!Voice_ended_time) Voice_ended_time = Voice_started_time + MAX(5000, Num_brief_text_lines[0] * 3500); return 0; }