+#ifdef TV_FFV_MODE
+static void _ffv_audio_function_cb(void* data, unsigned int length, void* user_data)
+{
+ if (STTD_RECORDER_STATE_RECORDING != g_recorder_state) {
+ SLOG(LOG_INFO, TAG_STTD, "[Recorder] Exit audio reading normal func");
+ return;
+ }
+
+ if (0 >= sttd_client_get_ref_count()) {
+ if (0 == g_buffer_count % 50) {
+ SLOG(LOG_INFO, TAG_STTD, "[Recorder INFO] farfield audio function callback is invoked, but no cliet");
+
+ if (100000 == g_buffer_count) {
+ g_buffer_count = 0;
+ }
+ }
+ g_buffer_count++;
+ return;
+ }
+
+ if (false == g_is_set_audio_type) {
+ sttd_engine_agent_set_audio_type(STTE_AUDIO_ID_FFV);
+ g_is_set_audio_type = true;
+ }
+
+ if (0 == g_buffer_count % 50) {
+ SLOG(LOG_INFO, TAG_STTD, "[Recorder INFO] farfield audio function callback is invoked");
+
+ if (100000 == g_buffer_count) {
+ g_buffer_count = 0;
+ }
+ }
+
+ g_buffer_count++;
+
+ if (NULL != g_audio_cb) {
+ if (0 != g_audio_cb(data, length)) {
+ SLOG(LOG_ERROR, TAG_STTD, "[Recorder ERROR] Fail to read audio");
+ sttd_recorder_stop();
+ }
+
+ if (NULL == g_recorder) {
+ SLOG(LOG_INFO, TAG_STTD, "[Recorder INFO] g_recoder is NULL");
+ return;
+ }
+
+ float vol_db = get_volume_decibel((char*)data, (int)length, g_recorder->audio_type);
+ if (0 != sttdc_send_set_volume(g_recorder->uid, vol_db)) {
+ SLOG(LOG_ERROR, TAG_STTD, "[Recorder] Fail to send recording volume(%f)", vol_db);
+ }
+ }
+}
+#endif