@mentra/bluetooth-sdk 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +278 -0
- package/android/build.gradle +167 -0
- package/android/lc3Lib/CMakeLists.txt +6 -0
- package/android/lc3Lib/build.gradle +109 -0
- package/android/lc3Lib/proguard-rules.pro +33 -0
- package/android/lc3Lib/src/main/AndroidManifest.xml +2 -0
- package/android/lc3Lib/src/main/cpp/CMakeLists.txt +8 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/CMakeLists.txt +30 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/jni/CMakeLists.txt +7 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/jni/ogg_opus_encoder.cc +96 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/jni/ogg_opus_encoder.h +53 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/libogg/Makefile.am +6 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/libogg/config_types.h +26 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/libogg/config_types.h.in +26 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/libogg/ogg.h +209 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/libogg/os_types.h +158 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/libopus/opus.h +981 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/libopus/opus_custom.h +342 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/libopus/opus_defines.h +799 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/libopus/opus_multistream.h +660 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/libopus/opus_projection.h +568 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/libopus/opus_types.h +166 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/ogg_opus_encoder.cc +268 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/ogg_opus_encoder.h +115 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/opus_tools/opus_header.h +59 -0
- package/android/lc3Lib/src/main/cpp/liblc3/CMakeLists.txt +38 -0
- package/android/lc3Lib/src/main/cpp/liblc3/include/lc3.h +309 -0
- package/android/lc3Lib/src/main/cpp/liblc3/include/lc3_private.h +162 -0
- package/android/lc3Lib/src/main/cpp/liblc3/include/rnnoise.h +114 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/CMakeLists.txt +19 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/attdet.c +92 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/attdet.h +44 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/bits.c +375 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/bits.h +315 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/bwdet.c +129 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/bwdet.h +69 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/common.h +148 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/energy.c +70 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/energy.h +43 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/fastmath.h +158 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/lc3.c +702 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/ltpf.c +893 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/ltpf.h +111 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/ltpf_arm.h +506 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/ltpf_neon.h +281 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/makefile.mk +35 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/mdct.c +452 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/mdct.h +57 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/mdct_neon.h +296 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/meson.build +46 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/plc.c +61 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/plc.h +57 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/sns.c +880 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/sns.h +103 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/spec.c +904 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/spec.h +119 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/tables.c +3457 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/tables.h +94 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/tns.c +457 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/tns.h +99 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3.cpp +159 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/_kiss_fft_guts.h +182 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/arch.h +261 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/celt_lpc.c +279 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/celt_lpc.h +59 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/common.h +48 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/compile.sh +3 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/denoise.c +646 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/kiss_fft.c +601 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/kiss_fft.h +203 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/opus_types.h +159 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/pitch.c +526 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/pitch.h +149 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/rnn.c +178 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/rnn.h +69 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/rnn_data.c +11051 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/rnn_data.h +34 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/rnn_reader.c +168 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/rnn_train.py +66 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/tansig_table.h +45 -0
- package/android/lc3Lib/src/main/java/com/mentra/lc3Lib/Lc3Cpp.java +38 -0
- package/android/lc3Lib/third_party/CMakeLists.txt +23 -0
- package/android/lc3Lib/third_party/CMakeLists_libogg.txt +18 -0
- package/android/lc3Lib/third_party/CMakeLists_libopus.txt +18 -0
- package/android/lc3Lib/third_party/CMakeLists_opus-tools.txt +23 -0
- package/android/lc3Lib/third_party/opus_tools/src/AUTHORS +5 -0
- package/android/lc3Lib/third_party/opus_tools/src/CMakeLists.txt +4 -0
- package/android/lc3Lib/third_party/opus_tools/src/COPYING +371 -0
- package/android/lc3Lib/third_party/opus_tools/src/ChangeLog +3 -0
- package/android/lc3Lib/third_party/opus_tools/src/Makefile.am +42 -0
- package/android/lc3Lib/third_party/opus_tools/src/Makefile.unix +23 -0
- package/android/lc3Lib/third_party/opus_tools/src/NEWS +0 -0
- package/android/lc3Lib/third_party/opus_tools/src/README +0 -0
- package/android/lc3Lib/third_party/opus_tools/src/autogen.sh +115 -0
- package/android/lc3Lib/third_party/opus_tools/src/configure.ac +293 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/arch.h +239 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/audio-in.c +1046 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/diag_range.c +245 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/diag_range.h +28 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/info_opus.c +320 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/info_opus.h +51 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/lpc.c +157 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/lpc.h +27 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/opus_header.c +286 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/opus_header.h +59 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/opusdec.c +884 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/opusenc.c +1021 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/opusenc.h +101 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/opusinfo.c +639 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/opusinfo.h +51 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/os_support.h +167 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/resample.c +1137 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/speex_resampler.h +344 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/stack_alloc.h +115 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/wav_io.c +125 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/wav_io.h +62 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/wave_out.c +223 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/wave_out.h +60 -0
- package/android/settings.gradle +1 -0
- package/android/src/main/AndroidManifest.xml +40 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/BluetoothSdkModule.kt +528 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/Bridge.kt +610 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/DeviceManager.kt +1616 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/DeviceStore.kt +314 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/MentraBluetoothModels.kt +1710 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/MentraBluetoothSdk.kt +554 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/ObservableStore.kt +68 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/controllers/ControllerManager.kt +158 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/controllers/R1.kt +934 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/services/Foreground.kt +175 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/services/PhoneMic.kt +1109 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/G1.java +3974 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/G2.kt +3551 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/Mach1.java +1327 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/MentraLive.java +6959 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/MentraNex.kt +1655 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/MentraosBle.java +53675 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/SGCManager.kt +202 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/Simulated.kt +224 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/stt/STTTools.kt +340 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/stt/SherpaOnnxTranscriber.kt +465 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/stt/VadGateSpeechPolicy.kt +221 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/AES.java +106 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/AudioSessionMonitor.kt +189 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/BitmapJavaUtils.java +169 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/BlePhotoUploadService.java +179 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/Constants.kt +44 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/G1Text.kt +436 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/IncidentLogBleRelayNaming.java +29 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/IncidentLogBleUploadService.java +76 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/K900ProtocolUtils.java +791 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/MessageChunker.java +186 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/NexSGCUtils.kt +589 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/PhoneAudioMonitor.kt +303 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/SmartGlassesConnectionState.java +9 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/audio/ByteUtilAudioPlayer.java +655 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/audio/Lc3Player.java +441 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/audio/PCMAudioPlayer.java +431 -0
- package/android/src/main/res/values/strings.xml +4 -0
- package/app.plugin.js +1 -0
- package/build/BluetoothSdk.types.d.ts +498 -0
- package/build/BluetoothSdk.types.d.ts.map +1 -0
- package/build/BluetoothSdk.types.js +23 -0
- package/build/BluetoothSdk.types.js.map +1 -0
- package/build/BluetoothSdkModule.d.ts +71 -0
- package/build/BluetoothSdkModule.d.ts.map +1 -0
- package/build/BluetoothSdkModule.js +106 -0
- package/build/BluetoothSdkModule.js.map +1 -0
- package/build/index.d.ts +3 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +5 -0
- package/build/index.js.map +1 -0
- package/expo-module.config.json +9 -0
- package/ios/BluetoothSdkModule.swift +665 -0
- package/ios/MentraBluetoothSDK.podspec +77 -0
- package/ios/Packages/CoreObjC/CoreObjC.xcodeproj/project.pbxproj +213 -0
- package/ios/Packages/CoreObjC/PcmConverter.h +22 -0
- package/ios/Packages/CoreObjC/PcmConverter.m +266 -0
- package/ios/Packages/CoreObjC/attdet.c +92 -0
- package/ios/Packages/CoreObjC/attdet.h +44 -0
- package/ios/Packages/CoreObjC/bits.c +375 -0
- package/ios/Packages/CoreObjC/bits.h +315 -0
- package/ios/Packages/CoreObjC/bwdet.c +129 -0
- package/ios/Packages/CoreObjC/bwdet.h +69 -0
- package/ios/Packages/CoreObjC/common.h +151 -0
- package/ios/Packages/CoreObjC/energy.c +70 -0
- package/ios/Packages/CoreObjC/energy.h +43 -0
- package/ios/Packages/CoreObjC/fastmath.h +158 -0
- package/ios/Packages/CoreObjC/lc3.c +704 -0
- package/ios/Packages/CoreObjC/lc3.h +313 -0
- package/ios/Packages/CoreObjC/lc3_cpp.h +283 -0
- package/ios/Packages/CoreObjC/lc3_private.h +163 -0
- package/ios/Packages/CoreObjC/ltpf.c +905 -0
- package/ios/Packages/CoreObjC/ltpf.h +111 -0
- package/ios/Packages/CoreObjC/ltpf_arm.h +506 -0
- package/ios/Packages/CoreObjC/ltpf_neon.h +281 -0
- package/ios/Packages/CoreObjC/makefile.mk +35 -0
- package/ios/Packages/CoreObjC/mdct.c +469 -0
- package/ios/Packages/CoreObjC/mdct.h +57 -0
- package/ios/Packages/CoreObjC/mdct_neon.h +296 -0
- package/ios/Packages/CoreObjC/meson.build +61 -0
- package/ios/Packages/CoreObjC/plc.c +61 -0
- package/ios/Packages/CoreObjC/plc.h +57 -0
- package/ios/Packages/CoreObjC/rnnoise.h +114 -0
- package/ios/Packages/CoreObjC/sns.c +880 -0
- package/ios/Packages/CoreObjC/sns.h +103 -0
- package/ios/Packages/CoreObjC/spec.c +907 -0
- package/ios/Packages/CoreObjC/spec.h +119 -0
- package/ios/Packages/CoreObjC/tables.c +3457 -0
- package/ios/Packages/CoreObjC/tables.h +94 -0
- package/ios/Packages/CoreObjC/tns.c +457 -0
- package/ios/Packages/CoreObjC/tns.h +99 -0
- package/ios/Packages/SherpaOnnx/Model/joiner.onnx +0 -0
- package/ios/Packages/SherpaOnnx/Model/tokens.txt +502 -0
- package/ios/Packages/SherpaOnnx/SherpaOnnx.swift +1659 -0
- package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/Headers/cargs.h +162 -0
- package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/Headers/sherpa-onnx/c-api/c-api.h +1852 -0
- package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/Headers/sherpa-onnx/c-api/cxx-api.h +674 -0
- package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/Info.plist +44 -0
- package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/ios-arm64/libsherpa-onnx.a +0 -0
- package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/ios-arm64/sherpa-onnx.a +0 -0
- package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/ios-arm64_x86_64-simulator/libsherpa-onnx.a +0 -0
- package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/ios-arm64_x86_64-simulator/sherpa-onnx.a +0 -0
- package/ios/Packages/VAD/Common/VAD/VADQuality.swift +41 -0
- package/ios/Packages/VAD/Common/VAD/VADState.swift +26 -0
- package/ios/Packages/VAD/Common/VAD/VADStrategy.swift +29 -0
- package/ios/Packages/VAD/Common/VAD/VADType.swift +14 -0
- package/ios/Packages/VAD/Data/Configuration.swift +68 -0
- package/ios/Packages/VAD/Data/FrameSize.swift +39 -0
- package/ios/Packages/VAD/Data/Record.swift +13 -0
- package/ios/Packages/VAD/Data/Result.swift +22 -0
- package/ios/Packages/VAD/Data/SampleRate.swift +48 -0
- package/ios/Packages/VAD/Silero/Model/silero_vad.onnx +0 -0
- package/ios/Packages/VAD/Silero/SileroVAD.swift +284 -0
- package/ios/Packages/VAD/Silero/SileroVADStrategy.swift +64 -0
- package/ios/Packages/libbz2/module.modulemap +5 -0
- package/ios/Packages/libbz2/shim.h +1 -0
- package/ios/Source/Bridge.swift +353 -0
- package/ios/Source/Bridging-Header.h +16 -0
- package/ios/Source/DeviceManager.swift +1478 -0
- package/ios/Source/DeviceStore.swift +295 -0
- package/ios/Source/MentraBluetoothSDK.swift +2439 -0
- package/ios/Source/ObservableStore.swift +88 -0
- package/ios/Source/PrivacyInfo.xcprivacy +23 -0
- package/ios/Source/controllers/ControllerManager.swift +187 -0
- package/ios/Source/controllers/R1.swift +827 -0
- package/ios/Source/services/PhoneMic.swift +662 -0
- package/ios/Source/sgcs/Frame.swift +651 -0
- package/ios/Source/sgcs/G1.swift +2505 -0
- package/ios/Source/sgcs/G2.swift +3730 -0
- package/ios/Source/sgcs/Mach1.swift +543 -0
- package/ios/Source/sgcs/MentraLive.swift +4708 -0
- package/ios/Source/sgcs/MentraNex.swift +2479 -0
- package/ios/Source/sgcs/SGCManager.swift +243 -0
- package/ios/Source/sgcs/Simulated.swift +270 -0
- package/ios/Source/sgcs/mentraos_ble.pb.swift +3811 -0
- package/ios/Source/stt/STTTools.swift +154 -0
- package/ios/Source/stt/SherpaOnnxTranscriber.swift +401 -0
- package/ios/Source/utils/AudioSessionMonitor.swift +283 -0
- package/ios/Source/utils/Constants.swift +74 -0
- package/ios/Source/utils/Enums.swift +95 -0
- package/ios/Source/utils/G1Text.swift +2067 -0
- package/ios/Source/utils/JSCExperiment.swift +241 -0
- package/ios/Source/utils/MemoryMonitor.swift +44 -0
- package/ios/Source/utils/MessageChunker.swift +164 -0
- package/ios/Source/utils/Models.swift +135 -0
- package/ios/Source/utils/PhoneAudioMonitor.swift +226 -0
- package/ios/Source/utils/TarBz2Extractor.swift +206 -0
- package/package.json +78 -0
- package/plugin/build/index.d.ts +6 -0
- package/plugin/build/index.js +12 -0
- package/plugin/build/withAndroid.d.ts +4 -0
- package/plugin/build/withAndroid.js +80 -0
- package/plugin/build/withIos.d.ts +4 -0
- package/plugin/build/withIos.js +64 -0
- package/src/BluetoothSdk.types.ts +581 -0
- package/src/BluetoothSdkModule.ts +259 -0
- package/src/index.ts +4 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#ifndef RNN_DATA_H
|
|
2
|
+
#define RNN_DATA_H
|
|
3
|
+
|
|
4
|
+
#include "rnn.h"
|
|
5
|
+
|
|
6
|
+
struct RNNModel {
|
|
7
|
+
int input_dense_size;
|
|
8
|
+
const DenseLayer *input_dense;
|
|
9
|
+
|
|
10
|
+
int vad_gru_size;
|
|
11
|
+
const GRULayer *vad_gru;
|
|
12
|
+
|
|
13
|
+
int noise_gru_size;
|
|
14
|
+
const GRULayer *noise_gru;
|
|
15
|
+
|
|
16
|
+
int denoise_gru_size;
|
|
17
|
+
const GRULayer *denoise_gru;
|
|
18
|
+
|
|
19
|
+
int denoise_output_size;
|
|
20
|
+
const DenseLayer *denoise_output;
|
|
21
|
+
|
|
22
|
+
int vad_output_size;
|
|
23
|
+
const DenseLayer *vad_output;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
struct RNNState {
|
|
27
|
+
const RNNModel *model;
|
|
28
|
+
float *vad_gru_state;
|
|
29
|
+
float *noise_gru_state;
|
|
30
|
+
float *denoise_gru_state;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
#endif
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/* Copyright (c) 2018 Gregor Richards */
|
|
2
|
+
/*
|
|
3
|
+
Redistribution and use in source and binary forms, with or without
|
|
4
|
+
modification, are permitted provided that the following conditions
|
|
5
|
+
are met:
|
|
6
|
+
|
|
7
|
+
- Redistributions of source code must retain the above copyright
|
|
8
|
+
notice, this list of conditions and the following disclaimer.
|
|
9
|
+
|
|
10
|
+
- Redistributions in binary form must reproduce the above copyright
|
|
11
|
+
notice, this list of conditions and the following disclaimer in the
|
|
12
|
+
documentation and/or other materials provided with the distribution.
|
|
13
|
+
|
|
14
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
15
|
+
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
16
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
17
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
|
|
18
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
19
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
20
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
21
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
22
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
23
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
24
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
#ifdef HAVE_CONFIG_H
|
|
28
|
+
#include "config.h"
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
#include <stdio.h>
|
|
32
|
+
#include <stdlib.h>
|
|
33
|
+
#include <sys/types.h>
|
|
34
|
+
|
|
35
|
+
#include "rnn.h"
|
|
36
|
+
#include "rnn_data.h"
|
|
37
|
+
#include "rnnoise.h"
|
|
38
|
+
|
|
39
|
+
/* Although these values are the same as in rnn.h, we make them separate to
|
|
40
|
+
* avoid accidentally burning internal values into a file format */
|
|
41
|
+
#define F_ACTIVATION_TANH 0
|
|
42
|
+
#define F_ACTIVATION_SIGMOID 1
|
|
43
|
+
#define F_ACTIVATION_RELU 2
|
|
44
|
+
|
|
45
|
+
RNNModel *rnnoise_model_from_file(FILE *f)
|
|
46
|
+
{
|
|
47
|
+
int i, in;
|
|
48
|
+
|
|
49
|
+
if (fscanf(f, "rnnoise-nu model file version %d\n", &in) != 1 || in != 1)
|
|
50
|
+
return NULL;
|
|
51
|
+
|
|
52
|
+
RNNModel *ret = calloc(1, sizeof(RNNModel));
|
|
53
|
+
if (!ret)
|
|
54
|
+
return NULL;
|
|
55
|
+
|
|
56
|
+
#define ALLOC_LAYER(type, name) \
|
|
57
|
+
type *name; \
|
|
58
|
+
name = calloc(1, sizeof(type)); \
|
|
59
|
+
if (!name) { \
|
|
60
|
+
rnnoise_model_free(ret); \
|
|
61
|
+
return NULL; \
|
|
62
|
+
} \
|
|
63
|
+
ret->name = name
|
|
64
|
+
|
|
65
|
+
ALLOC_LAYER(DenseLayer, input_dense);
|
|
66
|
+
ALLOC_LAYER(GRULayer, vad_gru);
|
|
67
|
+
ALLOC_LAYER(GRULayer, noise_gru);
|
|
68
|
+
ALLOC_LAYER(GRULayer, denoise_gru);
|
|
69
|
+
ALLOC_LAYER(DenseLayer, denoise_output);
|
|
70
|
+
ALLOC_LAYER(DenseLayer, vad_output);
|
|
71
|
+
|
|
72
|
+
#define INPUT_VAL(name) do { \
|
|
73
|
+
if (fscanf(f, "%d", &in) != 1 || in < 0 || in > 128) { \
|
|
74
|
+
rnnoise_model_free(ret); \
|
|
75
|
+
return NULL; \
|
|
76
|
+
} \
|
|
77
|
+
name = in; \
|
|
78
|
+
} while (0)
|
|
79
|
+
|
|
80
|
+
#define INPUT_ACTIVATION(name) do { \
|
|
81
|
+
int activation; \
|
|
82
|
+
INPUT_VAL(activation); \
|
|
83
|
+
switch (activation) { \
|
|
84
|
+
case F_ACTIVATION_SIGMOID: \
|
|
85
|
+
name = ACTIVATION_SIGMOID; \
|
|
86
|
+
break; \
|
|
87
|
+
case F_ACTIVATION_RELU: \
|
|
88
|
+
name = ACTIVATION_RELU; \
|
|
89
|
+
break; \
|
|
90
|
+
default: \
|
|
91
|
+
name = ACTIVATION_TANH; \
|
|
92
|
+
} \
|
|
93
|
+
} while (0)
|
|
94
|
+
|
|
95
|
+
#define INPUT_ARRAY(name, len) do { \
|
|
96
|
+
rnn_weight *values = malloc((len) * sizeof(rnn_weight)); \
|
|
97
|
+
if (!values) { \
|
|
98
|
+
rnnoise_model_free(ret); \
|
|
99
|
+
return NULL; \
|
|
100
|
+
} \
|
|
101
|
+
name = values; \
|
|
102
|
+
for (i = 0; i < (len); i++) { \
|
|
103
|
+
if (fscanf(f, "%d", &in) != 1) { \
|
|
104
|
+
rnnoise_model_free(ret); \
|
|
105
|
+
return NULL; \
|
|
106
|
+
} \
|
|
107
|
+
values[i] = in; \
|
|
108
|
+
} \
|
|
109
|
+
} while (0)
|
|
110
|
+
|
|
111
|
+
#define INPUT_DENSE(name) do { \
|
|
112
|
+
INPUT_VAL(name->nb_inputs); \
|
|
113
|
+
INPUT_VAL(name->nb_neurons); \
|
|
114
|
+
ret->name ## _size = name->nb_neurons; \
|
|
115
|
+
INPUT_ACTIVATION(name->activation); \
|
|
116
|
+
INPUT_ARRAY(name->input_weights, name->nb_inputs * name->nb_neurons); \
|
|
117
|
+
INPUT_ARRAY(name->bias, name->nb_neurons); \
|
|
118
|
+
} while (0)
|
|
119
|
+
|
|
120
|
+
#define INPUT_GRU(name) do { \
|
|
121
|
+
INPUT_VAL(name->nb_inputs); \
|
|
122
|
+
INPUT_VAL(name->nb_neurons); \
|
|
123
|
+
ret->name ## _size = name->nb_neurons; \
|
|
124
|
+
INPUT_ACTIVATION(name->activation); \
|
|
125
|
+
INPUT_ARRAY(name->input_weights, name->nb_inputs * name->nb_neurons * 3); \
|
|
126
|
+
INPUT_ARRAY(name->recurrent_weights, name->nb_neurons * name->nb_neurons * 3); \
|
|
127
|
+
INPUT_ARRAY(name->bias, name->nb_neurons * 3); \
|
|
128
|
+
} while (0)
|
|
129
|
+
|
|
130
|
+
INPUT_DENSE(input_dense);
|
|
131
|
+
INPUT_GRU(vad_gru);
|
|
132
|
+
INPUT_GRU(noise_gru);
|
|
133
|
+
INPUT_GRU(denoise_gru);
|
|
134
|
+
INPUT_DENSE(denoise_output);
|
|
135
|
+
INPUT_DENSE(vad_output);
|
|
136
|
+
|
|
137
|
+
return ret;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
void rnnoise_model_free(RNNModel *model)
|
|
141
|
+
{
|
|
142
|
+
#define FREE_MAYBE(ptr) do { if (ptr) free(ptr); } while (0)
|
|
143
|
+
#define FREE_DENSE(name) do { \
|
|
144
|
+
if (model->name) { \
|
|
145
|
+
free((void *) model->name->input_weights); \
|
|
146
|
+
free((void *) model->name->bias); \
|
|
147
|
+
free((void *) model->name); \
|
|
148
|
+
} \
|
|
149
|
+
} while (0)
|
|
150
|
+
#define FREE_GRU(name) do { \
|
|
151
|
+
if (model->name) { \
|
|
152
|
+
free((void *) model->name->input_weights); \
|
|
153
|
+
free((void *) model->name->recurrent_weights); \
|
|
154
|
+
free((void *) model->name->bias); \
|
|
155
|
+
free((void *) model->name); \
|
|
156
|
+
} \
|
|
157
|
+
} while (0)
|
|
158
|
+
|
|
159
|
+
if (!model)
|
|
160
|
+
return;
|
|
161
|
+
FREE_DENSE(input_dense);
|
|
162
|
+
FREE_GRU(vad_gru);
|
|
163
|
+
FREE_GRU(noise_gru);
|
|
164
|
+
FREE_GRU(denoise_gru);
|
|
165
|
+
FREE_DENSE(denoise_output);
|
|
166
|
+
FREE_DENSE(vad_output);
|
|
167
|
+
free(model);
|
|
168
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
#!/usr/bin/python
|
|
2
|
+
|
|
3
|
+
from __future__ import print_function
|
|
4
|
+
|
|
5
|
+
from keras.models import Sequential
|
|
6
|
+
from keras.models import Model
|
|
7
|
+
from keras.layers import Input
|
|
8
|
+
from keras.layers import Dense
|
|
9
|
+
from keras.layers import LSTM
|
|
10
|
+
from keras.layers import GRU
|
|
11
|
+
from keras.layers import SimpleRNN
|
|
12
|
+
from keras.layers import Dropout
|
|
13
|
+
from keras import losses
|
|
14
|
+
import h5py
|
|
15
|
+
|
|
16
|
+
from keras import backend as K
|
|
17
|
+
import numpy as np
|
|
18
|
+
|
|
19
|
+
print('Build model...')
|
|
20
|
+
main_input = Input(shape=(None, 22), name='main_input')
|
|
21
|
+
#x = Dense(44, activation='relu')(main_input)
|
|
22
|
+
#x = GRU(44, dropout=0.0, recurrent_dropout=0.0, activation='tanh', recurrent_activation='sigmoid', return_sequences=True)(x)
|
|
23
|
+
x=main_input
|
|
24
|
+
x = GRU(128, activation='tanh', recurrent_activation='sigmoid', return_sequences=True)(x)
|
|
25
|
+
#x = GRU(128, return_sequences=True)(x)
|
|
26
|
+
#x = GRU(22, activation='relu', return_sequences=True)(x)
|
|
27
|
+
x = Dense(22, activation='sigmoid')(x)
|
|
28
|
+
#x = Dense(22, activation='softplus')(x)
|
|
29
|
+
model = Model(inputs=main_input, outputs=x)
|
|
30
|
+
|
|
31
|
+
batch_size = 32
|
|
32
|
+
|
|
33
|
+
print('Loading data...')
|
|
34
|
+
with h5py.File('denoise_data.h5', 'r') as hf:
|
|
35
|
+
all_data = hf['denoise_data'][:]
|
|
36
|
+
print('done.')
|
|
37
|
+
|
|
38
|
+
window_size = 500
|
|
39
|
+
|
|
40
|
+
nb_sequences = len(all_data)//window_size
|
|
41
|
+
print(nb_sequences, ' sequences')
|
|
42
|
+
x_train = all_data[:nb_sequences*window_size, :-22]
|
|
43
|
+
x_train = np.reshape(x_train, (nb_sequences, window_size, 22))
|
|
44
|
+
|
|
45
|
+
y_train = np.copy(all_data[:nb_sequences*window_size, -22:])
|
|
46
|
+
y_train = np.reshape(y_train, (nb_sequences, window_size, 22))
|
|
47
|
+
|
|
48
|
+
#y_train = -20*np.log10(np.add(y_train, .03));
|
|
49
|
+
|
|
50
|
+
all_data = 0;
|
|
51
|
+
x_train = x_train.astype('float32')
|
|
52
|
+
y_train = y_train.astype('float32')
|
|
53
|
+
|
|
54
|
+
print(len(x_train), 'train sequences. x shape =', x_train.shape, 'y shape = ', y_train.shape)
|
|
55
|
+
|
|
56
|
+
# try using different optimizers and different optimizer configs
|
|
57
|
+
model.compile(loss='mean_squared_error',
|
|
58
|
+
optimizer='adam',
|
|
59
|
+
metrics=['binary_accuracy'])
|
|
60
|
+
|
|
61
|
+
print('Train...')
|
|
62
|
+
model.fit(x_train, y_train,
|
|
63
|
+
batch_size=batch_size,
|
|
64
|
+
epochs=200,
|
|
65
|
+
validation_data=(x_train, y_train))
|
|
66
|
+
model.save("newweights.hdf5")
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/* This file is auto-generated by gen_tables */
|
|
2
|
+
|
|
3
|
+
static const float tansig_table[201] = {
|
|
4
|
+
0.000000f, 0.039979f, 0.079830f, 0.119427f, 0.158649f,
|
|
5
|
+
0.197375f, 0.235496f, 0.272905f, 0.309507f, 0.345214f,
|
|
6
|
+
0.379949f, 0.413644f, 0.446244f, 0.477700f, 0.507977f,
|
|
7
|
+
0.537050f, 0.564900f, 0.591519f, 0.616909f, 0.641077f,
|
|
8
|
+
0.664037f, 0.685809f, 0.706419f, 0.725897f, 0.744277f,
|
|
9
|
+
0.761594f, 0.777888f, 0.793199f, 0.807569f, 0.821040f,
|
|
10
|
+
0.833655f, 0.845456f, 0.856485f, 0.866784f, 0.876393f,
|
|
11
|
+
0.885352f, 0.893698f, 0.901468f, 0.908698f, 0.915420f,
|
|
12
|
+
0.921669f, 0.927473f, 0.932862f, 0.937863f, 0.942503f,
|
|
13
|
+
0.946806f, 0.950795f, 0.954492f, 0.957917f, 0.961090f,
|
|
14
|
+
0.964028f, 0.966747f, 0.969265f, 0.971594f, 0.973749f,
|
|
15
|
+
0.975743f, 0.977587f, 0.979293f, 0.980869f, 0.982327f,
|
|
16
|
+
0.983675f, 0.984921f, 0.986072f, 0.987136f, 0.988119f,
|
|
17
|
+
0.989027f, 0.989867f, 0.990642f, 0.991359f, 0.992020f,
|
|
18
|
+
0.992631f, 0.993196f, 0.993718f, 0.994199f, 0.994644f,
|
|
19
|
+
0.995055f, 0.995434f, 0.995784f, 0.996108f, 0.996407f,
|
|
20
|
+
0.996682f, 0.996937f, 0.997172f, 0.997389f, 0.997590f,
|
|
21
|
+
0.997775f, 0.997946f, 0.998104f, 0.998249f, 0.998384f,
|
|
22
|
+
0.998508f, 0.998623f, 0.998728f, 0.998826f, 0.998916f,
|
|
23
|
+
0.999000f, 0.999076f, 0.999147f, 0.999213f, 0.999273f,
|
|
24
|
+
0.999329f, 0.999381f, 0.999428f, 0.999472f, 0.999513f,
|
|
25
|
+
0.999550f, 0.999585f, 0.999617f, 0.999646f, 0.999673f,
|
|
26
|
+
0.999699f, 0.999722f, 0.999743f, 0.999763f, 0.999781f,
|
|
27
|
+
0.999798f, 0.999813f, 0.999828f, 0.999841f, 0.999853f,
|
|
28
|
+
0.999865f, 0.999875f, 0.999885f, 0.999893f, 0.999902f,
|
|
29
|
+
0.999909f, 0.999916f, 0.999923f, 0.999929f, 0.999934f,
|
|
30
|
+
0.999939f, 0.999944f, 0.999948f, 0.999952f, 0.999956f,
|
|
31
|
+
0.999959f, 0.999962f, 0.999965f, 0.999968f, 0.999970f,
|
|
32
|
+
0.999973f, 0.999975f, 0.999977f, 0.999978f, 0.999980f,
|
|
33
|
+
0.999982f, 0.999983f, 0.999984f, 0.999986f, 0.999987f,
|
|
34
|
+
0.999988f, 0.999989f, 0.999990f, 0.999990f, 0.999991f,
|
|
35
|
+
0.999992f, 0.999992f, 0.999993f, 0.999994f, 0.999994f,
|
|
36
|
+
0.999994f, 0.999995f, 0.999995f, 0.999996f, 0.999996f,
|
|
37
|
+
0.999996f, 0.999997f, 0.999997f, 0.999997f, 0.999997f,
|
|
38
|
+
0.999997f, 0.999998f, 0.999998f, 0.999998f, 0.999998f,
|
|
39
|
+
0.999998f, 0.999998f, 0.999999f, 0.999999f, 0.999999f,
|
|
40
|
+
0.999999f, 0.999999f, 0.999999f, 0.999999f, 0.999999f,
|
|
41
|
+
0.999999f, 0.999999f, 0.999999f, 0.999999f, 0.999999f,
|
|
42
|
+
1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f,
|
|
43
|
+
1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f,
|
|
44
|
+
1.000000f,
|
|
45
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
package com.mentra.lc3Lib;
|
|
2
|
+
|
|
3
|
+
public class Lc3Cpp {
|
|
4
|
+
|
|
5
|
+
static {
|
|
6
|
+
System.loadLibrary("lc3");
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
private Lc3Cpp() {
|
|
10
|
+
// Private constructor to prevent instantiation
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
public static void init() {
|
|
14
|
+
// This method can be used for additional initialization if needed
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
public static native long initEncoder();
|
|
18
|
+
public static native void freeEncoder(long encoderPtr);
|
|
19
|
+
|
|
20
|
+
// Parameterized encoding function with frame size
|
|
21
|
+
public static native byte[] encodeLC3(long encoderPtr, byte[] pcmData, int frameSize);
|
|
22
|
+
|
|
23
|
+
// Convenience overload with default frame size (20 bytes for backward compatibility)
|
|
24
|
+
public static byte[] encodeLC3(long encoderPtr, byte[] pcmData) {
|
|
25
|
+
return encodeLC3(encoderPtr, pcmData, 20);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public static native long initDecoder();
|
|
29
|
+
public static native void freeDecoder(long decoderPtr);
|
|
30
|
+
|
|
31
|
+
// Parameterized decoding function with frame size
|
|
32
|
+
public static native byte[] decodeLC3(long decoderPtr, byte[] lc3Data, int frameSize);
|
|
33
|
+
|
|
34
|
+
// Convenience overload with default frame size (20 bytes for backward compatibility)
|
|
35
|
+
public static byte[] decodeLC3(long decoderPtr, byte[] lc3Data) {
|
|
36
|
+
return decodeLC3(decoderPtr, lc3Data, 20);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.4.1)
|
|
2
|
+
include(ExternalProject)
|
|
3
|
+
|
|
4
|
+
set(opus_tools_src ${CMAKE_CURRENT_SOURCE_DIR}/opus_tools/src)
|
|
5
|
+
ExternalProject_Add(external_opus_tools
|
|
6
|
+
GIT_REPOSITORY "https://github.com/xiph/opus-tools/"
|
|
7
|
+
GIT_TAG "14f650f64260115098d55fb91e1f83110cb628d3"
|
|
8
|
+
SOURCE_DIR "${opus_tools_src}"
|
|
9
|
+
CONFIGURE_COMMAND sh ${CMAKE_CURRENT_SOURCE_DIR}/build/include_files_helper.sh ${CMAKE_CURRENT_SOURCE_DIR}/build/
|
|
10
|
+
COMMAND ${CMAKE_COMMAND} -E copy
|
|
11
|
+
${CMAKE_CURRENT_BINARY_DIR}/build/libogg/${ANDROID_ABI}/include/ogg/config_types.h
|
|
12
|
+
${CMAKE_CURRENT_SOURCE_DIR}/../src/main/cpp/libogg/
|
|
13
|
+
COMMAND ${CMAKE_COMMAND} ${opus_tools_src}
|
|
14
|
+
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
|
|
15
|
+
-DANDROID_ABI=${ANDROID_ABI}
|
|
16
|
+
-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/build/opus_tools/${ANDROID_ABI}
|
|
17
|
+
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/build/opus_tools/${ANDROID_ABI}/lib/
|
|
18
|
+
INSTALL_COMMAND ""
|
|
19
|
+
COMMAND
|
|
20
|
+
${CMAKE_COMMAND} -E copy
|
|
21
|
+
${CMAKE_CURRENT_BINARY_DIR}/build/opus_tools/${ANDROID_ABI}/lib/libopus_header.a
|
|
22
|
+
${CMAKE_CURRENT_SOURCE_DIR}/opus_tools/lib/${ANDROID_ABI}/
|
|
23
|
+
)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.4.1)
|
|
2
|
+
include(ExternalProject)
|
|
3
|
+
|
|
4
|
+
set(libogg_src ${CMAKE_CURRENT_SOURCE_DIR}/libogg/src)
|
|
5
|
+
ExternalProject_Add(external_libogg
|
|
6
|
+
GIT_REPOSITORY "https://github.com/xiph/ogg.git"
|
|
7
|
+
GIT_TAG "934385378f45f11586b03b6214bf5f363649f3b6"
|
|
8
|
+
SOURCE_DIR "${libogg_src}"
|
|
9
|
+
CONFIGURE_COMMAND ${CMAKE_COMMAND} ${libogg_src}
|
|
10
|
+
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
|
|
11
|
+
-DANDROID_ABI=${ANDROID_ABI}
|
|
12
|
+
-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/build/libogg/${ANDROID_ABI}
|
|
13
|
+
INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} install
|
|
14
|
+
&&
|
|
15
|
+
${CMAKE_COMMAND} -E copy
|
|
16
|
+
${CMAKE_CURRENT_BINARY_DIR}/build/libogg/${ANDROID_ABI}/lib/libogg.a
|
|
17
|
+
${CMAKE_CURRENT_SOURCE_DIR}/libogg/lib/${ANDROID_ABI}/
|
|
18
|
+
)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.4.1)
|
|
2
|
+
include(ExternalProject)
|
|
3
|
+
|
|
4
|
+
set(libopus_src ${CMAKE_CURRENT_SOURCE_DIR}/libopus/src)
|
|
5
|
+
ExternalProject_Add(external_libopus
|
|
6
|
+
GIT_REPOSITORY "https://github.com/xiph/opus"
|
|
7
|
+
GIT_TAG "ad8fe90db79b7d2a135e3dfd2ed6631b0c5662ab"
|
|
8
|
+
SOURCE_DIR "${libopus_src}"
|
|
9
|
+
CONFIGURE_COMMAND ${CMAKE_COMMAND} ${libopus_src}
|
|
10
|
+
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
|
|
11
|
+
-DANDROID_ABI=${ANDROID_ABI}
|
|
12
|
+
-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/build/libopus/${ANDROID_ABI}
|
|
13
|
+
INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} install
|
|
14
|
+
&&
|
|
15
|
+
${CMAKE_COMMAND} -E copy
|
|
16
|
+
${CMAKE_CURRENT_BINARY_DIR}/build/libopus/${ANDROID_ABI}/lib/libopus.a
|
|
17
|
+
${CMAKE_CURRENT_SOURCE_DIR}/libopus/lib/${ANDROID_ABI}/
|
|
18
|
+
)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.4.1)
|
|
2
|
+
include(ExternalProject)
|
|
3
|
+
|
|
4
|
+
set(opus_tools_src ${CMAKE_CURRENT_SOURCE_DIR}/opus_tools/src)
|
|
5
|
+
ExternalProject_Add(external_opus_tools
|
|
6
|
+
GIT_REPOSITORY "https://github.com/xiph/opus-tools/"
|
|
7
|
+
GIT_TAG "14f650f64260115098d55fb91e1f83110cb628d3"
|
|
8
|
+
SOURCE_DIR "${opus_tools_src}"
|
|
9
|
+
CONFIGURE_COMMAND sh ${CMAKE_CURRENT_SOURCE_DIR}/build/include_files_helper.sh ${CMAKE_CURRENT_SOURCE_DIR}/build/
|
|
10
|
+
COMMAND ${CMAKE_COMMAND} -E copy
|
|
11
|
+
${CMAKE_CURRENT_BINARY_DIR}/build/libogg/${ANDROID_ABI}/include/ogg/config_types.h
|
|
12
|
+
${CMAKE_CURRENT_SOURCE_DIR}/../src/main/cpp/libogg/
|
|
13
|
+
COMMAND ${CMAKE_COMMAND} ${opus_tools_src}
|
|
14
|
+
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
|
|
15
|
+
-DANDROID_ABI=${ANDROID_ABI}
|
|
16
|
+
-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/build/opus_tools/${ANDROID_ABI}
|
|
17
|
+
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/build/opus_tools/${ANDROID_ABI}/lib/
|
|
18
|
+
INSTALL_COMMAND ""
|
|
19
|
+
COMMAND
|
|
20
|
+
${CMAKE_COMMAND} -E copy
|
|
21
|
+
${CMAKE_CURRENT_BINARY_DIR}/build/opus_tools/${ANDROID_ABI}/lib/libopus_header.a
|
|
22
|
+
${CMAKE_CURRENT_SOURCE_DIR}/opus_tools/lib/${ANDROID_ABI}/
|
|
23
|
+
)
|