Skip to content

Commit

Permalink
Merge branch 'add_TextResult' of github.com:Vadim-cloud-star/vosk-api…
Browse files Browse the repository at this point in the history
… into add_TextResult
  • Loading branch information
vadimdddd committed Jul 19, 2022
2 parents 9dd64ec + 8b271a4 commit e1a2552
Show file tree
Hide file tree
Showing 18 changed files with 112 additions and 12 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ buildscript {
}

allprojects {
version = '0.3.42'
version = '0.3.43'
}

subprojects {
Expand Down
2 changes: 1 addition & 1 deletion csharp/demo/VoskDemo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Vosk" Version="0.3.42" />
<PackageReference Include="Vosk" Version="0.3.43" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion csharp/nuget/Vosk.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package>
<metadata>
<id>Vosk</id>
<version>0.3.42</version>
<version>0.3.43</version>
<authors>Alpha Cephei Inc</authors>
<owners>Alpha Cephei Inc</owners>
<license type="expression">Apache-2.0</license>
Expand Down
1 change: 1 addition & 0 deletions go/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
See example subfolder for instructions how to use the module
31 changes: 31 additions & 0 deletions go/example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
To try this package do the following steps:

On Linux (we download library and set LD_LIBRARY_PATH)

```
git clone https://github.com/alphacep/vosk-api
cd vosk-api/go/example
wget https://github.com/alphacep/vosk-api/releases/download/v0.3.42/vosk-linux-x86_64-0.3.42.zip
unzip vosk-linux-x86_64-0.3.42.zip
wget https://alphacephei.com/vosk/models/vosk-model-small-en-us-0.15.zip
unzip vosk-model-small-en-us-0.15.zip
mv vosk-model-small-en-us-0.15 model
cp ../../python/example/test.wav .
VOSK_PATH=`pwd`/vosk-linux-x86_64-0.3.42 LD_LIBRARY_PATH=$VOSK_PATH CGO_CPPFLAGS="-I $VOSK_PATH" CGO_LDFLAGS="-L $VOSK_PATH" go run . -f test.wav
```

for Windows (we place DLLs in current folder where linker finds them):

```
git clone https://github.com/alphacep/vosk-api
cd vosk-api/go/example
wget https://github.com/alphacep/vosk-api/releases/download/v0.3.42/vosk-linux-x86_64-0.3.42.zip
unzip vosk-linux-x86_64-0.3.42.zip
cp vosk-linux-x86_64-0.3.42/*.dll .
cp vosk-linux-x86_64-0.3.42/*.h .
wget https://alphacephei.com/vosk/models/vosk-model-small-en-us-0.15.zip
unzip vosk-model-small-en-us-0.15.zip
mv vosk-model-small-en-us-0.15 model
cp ../../python/example/test.wav .
VOSK_PATH=`pwd` LD_LIBRARY_PATH=$VOSK_PATH CGO_CPPFLAGS="-I $VOSK_PATH" CGO_LDFLAGS="-L $VOSK_PATH -lvosk -lpthread -dl" go run . -f test.wav
```
2 changes: 1 addition & 1 deletion go/example/doc.go
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// Example package for Vosk Go bindings.
package test_simple
package main
2 changes: 1 addition & 1 deletion java/demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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.42+'
implementation group: 'com.alphacephei', name: 'vosk', version: '0.3.43+'
}
2 changes: 1 addition & 1 deletion java/lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ repositories {

archivesBaseName = 'vosk'
group = 'com.alphacephei'
version = '0.3.42'
version = '0.3.43'

mavenPublish {
group = 'com.alphacephei'
Expand Down
2 changes: 1 addition & 1 deletion nodejs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vosk",
"version": "0.3.42",
"version": "0.3.43",
"description": "Node binding for continuous offline voice recoginition with Vosk library.",
"repository": {
"type": "git",
Expand Down
4 changes: 3 additions & 1 deletion python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ def get_tag(self):
oses = 'win_amd64'
elif system == 'Linux' and architecture == '64bit':
oses = 'linux_x86_64'
elif system == 'Linux' and architecture == 'aarch64':
oses = 'manylinux2014_aarch64'
elif system == 'Linux':
oses = 'linux_' + architecture
else:
Expand All @@ -44,7 +46,7 @@ def get_tag(self):

setuptools.setup(
name="vosk",
version="0.3.42",
version="0.3.43",
author="Alpha Cephei Inc",
author_email="[email protected]",
description="Offline open source speech recognition API based on Kaldi and Vosk",
Expand Down
5 changes: 5 additions & 0 deletions ruby/lib/vosk.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class Vosk
def self.hi
puts "Hello world!"
end
end
12 changes: 12 additions & 0 deletions ruby/vosk.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Gem::Specification.new do |s|
s.name = "vosk"
s.version = "0.3.43"
s.summary = "Offline speech recognition API"
s.description = "Vosk is an offline open source speech recognition toolkit. It enables speech recognition for 20+ languages and dialects - English, Indian English, German, French, Spanish, Portuguese, Chinese, Russian, Turkish, Vietnamese, Italian, Dutch, Catalan, Arabic, Greek, Farsi, Filipino, Ukrainian, Kazakh, Swedish, Japanese, Esperanto, Hindi, Czech, Polish. More to come."
s.authors = ["Alpha Cephei Inc"]
s.email = "[email protected]"
s.files = ["lib/vosk.rb"]
s.homepage =
"https://rubygems.org/gems/vosk"
s.license = "Apache 2.0"
end
39 changes: 39 additions & 0 deletions travis/Dockerfile.dockcross-manylinux
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
ARG DOCKCROSS_IMAGE=dockcross/manylinux2014-aarch64
FROM ${DOCKCROSS_IMAGE}

LABEL description="A docker image for building portable Python linux binary wheels and Kaldi on other architectures"
LABEL maintainer="[email protected]"

RUN yum -y install \
automake \
autoconf \
libtool \
libffi-devel \
&& yum clean all

ARG OPENBLAS_ARGS=
RUN cd /opt \
&& git clone -b vosk --single-branch https://github.com/alphacep/kaldi \
&& cd kaldi/tools \
&& git clone -b v0.3.20 --single-branch https://github.com/xianyi/OpenBLAS \
&& git clone -b v3.2.1 --single-branch https://github.com/alphacep/clapack \
&& echo ${OPENBLAS_ARGS} \
&& make -C OpenBLAS ONLY_CBLAS=1 ${OPENBLAS_ARGS} HOSTCC=gcc USE_LOCKING=1 USE_THREAD=0 all \
&& make -C OpenBLAS ${OPENBLAS_ARGS} HOSTCC=gcc USE_LOCKING=1 USE_THREAD=0 PREFIX=$(pwd)/OpenBLAS/install install \
&& mkdir -p clapack/BUILD && cd clapack/BUILD && cmake .. \
&& make -j 10 -C F2CLIBS \
&& make -j 10 -C BLAS \
&& make -j 10 -C SRC \
&& find . -name "*.a" | xargs cp -t ../../OpenBLAS/install/lib \
&& cd /opt/kaldi/tools \
&& git clone --single-branch https://github.com/alphacep/openfst openfst \
&& cd openfst \
&& autoreconf -i \
&& CFLAGS="-g -O3" ./configure --prefix=/opt/kaldi/tools/openfst --enable-static --enable-shared --enable-far --enable-ngram-fsts --enable-lookahead-fsts --with-pic --disable-bin --host=${CROSS_TRIPLE} --build=x86-linux-gnu \
&& make -j 10 && make install \
&& cd /opt/kaldi/src \
&& sed -i "s:TARGET_ARCH=\"\`uname -m\`\":TARGET_ARCH=$(echo $CROSS_TRIPLE|cut -d - -f 1):g" configure \
&& sed -i "s: -O1 : -O3 :g" makefiles/linux_openblas_arm.mk \
&& ./configure --mathlib=OPENBLAS_CLAPACK --shared --use-cuda=no \
&& make -j 10 online2 lm rnnlm \
&& find /opt/kaldi -name "*.o" -exec rm {} \;
1 change: 1 addition & 0 deletions travis/Dockerfile.manylinux
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ RUN yum -y update && yum -y install \
autoconf \
libtool \
cmake \
libffi-devel \
&& yum clean all

RUN cd /opt \
Expand Down
7 changes: 7 additions & 0 deletions travis/build-dockcross-manylinux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

set -e
set -x

docker build --build-arg="DOCKCROSS_IMAGE=dockcross/manylinux2014-aarch64" --build-arg="OPENBLAS_ARGS=TARGET=ARMV8" --file Dockerfile.dockcross-manylinux --tag alphacep/kaldi-dockcross-aarch64:latest .
docker run --rm -v /home/shmyrev/travis/vosk-api/:/io alphacep/kaldi-dockcross-aarch64 /io/travis/build-wheels-dockcross.sh
6 changes: 4 additions & 2 deletions travis/build-dockcross.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ set -e
set -x

docker build --build-arg="DOCKCROSS_IMAGE=alphacep/dockcross-linux-armv7" --build-arg="OPENBLAS_ARGS=TARGET=ARMV7" --file Dockerfile.dockcross --tag alphacep/kaldi-dockcross-armv7:latest .
docker build --build-arg="DOCKCROSS_IMAGE=dockcross/linux-arm64" --build-arg="OPENBLAS_ARGS=TARGET=ARMV8" --file Dockerfile.dockcross --tag alphacep/kaldi-dockcross-arm64:latest .
docker build --build-arg="DOCKCROSS_IMAGE=dockcross/linux-x86" --build-arg="OPENBLAS_ARGS=TARGET=CORE2\ DYNAMIC_ARCH=1" --file Dockerfile.dockcross --tag alphacep/kaldi-dockcross-x86:latest .
docker build --build-arg="DOCKCROSS_IMAGE=dockcross/linux-riscv64" --build-arg="OPENBLAS_ARGS=TARGET=RISCV64_GENERIC\ ARCH=riscv64" --file Dockerfile.dockcross --tag alphacep/kaldi-dockcross-riscv:latest .

docker run --rm -v /home/shmyrev/travis/vosk-api/:/io alphacep/kaldi-dockcross-armv7 /io/travis/build-wheels-dockcross.sh
docker run --rm -v /home/shmyrev/travis/vosk-api/:/io alphacep/kaldi-dockcross-arm64 /io/travis/build-wheels-dockcross.sh
docker run --rm -v /home/shmyrev/travis/vosk-api/:/io alphacep/kaldi-dockcross-x86 /io/travis/build-wheels-dockcross.sh
docker run --rm -v /home/shmyrev/travis/vosk-api/:/io alphacep/kaldi-dockcross-riscv /io/travis/build-wheels-dockcross.sh

# We use manylinux (Centos-based image) for aarch64 instead
# docker build --build-arg="DOCKCROSS_IMAGE=dockcross/linux-arm64" --build-arg="OPENBLAS_ARGS=TARGET=ARMV8" --file Dockerfile.dockcross --tag alphacep/kaldi-dockcross-arm64:latest .
# docker run --rm -v /home/shmyrev/travis/vosk-api/:/io alphacep/kaldi-dockcross-arm64 /io/travis/build-wheels-dockcross.sh
2 changes: 1 addition & 1 deletion travis/build-wheels-dockcross.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,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 srt
python3 -m pip install requests tqdm srt wheel
python3 -m pip wheel /opt/vosk-api/python --no-deps -w /io/wheelhouse
2 changes: 1 addition & 1 deletion webjs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vosk-js",
"version": "0.3.42",
"version": "0.3.43",
"description": "Node binding for continuous voice recoginition through vosk-api.",
"repository": {
"type": "git",
Expand Down

0 comments on commit e1a2552

Please sign in to comment.