More rebranding, Java package, C++ impl

This commit is contained in:
Kelly Davis 2021-03-07 11:34:01 +01:00
parent f33f0b382d
commit 95f122806e
12 changed files with 22 additions and 22 deletions

View File

@ -1,14 +1,14 @@
LOCAL_PATH := $(call my-dir) LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE := deepspeech-prebuilt LOCAL_MODULE := stt-prebuilt
LOCAL_SRC_FILES := $(TFDIR)/bazel-bin/native_client/libstt.so LOCAL_SRC_FILES := $(TFDIR)/bazel-bin/native_client/libstt.so
include $(PREBUILT_SHARED_LIBRARY) include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_CPP_EXTENSION := .cc .cxx .cpp LOCAL_CPP_EXTENSION := .cc .cxx .cpp
LOCAL_MODULE := deepspeech LOCAL_MODULE := stt
LOCAL_SRC_FILES := client.cc LOCAL_SRC_FILES := client.cc
LOCAL_SHARED_LIBRARIES := deepspeech-prebuilt LOCAL_SHARED_LIBRARIES := stt-prebuilt
LOCAL_LDFLAGS := -Wl,--no-as-needed LOCAL_LDFLAGS := -Wl,--no-as-needed
include $(BUILD_EXECUTABLE) include $(BUILD_EXECUTABLE)

View File

