void finalize_audio_data();
void clear_audio_data();
- void start_streaming_current_utterance_data(long start_time = 0);
+ void start_streaming_current_utterance_data(long long start_time = 0);
void stop_streaming_current_utterance_data();
void start_streaming_previous_utterance_data();
void set_background_volume(double ratio);
private:
- void add_audio_data(mas_speech_data& data, long time);
+ void add_audio_data(mas_speech_data& data, long long time);
void notify_audio_data_recording(long time, void* data, int len);
void streaming_previous_audio_data_thread_func();
- void streaming_audio_data_thread_func(long start_time);
+ void streaming_audio_data_thread_func(long long start_time);
int mSoundFocusWatchId{0};
bool mRecordingRequired{false};
thread mStreamingPreviousThread;
atomic_bool mStopStreamingPreviousThread{false};
- static constexpr long mAudioRecordingDurationMilliseconds = 10 * 1000;
+ static constexpr long long mAudioRecordingDurationMilliseconds = 10 * 1000;
typedef struct {
- long time;
+ long long time;
mas_speech_data data;
} mas_speech_data_with_time;
vector<mas_speech_data_with_time> mPreviousAudioData;
/* Need to check whether this value needs to be configurable */
static int g_speech_pcm_wait_count = 800;
-static long get_current_milliseconds_after_epoch()
+static long long get_current_milliseconds_after_epoch()
{
auto now = chrono::system_clock::now();
auto now_ms = chrono::time_point_cast<chrono::milliseconds>(now);
MWR_LOGI("[EXIT]");
}
-void CAudioManager::streaming_audio_data_thread_func(long start_time)
+void CAudioManager::streaming_audio_data_thread_func(long long start_time)
{
MWR_LOGI("[ENTER]");
MWR_LOGI("[EXIT]");
}
-void CAudioManager::add_audio_data(mas_speech_data& data, long time)
+void CAudioManager::add_audio_data(mas_speech_data& data, long long time)
{
- long delta = mAudioRecordingDurationMilliseconds;
+ long long delta = mAudioRecordingDurationMilliseconds;
notify_audio_data_recording(time, data.buffer, data.len);
mas_speech_data speech_data;
speech_data.buffer = vm_malloc_simple(len);
if (speech_data.buffer) {
- long time = get_current_milliseconds_after_epoch();
+ long long time = get_current_milliseconds_after_epoch();
speech_data.event = event;
speech_data.len = len;
speech_data.len = sizeof(final_buffer);
speech_data.buffer = vm_malloc_simple(speech_data.len);
if (speech_data.buffer) {
- long time = get_current_milliseconds_after_epoch();
+ long long time = get_current_milliseconds_after_epoch();
memcpy(speech_data.buffer, final_buffer, speech_data.len);
add_audio_data(speech_data, time);
}
}
-void CAudioManager::start_streaming_current_utterance_data(long start_time)
+void CAudioManager::start_streaming_current_utterance_data(long long start_time)
{
if (mStreamingThread.joinable()) {
MWR_LOGE("ERROR : mStreamingThread is joinable, will not start a new thread");