Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(461)

Unified Diff: webrtc/modules/audio_processing/test/conversational_speech/multiend_call.h

Issue 2781573002: Conversational Speech tool, MultiEndCall::CheckTiming() and tests (Closed)
Patch Set: rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_processing/test/conversational_speech/multiend_call.h
diff --git a/webrtc/modules/audio_processing/test/conversational_speech/multiend_call.h b/webrtc/modules/audio_processing/test/conversational_speech/multiend_call.h
index 234cb2799e34a45db318dcb5e7bd2cd9a580bc8f..2af742453173f6e1785a7412debd87bf3c279827 100644
--- a/webrtc/modules/audio_processing/test/conversational_speech/multiend_call.h
+++ b/webrtc/modules/audio_processing/test/conversational_speech/multiend_call.h
@@ -15,6 +15,8 @@
#include <memory>
#include <set>
#include <string>
+#include <utility>
+#include <vector>
#include "webrtc/base/array_view.h"
#include "webrtc/base/constructormagic.h"
@@ -36,16 +38,26 @@ class MultiEndCall {
const std::set<std::string>& speaker_names() const;
const std::map<std::string, std::unique_ptr<WavReaderInterface>>&
audiotrack_readers() const;
+ bool valid();
private:
- // Find unique speaker names.
+ typedef std::pair<std::size_t, std::size_t> Interval;
+ typedef std::vector<Interval> IntervalsVector;
+
+ // Finds unique speaker names.
void FindSpeakerNames();
- // Create one WavReader instance for each unique audiotrack.
+ // Creates one WavReader instance for each unique audiotrack.
void CreateAudioTrackReaders();
- // Check the speaking turns timing.
- void CheckTiming();
+ // Validates the speaking turns timing information. Accepts cross-talk, but
+ // only up to 2 speakers. Rejects unordered turns and self cross-talk.
+ bool CheckTiming() const;
+
+ // Detects cross-talk, which occurs when two turns from the same speaker
+ // overlap in time.
+ bool DetectSelfCrossTalk(IntervalsVector* speaker_intervals)
+ const;
rtc::ArrayView<const Turn> timing_;
const std::string& audiotracks_path_;
@@ -53,6 +65,7 @@ class MultiEndCall {
std::set<std::string> speaker_names_;
std::map<std::string, std::unique_ptr<WavReaderInterface>>
audiotrack_readers_;
+ bool valid_;
RTC_DISALLOW_COPY_AND_ASSIGN(MultiEndCall);
};

Powered by Google App Engine
This is Rietveld 408576698