From 6bbe793e3f2b2cf0846a1d5fe4ab9a573b86ba12 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Wed, 9 Jan 2019 23:42:55 +0100 Subject: [PATCH] [DEV] add parameters to heve a good recorder application --- .../lutin_recoAnalyser.cpython-37.pyc | Bin {recoAnalyser => analyser}/appl/debug.cpp | 2 +- {recoAnalyser => analyser}/appl/debug.hpp | 0 {recoAnalyser => analyser}/appl/main.cpp | 0 .../lutin_audio-reco-analyser.py | 0 readme.md | 38 ++++++ .../__pycache__/lutin_recoWord.cpython-37.pyc | Bin {recoWord => wordRecorder}/appl/Windows.cpp | 111 +++++++++++++++--- {recoWord => wordRecorder}/appl/Windows.hpp | 23 ++-- {recoWord => wordRecorder}/appl/debug.cpp | 2 +- {recoWord => wordRecorder}/appl/debug.hpp | 0 {recoWord => wordRecorder}/appl/main.cpp | 83 ++++++++----- .../appl/widget/DataViewer.cpp | 32 +++-- .../appl/widget/DataViewer.hpp | 3 +- .../appl/wordList_FR.cpp | 7 ++ .../appl/wordList_FR.hpp | 1 + .../appl/wordList_FR_ordered.cpp | 0 .../appl/wordList_FR_ordered.hpp | 0 wordRecorder/appl/wordList_FR_selected.cpp | 61 ++++++++++ wordRecorder/appl/wordList_FR_selected.hpp | 15 +++ wordRecorder/appl/wordList_number.cpp | 25 ++++ wordRecorder/appl/wordList_number.hpp | 15 +++ .../lutin_audio-reco-wordRecorder.py | 4 +- 23 files changed, 357 insertions(+), 65 deletions(-) rename {recoAnalyser => analyser}/__pycache__/lutin_recoAnalyser.cpython-37.pyc (100%) rename {recoAnalyser => analyser}/appl/debug.cpp (74%) rename {recoAnalyser => analyser}/appl/debug.hpp (100%) rename {recoAnalyser => analyser}/appl/main.cpp (100%) rename recoAnalyser/lutin_recoAnalyser.py => analyser/lutin_audio-reco-analyser.py (100%) rename {recoWord => wordRecorder}/__pycache__/lutin_recoWord.cpython-37.pyc (100%) rename {recoWord => wordRecorder}/appl/Windows.cpp (50%) rename {recoWord => wordRecorder}/appl/Windows.hpp (63%) rename {recoWord => wordRecorder}/appl/debug.cpp (73%) rename {recoWord => wordRecorder}/appl/debug.hpp (100%) rename {recoWord => wordRecorder}/appl/main.cpp (53%) rename {recoWord => wordRecorder}/appl/widget/DataViewer.cpp (92%) rename {recoWord => wordRecorder}/appl/widget/DataViewer.hpp (91%) rename {recoWord => wordRecorder}/appl/wordList_FR.cpp (99%) rename {recoWord => wordRecorder}/appl/wordList_FR.hpp (90%) rename {recoWord => wordRecorder}/appl/wordList_FR_ordered.cpp (100%) rename {recoWord => wordRecorder}/appl/wordList_FR_ordered.hpp (100%) create mode 100644 wordRecorder/appl/wordList_FR_selected.cpp create mode 100644 wordRecorder/appl/wordList_FR_selected.hpp create mode 100644 wordRecorder/appl/wordList_number.cpp create mode 100644 wordRecorder/appl/wordList_number.hpp rename recoWord/lutin_recoWord.py => wordRecorder/lutin_audio-reco-wordRecorder.py (89%) diff --git a/recoAnalyser/__pycache__/lutin_recoAnalyser.cpython-37.pyc b/analyser/__pycache__/lutin_recoAnalyser.cpython-37.pyc similarity index 100% rename from recoAnalyser/__pycache__/lutin_recoAnalyser.cpython-37.pyc rename to analyser/__pycache__/lutin_recoAnalyser.cpython-37.pyc diff --git a/recoAnalyser/appl/debug.cpp b/analyser/appl/debug.cpp similarity index 74% rename from recoAnalyser/appl/debug.cpp rename to analyser/appl/debug.cpp index 93b4d60..cbc86b9 100644 --- a/recoAnalyser/appl/debug.cpp +++ b/analyser/appl/debug.cpp @@ -8,6 +8,6 @@ int32_t appl::getLogId() { - static int32_t g_val = elog::registerInstance("RecoWord"); + static int32_t g_val = elog::registerInstance("audio-reco-analyser"); return g_val; } diff --git a/recoAnalyser/appl/debug.hpp b/analyser/appl/debug.hpp similarity index 100% rename from recoAnalyser/appl/debug.hpp rename to analyser/appl/debug.hpp diff --git a/recoAnalyser/appl/main.cpp b/analyser/appl/main.cpp similarity index 100% rename from recoAnalyser/appl/main.cpp rename to analyser/appl/main.cpp diff --git a/recoAnalyser/lutin_recoAnalyser.py b/analyser/lutin_audio-reco-analyser.py similarity index 100% rename from recoAnalyser/lutin_recoAnalyser.py rename to analyser/lutin_audio-reco-analyser.py diff --git a/readme.md b/readme.md index e69de29..2c18993 100644 --- a/readme.md +++ b/readme.md @@ -0,0 +1,38 @@ +audio-reco +========== + +`audio-reco` is simple audio recognition engine build from scratch + +Instructions +============ + +Note: + + depend on etk library (MPL v2.0) + +To create a corpus: + + lutin.py audio-reco-wordRecorder?build?run + +Analyse the corpus and create the "model": + + lutin.py audio-reco-analyser?build?run:--corpus=~/.local/shared/audio-reco-wordRecorder/corpus + lutin.py audio-reco-analyser?build?run:--corpus=~/.local/shared/audio-reco-wordRecorder/corpus:--help + lutin -cclang -mrelease audio-reco-wordRecorder?build?run:--elog-level=3:--user_name=Edouard_DUPIN:--user_birth_year=1983:--source_type=ORDERED_WORD + + +License (MPL v2.0) +===================== +Copyright audio Edouard DUPIN + +Licensed under the Mozilla Public License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.mozilla.org/MPL/2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/recoWord/__pycache__/lutin_recoWord.cpython-37.pyc b/wordRecorder/__pycache__/lutin_recoWord.cpython-37.pyc similarity index 100% rename from recoWord/__pycache__/lutin_recoWord.cpython-37.pyc rename to wordRecorder/__pycache__/lutin_recoWord.cpython-37.pyc diff --git a/recoWord/appl/Windows.cpp b/wordRecorder/appl/Windows.cpp similarity index 50% rename from recoWord/appl/Windows.cpp rename to wordRecorder/appl/Windows.cpp index e421c91..468bb06 100644 --- a/recoWord/appl/Windows.cpp +++ b/wordRecorder/appl/Windows.cpp @@ -13,14 +13,51 @@ #include #include #include +#include +#include + +#include +ETK_DECLARE_TYPE(appl::Windows); +ETK_DECLARE_TYPE(appl::wordMode); appl::Windows::Windows() : propertyCount(this, "count", 5, "Number of time we restart a record"), + propertyInput(this, "input", + "microphone", + "play microphone stream", + &appl::Windows::inputChangeValue), + propertyRandom(this, "random", + false, + "play in random mode"), + propertyCorpusPath(this, "corpus-path", + "USER_DATA:///corpus/" + etk::toString(echrono::Clock::now()), + "corpus root path"), + propertyUserName(this, "user-name", + "Unknow", + "User name to identify the corpus source"), + propertyUserBirthYear(this, "user-year", + 0, + "Birth year of the user to distingush the age of the user"), + propertyWordMode(this, "word-mode", + appl::wordMode::wordMode_ALL_WORD, + "Word list mode"), m_composer(null) { addObjectType("appl::Windows"); propertyTitle.setDirectCheck("River IO viewer"); + // set property list: + propertyWordMode.add(appl::wordMode::wordMode_ALL_WORD, "ALL_WORD"); + propertyWordMode.add(appl::wordMode::wordMode_ORDERED_WORD, "ORDERED_WORD"); + propertyWordMode.add(appl::wordMode::wordMode_SELECTED_WORD, "SELECTED_WORD"); + propertyWordMode.add(appl::wordMode::wordMode_NUMBER, "NUMBER"); +} + +void appl::Windows::inputChangeValue() { + ememory::SharedPtr tmpDisp = ememory::dynamicPointerCast(getSubObjectNamed("displayer")); + if (tmpDisp != null) { + tmpDisp->propertyInput.set(propertyInput.get()); + } } void appl::Windows::init() { @@ -39,6 +76,11 @@ void appl::Windows::init() { composition += " Reset Currrent Record\n"; composition += " \n"; composition += " \n"; + composition += " \n"; composition += " \n"; composition += "