Compare commits

...

2 Commits

Author SHA1 Message Date
Nickolay Shmyrev b1b216d4c8 Bump versions 2022-05-26 15:22:16 +02:00
Nickolay Shmyrev 55dd29b0ff Fix transcriber bugs while processing folder 2022-05-26 14:05:54 +02:00
11 changed files with 18 additions and 22 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ buildscript {
}
allprojects {
version = '0.3.41'
version = '0.3.42'
}
subprojects {
+1 -1
View File
@@ -11,7 +11,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Vosk" Version="0.3.41" />
<PackageReference Include="Vosk" Version="0.3.42" />
</ItemGroup>
</Project>
+1 -1
View File
@@ -2,7 +2,7 @@
<package>
<metadata>
<id>Vosk</id>
<version>0.3.41</version>
<version>0.3.42</version>
<authors>Alpha Cephei Inc</authors>
<owners>Alpha Cephei Inc</owners>
<license type="expression">Apache-2.0</license>
+1 -1
View File
@@ -12,5 +12,5 @@ repositories {
dependencies {
implementation group: 'net.java.dev.jna', name: 'jna', version: '5.7.0'
implementation group: 'com.alphacephei', name: 'vosk', version: '0.3.41+'
implementation group: 'com.alphacephei', name: 'vosk', version: '0.3.42+'
}
+1 -1
View File
@@ -16,7 +16,7 @@ repositories {
archivesBaseName = 'vosk'
group = 'com.alphacephei'
version = '0.3.41'
version = '0.3.42'
mavenPublish {
group = 'com.alphacephei'
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "vosk",
"version": "0.3.41",
"version": "0.3.42",
"description": "Node binding for continuous offline voice recoginition with Vosk library.",
"repository": {
"type": "git",
+3 -3
View File
@@ -44,7 +44,7 @@ with open("README.md", "r") as fh:
setuptools.setup(
name="vosk",
version="0.3.41",
version="0.3.42",
author="Alpha Cephei Inc",
author_email="contact@alphacephei.com",
description="Offline open source speech recognition API based on Kaldi and Vosk",
@@ -68,7 +68,7 @@ setuptools.setup(
cmdclass=cmdclass,
python_requires='>=3',
zip_safe=False, # Since we load so file from the filesystem, we can not run from zip file
setup_requires=['cffi>=1.0', 'requests', 'tqdm'],
install_requires=['cffi>=1.0', 'requests', 'tqdm'],
setup_requires=['cffi>=1.0', 'requests', 'tqdm', 'srt'],
install_requires=['cffi>=1.0', 'requests', 'tqdm', 'srt'],
cffi_modules=['vosk_builder.py:ffibuilder'],
)
+4 -8
View File
@@ -56,22 +56,18 @@ def main():
exit(1)
if not Path(args.input).exists():
logging.info('File %s does not exist, please specify an existing file/directory' % (args.input))
exit(1)
if args.output !='' and not Path(args.output).exists():
logging.info('Output %s does not exist, please specify an existing file' % (args.output))
logging.info("File/folder '%s' does not exist, please specify an existing file/directory" % (args.input))
exit(1)
transcriber = Transcriber(args)
if Path(args.input).is_dir() and Path(args.output).is_dir():
if Path(args.input).is_dir():
transcriber.process_dir(args)
return
elif Path(args.input).is_file() and (args.output=='' or Path(args.output).is_file()):
elif Path(args.input).is_file():
transcriber.process_file(args)
else:
logging.info('Wrong arguments, input and output must be same type')
logging.info('Wrong arguments')
exit(1)
if __name__ == "__main__":
+3 -3
View File
@@ -8,6 +8,7 @@ import logging
from pathlib import Path
from timeit import default_timer as timer
from vosk import KaldiRecognizer, Model
from multiprocessing.dummy import Pool
class Transcriber:
@@ -76,11 +77,10 @@ class Transcriber:
print(final_result)
return final_result, tot_samples
def process_directory(self,args):
def process_dir(self,args):
task_list = [(Path(args.input, fn), Path(args.output, Path(fn).stem).with_suffix('.' + args.output_type)) for fn in os.listdir(args.input)]
with Pool() as pool:
pool.map(self.process_entry, file_list)
pool.map(self.process_entry, task_list)
def process_file(self, args):
start_time = timer()
+1 -1
View File
@@ -26,5 +26,5 @@ mkdir -p /io/wheelhouse/vosk-linux-$VOSK_ARCHITECTURE
cp /opt/vosk-api/src/*.so /opt/vosk-api/src/vosk_api.h /io/wheelhouse/vosk-linux-$VOSK_ARCHITECTURE
# Build wheel
python3 -m pip install requests tqdm
python3 -m pip install requests tqdm srt
python3 -m pip wheel /opt/vosk-api/python --no-deps -w /io/wheelhouse
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "vosk-js",
"version": "0.3.41",
"version": "0.3.42",
"description": "Node binding for continuous voice recoginition through vosk-api.",
"repository": {
"type": "git",