@ -114,9 +114,9 @@ cc_library(
cc_library( cc_library(
name = "coqui_stt_bundle", name = "coqui_stt_bundle",
srcs = [ srcs = [
"deepspeech.cc", "stt.cc",
"coqui-stt.h", "coqui-stt.h",
"deepspeech_errors.cc", "stt_errors.cc",
"modelstate.cc", "modelstate.cc",
"modelstate.h", "modelstate.h",
"workspace_status.cc", "workspace_status.cc",
@ -229,7 +229,7 @@ cc_binary(
name = "generate_scorer_package", name = "generate_scorer_package",
srcs = [ srcs = [
"generate_scorer_package.cpp", "generate_scorer_package.cpp",
"deepspeech_errors.cc", "stt_errors.cc",
], ],
copts = ["-std=c++11"], copts = ["-std=c++11"],
deps = [ deps = [

View File

@ -16,7 +16,7 @@ include definitions.mk
default: $(STT_BIN) default: $(STT_BIN)
clean: clean:
rm -f deepspeech rm -f stt
$(STT_BIN): client.cc Makefile $(STT_BIN): client.cc Makefile
$(CXX) $(CFLAGS) $(CFLAGS_DEEPSPEECH) $(SOX_CFLAGS) client.cc $(LDFLAGS) $(SOX_LDFLAGS) $(CXX) $(CFLAGS) $(CFLAGS_DEEPSPEECH) $(SOX_CFLAGS) client.cc $(LDFLAGS) $(SOX_LDFLAGS)

View File

@ -8,7 +8,7 @@ GRADLE ?= ./gradlew
all: apk all: apk
clean: apk-clean clean: apk-clean
rm -rf *.java jni/deepspeech_wrap.cpp rm -rf *.java jni/stt_wrap.cpp
apk-clean: apk-clean:
$(GRADLE) clean $(GRADLE) clean
@ -28,4 +28,4 @@ maven-bundle: apk
$(GRADLE) zipMavenArtifacts $(GRADLE) zipMavenArtifacts
bindings: clean ds-swig bindings: clean ds-swig
$(DS_SWIG_ENV) swig -c++ -java -package ai.coqui.libstt -outdir libstt/src/main/java/ai/coqui/libstt/ -o jni/deepspeech_wrap.cpp jni/deepspeech.i $(DS_SWIG_ENV) swig -c++ -java -package ai.coqui.libstt -outdir libstt/src/main/java/ai/coqui/libstt/ -o jni/stt_wrap.cpp jni/stt.i

View File

@ -132,10 +132,10 @@ public class DeepSpeechActivity extends AppCompatActivity {
this._tfliteModel = (EditText) findViewById(R.id.tfliteModel); this._tfliteModel = (EditText) findViewById(R.id.tfliteModel);
this._audioFile = (EditText) findViewById(R.id.audioFile); this._audioFile = (EditText) findViewById(R.id.audioFile);
this._tfliteModel.setText("/sdcard/deepspeech/output_graph.tflite"); this._tfliteModel.setText("/sdcard/stt/output_graph.tflite");
this._tfliteStatus.setText("Ready, waiting ..."); this._tfliteStatus.setText("Ready, waiting ...");
this._audioFile.setText("/sdcard/deepspeech/audio.wav"); this._audioFile.setText("/sdcard/stt/audio.wav");
this._startInference = (Button) findViewById(R.id.btnStartInference); this._startInference = (Button) findViewById(R.id.btnStartInference);
} }

View File

@ -1,3 +1,3 @@
<resources> <resources>
<string name="app_name">DeepSpeech</string> <string name="app_name">Coqui STT</string>
</resources> </resources>

View File

@ -11,24 +11,24 @@ cmake_minimum_required(VERSION 3.4.1)
# Gradle automatically packages shared libraries with your APK. # Gradle automatically packages shared libraries with your APK.
add_library( # Sets the name of the library. add_library( # Sets the name of the library.
deepspeech-jni stt-jni
# Sets the library as a shared library. # Sets the library as a shared library.
SHARED SHARED
# Provides a relative path to your source file(s). # Provides a relative path to your source file(s).
../jni/deepspeech_wrap.cpp ) ../jni/stt_wrap.cpp )
add_library( deepspeech-lib add_library( stt-lib
SHARED SHARED
IMPORTED ) IMPORTED )
set_target_properties( deepspeech-lib set_target_properties( stt-lib
PROPERTIES PROPERTIES
IMPORTED_LOCATION IMPORTED_LOCATION
${CMAKE_SOURCE_DIR}/libs/${ANDROID_ABI}/libstt.so ) ${CMAKE_SOURCE_DIR}/libs/${ANDROID_ABI}/libstt.so )
add_custom_command( TARGET deepspeech-jni POST_BUILD add_custom_command( TARGET stt-jni POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_SOURCE_DIR}/libs/${ANDROID_ABI}/libstt.so ${CMAKE_SOURCE_DIR}/libs/${ANDROID_ABI}/libstt.so
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libstt.so ) ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libstt.so )
@ -52,9 +52,9 @@ find_library( # Sets the name of the path variable.
# build script, prebuilt third-party libraries, or system libraries. # build script, prebuilt third-party libraries, or system libraries.
target_link_libraries( # Specifies the target library. target_link_libraries( # Specifies the target library.
deepspeech-jni stt-jni
deepspeech-lib stt-lib
# Links the target library to the log library # Links the target library to the log library
# included in the NDK. # included in the NDK.

View File

@ -6,8 +6,8 @@ package ai.coqui.libstt;
public class DeepSpeechModel { public class DeepSpeechModel {
static { static {
System.loadLibrary("deepspeech-jni"); System.loadLibrary("stt-jni");
System.loadLibrary("deepspeech"); System.loadLibrary("stt");
} }
// FIXME: We should have something better than those SWIGTYPE_* // FIXME: We should have something better than those SWIGTYPE_*

View File

@ -8,4 +8,4 @@ To update, please install SWIG (4.0 at least) and then run from native_client/ja
.. code-block:: .. code-block::
swig -c++ -java -doxygen -package ai.coqui.libstt -outdir libstt/src/main/java/ai/coqui/libstt_doc -o jni/deepspeech_wrap.cpp jni/deepspeech.i swig -c++ -java -doxygen -package ai.coqui.libstt -outdir libstt/src/main/java/ai/coqui/libstt_doc -o jni/stt_wrap.cpp jni/stt.i