diff --git a/conversion_simple_en.py b/conversion_simple_en.py new file mode 100644 index 0000000..fd92135 --- /dev/null +++ b/conversion_simple_en.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python3 + +from vosk import Model, KaldiRecognizer, SetLogLevel +import sys +import os +import wave + +SetLogLevel(0) +# print(" ------- conversion simple de", sys.argv[1]) + +if not os.path.exists("models/fr"): + print ("Please download the model from https://alphacephei.com/vosk/models and unpack as 'models' in the current folder.") + exit (1) + + +wf = wave.open(sys.argv[1], "rb") +if wf.getnchannels() != 1 or wf.getsampwidth() != 2 or wf.getcomptype() != "NONE": + print ("Audio file must be WAV format mono PCM.") + exit (1) + +model = Model("models/fr") +rec = KaldiRecognizer(model, wf.getframerate()) + +while True: + data = wf.readframes(4000) + if len(data) == 0: + break + if rec.AcceptWaveform(data): + print(rec.Result()) + +print(rec.FinalResult()) diff --git a/input/ydl/.gitkeep b/input/ydl/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/input/ydl/uniqueid.mp3 b/input/ydl/uniqueid.mp3 new file mode 100644 index 0000000..912ce7d Binary files /dev/null and b/input/ydl/uniqueid.mp3 differ diff --git a/input/ydl/uniqueid/0_output_.json b/input/ydl/uniqueid/0_output_.json new file mode 100644 index 0000000..bf7e0c4 --- /dev/null +++ b/input/ydl/uniqueid/0_output_.json @@ -0,0 +1,12 @@ +{ + "text" : "" +} +{ + "text" : "" +} +{ + "text" : "" +} +{ + "text" : "" +} diff --git a/input/ydl/uniqueid/1_converted_.txt b/input/ydl/uniqueid/1_converted_.txt new file mode 100644 index 0000000..faff115 --- /dev/null +++ b/input/ydl/uniqueid/1_converted_.txt @@ -0,0 +1,4 @@ +"" +"" +"" +"" diff --git a/input/ydl/uniqueid/2_without_nulls_.txt b/input/ydl/uniqueid/2_without_nulls_.txt new file mode 100644 index 0000000..faff115 --- /dev/null +++ b/input/ydl/uniqueid/2_without_nulls_.txt @@ -0,0 +1,4 @@ +"" +"" +"" +"" diff --git a/input/ydl/uniqueid/3_without_nulls_.txt b/input/ydl/uniqueid/3_without_nulls_.txt new file mode 100644 index 0000000..faff115 --- /dev/null +++ b/input/ydl/uniqueid/3_without_nulls_.txt @@ -0,0 +1,4 @@ +"" +"" +"" +"" diff --git a/input/ydl/uniqueid/4_phrases_.txt b/input/ydl/uniqueid/4_phrases_.txt new file mode 100644 index 0000000..fd40910 --- /dev/null +++ b/input/ydl/uniqueid/4_phrases_.txt @@ -0,0 +1,4 @@ + + + + diff --git a/input/ydl/uniqueid/uniqueid.wav b/input/ydl/uniqueid/uniqueid.wav new file mode 100644 index 0000000..adea15c Binary files /dev/null and b/input/ydl/uniqueid/uniqueid.wav differ diff --git a/input/ydl/uniqueid_facho.mp3 b/input/ydl/uniqueid_facho.mp3 new file mode 100644 index 0000000..667a681 Binary files /dev/null and b/input/ydl/uniqueid_facho.mp3 differ diff --git a/input/ydl/uniqueid_facho/0_output_.json b/input/ydl/uniqueid_facho/0_output_.json new file mode 100644 index 0000000..1fd7f8f --- /dev/null +++ b/input/ydl/uniqueid_facho/0_output_.json @@ -0,0 +1,44 @@ +{ + "result" : [{ + "conf" : 0.545601, + "end" : 0.120000, + "start" : 0.000000, + "word" : "les" + }, { + "conf" : 0.658098, + "end" : 0.600019, + "start" : 0.180000, + "word" : "fascistes" + }, { + "conf" : 0.911231, + "end" : 0.719916, + "start" : 0.660000, + "word" : "de" + }, { + "conf" : 0.885049, + "end" : 1.109087, + "start" : 0.719916, + "word" : "merde" + }, { + "conf" : 0.512951, + "end" : 1.530000, + "start" : 1.380000, + "word" : "un" + }, { + "conf" : 0.840160, + "end" : 2.430000, + "start" : 1.547196, + "word" : "fasciste" + }, { + "conf" : 0.992080, + "end" : 2.609995, + "start" : 2.490000, + "word" : "de" + }, { + "conf" : 0.994251, + "end" : 3.210000, + "start" : 2.609995, + "word" : "merde" + }], + "text" : "les fascistes de merde un fasciste de merde" +} diff --git a/input/ydl/uniqueid_facho/1_converted_.txt b/input/ydl/uniqueid_facho/1_converted_.txt new file mode 100644 index 0000000..03d4e78 --- /dev/null +++ b/input/ydl/uniqueid_facho/1_converted_.txt @@ -0,0 +1 @@ +"les fascistes de merde un fasciste de merde" diff --git a/input/ydl/uniqueid_facho/2_without_nulls_.txt b/input/ydl/uniqueid_facho/2_without_nulls_.txt new file mode 100644 index 0000000..03d4e78 --- /dev/null +++ b/input/ydl/uniqueid_facho/2_without_nulls_.txt @@ -0,0 +1 @@ +"les fascistes de merde un fasciste de merde" diff --git a/input/ydl/uniqueid_facho/3_without_nulls_.txt b/input/ydl/uniqueid_facho/3_without_nulls_.txt new file mode 100644 index 0000000..03d4e78 --- /dev/null +++ b/input/ydl/uniqueid_facho/3_without_nulls_.txt @@ -0,0 +1 @@ +"les fascistes de merde un fasciste de merde" diff --git a/input/ydl/uniqueid_facho/4_phrases_.txt b/input/ydl/uniqueid_facho/4_phrases_.txt new file mode 100644 index 0000000..f2b106f --- /dev/null +++ b/input/ydl/uniqueid_facho/4_phrases_.txt @@ -0,0 +1 @@ +les fascistes de merde un fasciste de merde diff --git a/input/ydl/uniqueid_facho/uniqueid_facho.wav b/input/ydl/uniqueid_facho/uniqueid_facho.wav new file mode 100644 index 0000000..9291c60 Binary files /dev/null and b/input/ydl/uniqueid_facho/uniqueid_facho.wav differ diff --git a/website/download.php b/website/download.php index 5bfab8e..56720ab 100644 --- a/website/download.php +++ b/website/download.php @@ -1,55 +1,73 @@ +