#ifdef TV_PRODUCT
#define TV_BT_MODE
-//#define TV_FFV_MODE
+#define TV_FFV_MODE
#endif
#include <audio_io.h>
g_buffer_count++;
if (NULL != g_audio_cb) {
- if (0 != g_audio_cb(data, length)) {
+ unsigned int mono_length = length / 2;
+ char mono_data[mono_length];
+ char* char_data = (char*)data;
+ int cnt = 0;
+ while (cnt < mono_length) {
+ mono_data[cnt] = char_data[cnt * 2 + 1]; // 2nd channel
+ cnt++;
+ }
+ if (0 != g_audio_cb(mono_data, mono_length)) {
SLOG(LOG_ERROR, TAG_STTD, "[Recorder ERROR] Fail to read audio");
sttd_recorder_stop();
}
return;
}
- float vol_db = get_volume_decibel((char*)data, (int)length, g_recorder->audio_type);
+ float vol_db = get_volume_decibel((char*)mono_data, (int)mono_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);
}