@drutech/react-native-audio-analyzer 1.1.1-alpha.1
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/LICENSE +20 -0
- package/README.md +124 -0
- package/android/CMakeCache.txt +372 -0
- package/android/CMakeLists.txt +44 -0
- package/android/Makefile +211 -0
- package/android/build.gradle +110 -0
- package/android/cmake_install.cmake +49 -0
- package/android/cpp-adapter.cpp +40 -0
- package/android/ffmpeg_16kb/include/config.h +749 -0
- package/android/ffmpeg_16kb/include/libavcodec/ac3_parser.h +36 -0
- package/android/ffmpeg_16kb/include/libavcodec/adts_parser.h +37 -0
- package/android/ffmpeg_16kb/include/libavcodec/arm/mathops.h +108 -0
- package/android/ffmpeg_16kb/include/libavcodec/avcodec.h +3192 -0
- package/android/ffmpeg_16kb/include/libavcodec/avdct.h +88 -0
- package/android/ffmpeg_16kb/include/libavcodec/avfft.h +118 -0
- package/android/ffmpeg_16kb/include/libavcodec/bsf.h +332 -0
- package/android/ffmpeg_16kb/include/libavcodec/codec.h +375 -0
- package/android/ffmpeg_16kb/include/libavcodec/codec_desc.h +128 -0
- package/android/ffmpeg_16kb/include/libavcodec/codec_id.h +661 -0
- package/android/ffmpeg_16kb/include/libavcodec/codec_par.h +247 -0
- package/android/ffmpeg_16kb/include/libavcodec/d3d11va.h +112 -0
- package/android/ffmpeg_16kb/include/libavcodec/defs.h +192 -0
- package/android/ffmpeg_16kb/include/libavcodec/dirac.h +131 -0
- package/android/ffmpeg_16kb/include/libavcodec/dv_profile.h +82 -0
- package/android/ffmpeg_16kb/include/libavcodec/dxva2.h +93 -0
- package/android/ffmpeg_16kb/include/libavcodec/jni.h +46 -0
- package/android/ffmpeg_16kb/include/libavcodec/mathops.h +255 -0
- package/android/ffmpeg_16kb/include/libavcodec/mediacodec.h +103 -0
- package/android/ffmpeg_16kb/include/libavcodec/packet.h +731 -0
- package/android/ffmpeg_16kb/include/libavcodec/qsv.h +109 -0
- package/android/ffmpeg_16kb/include/libavcodec/vdpau.h +157 -0
- package/android/ffmpeg_16kb/include/libavcodec/version.h +45 -0
- package/android/ffmpeg_16kb/include/libavcodec/version_major.h +52 -0
- package/android/ffmpeg_16kb/include/libavcodec/videotoolbox.h +150 -0
- package/android/ffmpeg_16kb/include/libavcodec/vorbis_parser.h +74 -0
- package/android/ffmpeg_16kb/include/libavcodec/x86/mathops.h +133 -0
- package/android/ffmpeg_16kb/include/libavcodec/xvmc.h +171 -0
- package/android/ffmpeg_16kb/include/libavdevice/avdevice.h +397 -0
- package/android/ffmpeg_16kb/include/libavdevice/version.h +45 -0
- package/android/ffmpeg_16kb/include/libavdevice/version_major.h +36 -0
- package/android/ffmpeg_16kb/include/libavfilter/avfilter.h +1491 -0
- package/android/ffmpeg_16kb/include/libavfilter/buffersink.h +173 -0
- package/android/ffmpeg_16kb/include/libavfilter/buffersrc.h +218 -0
- package/android/ffmpeg_16kb/include/libavfilter/version.h +48 -0
- package/android/ffmpeg_16kb/include/libavfilter/version_major.h +38 -0
- package/android/ffmpeg_16kb/include/libavformat/avformat.h +2826 -0
- package/android/ffmpeg_16kb/include/libavformat/avio.h +837 -0
- package/android/ffmpeg_16kb/include/libavformat/network.h +341 -0
- package/android/ffmpeg_16kb/include/libavformat/os_support.h +317 -0
- package/android/ffmpeg_16kb/include/libavformat/url.h +409 -0
- package/android/ffmpeg_16kb/include/libavformat/version.h +47 -0
- package/android/ffmpeg_16kb/include/libavformat/version_major.h +52 -0
- package/android/ffmpeg_16kb/include/libavutil/aarch64/timer.h +50 -0
- package/android/ffmpeg_16kb/include/libavutil/adler32.h +63 -0
- package/android/ffmpeg_16kb/include/libavutil/aes.h +69 -0
- package/android/ffmpeg_16kb/include/libavutil/aes_ctr.h +99 -0
- package/android/ffmpeg_16kb/include/libavutil/ambient_viewing_environment.h +72 -0
- package/android/ffmpeg_16kb/include/libavutil/arm/timer.h +46 -0
- package/android/ffmpeg_16kb/include/libavutil/attributes.h +173 -0
- package/android/ffmpeg_16kb/include/libavutil/attributes_internal.h +34 -0
- package/android/ffmpeg_16kb/include/libavutil/audio_fifo.h +186 -0
- package/android/ffmpeg_16kb/include/libavutil/avassert.h +75 -0
- package/android/ffmpeg_16kb/include/libavutil/avconfig.h +6 -0
- package/android/ffmpeg_16kb/include/libavutil/avstring.h +429 -0
- package/android/ffmpeg_16kb/include/libavutil/avutil.h +371 -0
- package/android/ffmpeg_16kb/include/libavutil/base64.h +72 -0
- package/android/ffmpeg_16kb/include/libavutil/blowfish.h +82 -0
- package/android/ffmpeg_16kb/include/libavutil/bprint.h +251 -0
- package/android/ffmpeg_16kb/include/libavutil/bswap.h +111 -0
- package/android/ffmpeg_16kb/include/libavutil/buffer.h +322 -0
- package/android/ffmpeg_16kb/include/libavutil/camellia.h +70 -0
- package/android/ffmpeg_16kb/include/libavutil/cast5.h +80 -0
- package/android/ffmpeg_16kb/include/libavutil/channel_layout.h +783 -0
- package/android/ffmpeg_16kb/include/libavutil/common.h +578 -0
- package/android/ffmpeg_16kb/include/libavutil/cpu.h +134 -0
- package/android/ffmpeg_16kb/include/libavutil/crc.h +102 -0
- package/android/ffmpeg_16kb/include/libavutil/csp.h +150 -0
- package/android/ffmpeg_16kb/include/libavutil/des.h +81 -0
- package/android/ffmpeg_16kb/include/libavutil/detection_bbox.h +108 -0
- package/android/ffmpeg_16kb/include/libavutil/dict.h +241 -0
- package/android/ffmpeg_16kb/include/libavutil/display.h +109 -0
- package/android/ffmpeg_16kb/include/libavutil/dovi_meta.h +236 -0
- package/android/ffmpeg_16kb/include/libavutil/downmix_info.h +115 -0
- package/android/ffmpeg_16kb/include/libavutil/encryption_info.h +205 -0
- package/android/ffmpeg_16kb/include/libavutil/error.h +128 -0
- package/android/ffmpeg_16kb/include/libavutil/eval.h +140 -0
- package/android/ffmpeg_16kb/include/libavutil/ffversion.h +5 -0
- package/android/ffmpeg_16kb/include/libavutil/fifo.h +448 -0
- package/android/ffmpeg_16kb/include/libavutil/file.h +115 -0
- package/android/ffmpeg_16kb/include/libavutil/film_grain_params.h +260 -0
- package/android/ffmpeg_16kb/include/libavutil/frame.h +964 -0
- package/android/ffmpeg_16kb/include/libavutil/getenv_utf8.h +86 -0
- package/android/ffmpeg_16kb/include/libavutil/hash.h +264 -0
- package/android/ffmpeg_16kb/include/libavutil/hdr_dynamic_metadata.h +343 -0
- package/android/ffmpeg_16kb/include/libavutil/hdr_dynamic_vivid_metadata.h +285 -0
- package/android/ffmpeg_16kb/include/libavutil/hmac.h +99 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext.h +610 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_cuda.h +69 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_d3d11va.h +178 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_drm.h +169 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_dxva2.h +75 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_mediacodec.h +61 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_opencl.h +100 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_qsv.h +64 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_vaapi.h +117 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_vdpau.h +44 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_videotoolbox.h +96 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_vulkan.h +281 -0
- package/android/ffmpeg_16kb/include/libavutil/imgutils.h +331 -0
- package/android/ffmpeg_16kb/include/libavutil/internal.h +190 -0
- package/android/ffmpeg_16kb/include/libavutil/intfloat.h +77 -0
- package/android/ffmpeg_16kb/include/libavutil/intreadwrite.h +644 -0
- package/android/ffmpeg_16kb/include/libavutil/lfg.h +81 -0
- package/android/ffmpeg_16kb/include/libavutil/libm.h +471 -0
- package/android/ffmpeg_16kb/include/libavutil/log.h +387 -0
- package/android/ffmpeg_16kb/include/libavutil/lzo.h +66 -0
- package/android/ffmpeg_16kb/include/libavutil/macros.h +80 -0
- package/android/ffmpeg_16kb/include/libavutil/mastering_display_metadata.h +128 -0
- package/android/ffmpeg_16kb/include/libavutil/mathematics.h +245 -0
- package/android/ffmpeg_16kb/include/libavutil/md5.h +89 -0
- package/android/ffmpeg_16kb/include/libavutil/mem.h +609 -0
- package/android/ffmpeg_16kb/include/libavutil/motion_vector.h +57 -0
- package/android/ffmpeg_16kb/include/libavutil/murmur3.h +115 -0
- package/android/ffmpeg_16kb/include/libavutil/opt.h +891 -0
- package/android/ffmpeg_16kb/include/libavutil/parseutils.h +197 -0
- package/android/ffmpeg_16kb/include/libavutil/pixdesc.h +435 -0
- package/android/ffmpeg_16kb/include/libavutil/pixelutils.h +51 -0
- package/android/ffmpeg_16kb/include/libavutil/pixfmt.h +691 -0
- package/android/ffmpeg_16kb/include/libavutil/random_seed.h +43 -0
- package/android/ffmpeg_16kb/include/libavutil/rational.h +221 -0
- package/android/ffmpeg_16kb/include/libavutil/rc4.h +69 -0
- package/android/ffmpeg_16kb/include/libavutil/replaygain.h +50 -0
- package/android/ffmpeg_16kb/include/libavutil/reverse.h +28 -0
- package/android/ffmpeg_16kb/include/libavutil/ripemd.h +83 -0
- package/android/ffmpeg_16kb/include/libavutil/samplefmt.h +269 -0
- package/android/ffmpeg_16kb/include/libavutil/sha.h +90 -0
- package/android/ffmpeg_16kb/include/libavutil/sha512.h +92 -0
- package/android/ffmpeg_16kb/include/libavutil/spherical.h +227 -0
- package/android/ffmpeg_16kb/include/libavutil/stereo3d.h +229 -0
- package/android/ffmpeg_16kb/include/libavutil/tea.h +71 -0
- package/android/ffmpeg_16kb/include/libavutil/thread.h +204 -0
- package/android/ffmpeg_16kb/include/libavutil/threadmessage.h +115 -0
- package/android/ffmpeg_16kb/include/libavutil/time.h +56 -0
- package/android/ffmpeg_16kb/include/libavutil/timecode.h +199 -0
- package/android/ffmpeg_16kb/include/libavutil/timer.h +156 -0
- package/android/ffmpeg_16kb/include/libavutil/timestamp.h +78 -0
- package/android/ffmpeg_16kb/include/libavutil/tree.h +137 -0
- package/android/ffmpeg_16kb/include/libavutil/twofish.h +70 -0
- package/android/ffmpeg_16kb/include/libavutil/tx.h +176 -0
- package/android/ffmpeg_16kb/include/libavutil/uuid.h +146 -0
- package/android/ffmpeg_16kb/include/libavutil/version.h +122 -0
- package/android/ffmpeg_16kb/include/libavutil/video_enc_params.h +171 -0
- package/android/ffmpeg_16kb/include/libavutil/x86/asm.h +154 -0
- package/android/ffmpeg_16kb/include/libavutil/x86/emms.h +58 -0
- package/android/ffmpeg_16kb/include/libavutil/x86/timer.h +50 -0
- package/android/ffmpeg_16kb/include/libavutil/xtea.h +94 -0
- package/android/ffmpeg_16kb/include/libswresample/swresample.h +650 -0
- package/android/ffmpeg_16kb/include/libswresample/version.h +46 -0
- package/android/ffmpeg_16kb/include/libswresample/version_major.h +31 -0
- package/android/ffmpeg_16kb/include/libswscale/swscale.h +436 -0
- package/android/ffmpeg_16kb/include/libswscale/version.h +44 -0
- package/android/ffmpeg_16kb/include/libswscale/version_major.h +35 -0
- package/android/ffmpeg_16kb/lib/arm64-v8a/libavcodec.so +0 -0
- package/android/ffmpeg_16kb/lib/arm64-v8a/libavdevice.so +0 -0
- package/android/ffmpeg_16kb/lib/arm64-v8a/libavfilter.so +0 -0
- package/android/ffmpeg_16kb/lib/arm64-v8a/libavformat.so +0 -0
- package/android/ffmpeg_16kb/lib/arm64-v8a/libavutil.so +0 -0
- package/android/ffmpeg_16kb/lib/arm64-v8a/libswresample.so +0 -0
- package/android/ffmpeg_16kb/lib/arm64-v8a/libswscale.so +0 -0
- package/android/ffmpeg_16kb/lib/armeabi-v7a/libavcodec_neon.so +0 -0
- package/android/ffmpeg_16kb/lib/armeabi-v7a/libavdevice_neon.so +0 -0
- package/android/ffmpeg_16kb/lib/armeabi-v7a/libavfilter_neon.so +0 -0
- package/android/ffmpeg_16kb/lib/armeabi-v7a/libavformat_neon.so +0 -0
- package/android/ffmpeg_16kb/lib/armeabi-v7a/libavutil_neon.so +0 -0
- package/android/ffmpeg_16kb/lib/armeabi-v7a/libswresample_neon.so +0 -0
- package/android/ffmpeg_16kb/lib/armeabi-v7a/libswscale_neon.so +0 -0
- package/android/ffmpeg_16kb/lib/x86/libavcodec.so +0 -0
- package/android/ffmpeg_16kb/lib/x86/libavdevice.so +0 -0
- package/android/ffmpeg_16kb/lib/x86/libavfilter.so +0 -0
- package/android/ffmpeg_16kb/lib/x86/libavformat.so +0 -0
- package/android/ffmpeg_16kb/lib/x86/libavutil.so +0 -0
- package/android/ffmpeg_16kb/lib/x86/libswresample.so +0 -0
- package/android/ffmpeg_16kb/lib/x86/libswscale.so +0 -0
- package/android/ffmpeg_16kb/lib/x86_64/libavcodec.so +0 -0
- package/android/ffmpeg_16kb/lib/x86_64/libavdevice.so +0 -0
- package/android/ffmpeg_16kb/lib/x86_64/libavfilter.so +0 -0
- package/android/ffmpeg_16kb/lib/x86_64/libavformat.so +0 -0
- package/android/ffmpeg_16kb/lib/x86_64/libavutil.so +0 -0
- package/android/ffmpeg_16kb/lib/x86_64/libswresample.so +0 -0
- package/android/ffmpeg_16kb/lib/x86_64/libswscale.so +0 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/AndroidManifestNew.xml +2 -0
- package/android/src/main/java/com/audioanalyzer/AmplitudeData.java +20 -0
- package/android/src/main/java/com/audioanalyzer/AudioAnalyzerModule.java +52 -0
- package/android/src/main/java/com/audioanalyzer/AudioAnalyzerPackage.java +28 -0
- package/cpp/react-native-audio-analyzer.cpp +143 -0
- package/cpp/react-native-audio-analyzer.h +27 -0
- package/ios/AudioAnalyzer.h +19 -0
- package/ios/AudioAnalyzer.mm +43 -0
- package/lib/commonjs/helpers.js +34 -0
- package/lib/commonjs/helpers.js.map +1 -0
- package/lib/commonjs/helpers.test.js +49 -0
- package/lib/commonjs/helpers.test.js.map +1 -0
- package/lib/commonjs/index.js +35 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/module/helpers.js +27 -0
- package/lib/module/helpers.js.map +1 -0
- package/lib/module/helpers.test.js +47 -0
- package/lib/module/helpers.test.js.map +1 -0
- package/lib/module/index.js +15 -0
- package/lib/module/index.js.map +1 -0
- package/lib/typescript/src/helpers.d.ts +3 -0
- package/lib/typescript/src/helpers.d.ts.map +1 -0
- package/lib/typescript/src/helpers.test.d.ts +2 -0
- package/lib/typescript/src/helpers.test.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +7 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/package.json +163 -0
- package/react-native-audio-analyzer.podspec +44 -0
- package/src/helpers.test.ts +59 -0
- package/src/helpers.ts +34 -0
- package/src/index.tsx +30 -0
package/android/Makefile
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
# CMAKE generated file: DO NOT EDIT!
|
|
2
|
+
# Generated by "Unix Makefiles" Generator, CMake Version 3.27
|
|
3
|
+
|
|
4
|
+
# Default target executed when no arguments are given to make.
|
|
5
|
+
default_target: all
|
|
6
|
+
.PHONY : default_target
|
|
7
|
+
|
|
8
|
+
# Allow only one "make -f Makefile2" at a time, but pass parallelism.
|
|
9
|
+
.NOTPARALLEL:
|
|
10
|
+
|
|
11
|
+
#=============================================================================
|
|
12
|
+
# Special targets provided by cmake.
|
|
13
|
+
|
|
14
|
+
# Disable implicit rules so canonical targets will work.
|
|
15
|
+
.SUFFIXES:
|
|
16
|
+
|
|
17
|
+
# Disable VCS-based implicit rules.
|
|
18
|
+
% : %,v
|
|
19
|
+
|
|
20
|
+
# Disable VCS-based implicit rules.
|
|
21
|
+
% : RCS/%
|
|
22
|
+
|
|
23
|
+
# Disable VCS-based implicit rules.
|
|
24
|
+
% : RCS/%,v
|
|
25
|
+
|
|
26
|
+
# Disable VCS-based implicit rules.
|
|
27
|
+
% : SCCS/s.%
|
|
28
|
+
|
|
29
|
+
# Disable VCS-based implicit rules.
|
|
30
|
+
% : s.%
|
|
31
|
+
|
|
32
|
+
.SUFFIXES: .hpux_make_needs_suffix_list
|
|
33
|
+
|
|
34
|
+
# Produce verbose output by default.
|
|
35
|
+
VERBOSE = 1
|
|
36
|
+
|
|
37
|
+
# Command-line flag to silence nested $(MAKE).
|
|
38
|
+
$(VERBOSE)MAKESILENT = -s
|
|
39
|
+
|
|
40
|
+
#Suppress display of executed commands.
|
|
41
|
+
$(VERBOSE).SILENT:
|
|
42
|
+
|
|
43
|
+
# A target that is always out of date.
|
|
44
|
+
cmake_force:
|
|
45
|
+
.PHONY : cmake_force
|
|
46
|
+
|
|
47
|
+
#=============================================================================
|
|
48
|
+
# Set environment variables for the build.
|
|
49
|
+
|
|
50
|
+
# The shell in which to execute make rules.
|
|
51
|
+
SHELL = /bin/sh
|
|
52
|
+
|
|
53
|
+
# The CMake executable.
|
|
54
|
+
CMAKE_COMMAND = /opt/homebrew/Cellar/cmake/3.27.7/bin/cmake
|
|
55
|
+
|
|
56
|
+
# The command to remove a file.
|
|
57
|
+
RM = /opt/homebrew/Cellar/cmake/3.27.7/bin/cmake -E rm -f
|
|
58
|
+
|
|
59
|
+
# Escaping for special characters.
|
|
60
|
+
EQUALS = =
|
|
61
|
+
|
|
62
|
+
# The top-level source directory on which CMake was run.
|
|
63
|
+
CMAKE_SOURCE_DIR = /Users/exzos/Documents/dev/react-native-audio-analyzer/android
|
|
64
|
+
|
|
65
|
+
# The top-level build directory on which CMake was run.
|
|
66
|
+
CMAKE_BINARY_DIR = /Users/exzos/Documents/dev/react-native-audio-analyzer/android
|
|
67
|
+
|
|
68
|
+
#=============================================================================
|
|
69
|
+
# Targets provided globally by CMake.
|
|
70
|
+
|
|
71
|
+
# Special rule for the target edit_cache
|
|
72
|
+
edit_cache:
|
|
73
|
+
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Running CMake cache editor..."
|
|
74
|
+
/opt/homebrew/Cellar/cmake/3.27.7/bin/ccmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
|
|
75
|
+
.PHONY : edit_cache
|
|
76
|
+
|
|
77
|
+
# Special rule for the target edit_cache
|
|
78
|
+
edit_cache/fast: edit_cache
|
|
79
|
+
.PHONY : edit_cache/fast
|
|
80
|
+
|
|
81
|
+
# Special rule for the target rebuild_cache
|
|
82
|
+
rebuild_cache:
|
|
83
|
+
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Running CMake to regenerate build system..."
|
|
84
|
+
/opt/homebrew/Cellar/cmake/3.27.7/bin/cmake --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
|
|
85
|
+
.PHONY : rebuild_cache
|
|
86
|
+
|
|
87
|
+
# Special rule for the target rebuild_cache
|
|
88
|
+
rebuild_cache/fast: rebuild_cache
|
|
89
|
+
.PHONY : rebuild_cache/fast
|
|
90
|
+
|
|
91
|
+
# The main all target
|
|
92
|
+
all: cmake_check_build_system
|
|
93
|
+
$(CMAKE_COMMAND) -E cmake_progress_start /Users/exzos/Documents/dev/react-native-audio-analyzer/android/CMakeFiles /Users/exzos/Documents/dev/react-native-audio-analyzer/android//CMakeFiles/progress.marks
|
|
94
|
+
$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 all
|
|
95
|
+
$(CMAKE_COMMAND) -E cmake_progress_start /Users/exzos/Documents/dev/react-native-audio-analyzer/android/CMakeFiles 0
|
|
96
|
+
.PHONY : all
|
|
97
|
+
|
|
98
|
+
# The main clean target
|
|
99
|
+
clean:
|
|
100
|
+
$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 clean
|
|
101
|
+
.PHONY : clean
|
|
102
|
+
|
|
103
|
+
# The main clean target
|
|
104
|
+
clean/fast: clean
|
|
105
|
+
.PHONY : clean/fast
|
|
106
|
+
|
|
107
|
+
# Prepare targets for installation.
|
|
108
|
+
preinstall: all
|
|
109
|
+
$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall
|
|
110
|
+
.PHONY : preinstall
|
|
111
|
+
|
|
112
|
+
# Prepare targets for installation.
|
|
113
|
+
preinstall/fast:
|
|
114
|
+
$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall
|
|
115
|
+
.PHONY : preinstall/fast
|
|
116
|
+
|
|
117
|
+
# clear depends
|
|
118
|
+
depend:
|
|
119
|
+
$(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
|
|
120
|
+
.PHONY : depend
|
|
121
|
+
|
|
122
|
+
#=============================================================================
|
|
123
|
+
# Target rules for targets named cpp
|
|
124
|
+
|
|
125
|
+
# Build rule for target.
|
|
126
|
+
cpp: cmake_check_build_system
|
|
127
|
+
$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 cpp
|
|
128
|
+
.PHONY : cpp
|
|
129
|
+
|
|
130
|
+
# fast build rule for target.
|
|
131
|
+
cpp/fast:
|
|
132
|
+
$(MAKE) $(MAKESILENT) -f CMakeFiles/cpp.dir/build.make CMakeFiles/cpp.dir/build
|
|
133
|
+
.PHONY : cpp/fast
|
|
134
|
+
|
|
135
|
+
Users/exzos/Documents/dev/react-native-audio-analyzer/cpp/react-native-audio-analyzer.o: Users/exzos/Documents/dev/react-native-audio-analyzer/cpp/react-native-audio-analyzer.cpp.o
|
|
136
|
+
.PHONY : Users/exzos/Documents/dev/react-native-audio-analyzer/cpp/react-native-audio-analyzer.o
|
|
137
|
+
|
|
138
|
+
# target to build an object file
|
|
139
|
+
Users/exzos/Documents/dev/react-native-audio-analyzer/cpp/react-native-audio-analyzer.cpp.o:
|
|
140
|
+
$(MAKE) $(MAKESILENT) -f CMakeFiles/cpp.dir/build.make CMakeFiles/cpp.dir/Users/exzos/Documents/dev/react-native-audio-analyzer/cpp/react-native-audio-analyzer.cpp.o
|
|
141
|
+
.PHONY : Users/exzos/Documents/dev/react-native-audio-analyzer/cpp/react-native-audio-analyzer.cpp.o
|
|
142
|
+
|
|
143
|
+
Users/exzos/Documents/dev/react-native-audio-analyzer/cpp/react-native-audio-analyzer.i: Users/exzos/Documents/dev/react-native-audio-analyzer/cpp/react-native-audio-analyzer.cpp.i
|
|
144
|
+
.PHONY : Users/exzos/Documents/dev/react-native-audio-analyzer/cpp/react-native-audio-analyzer.i
|
|
145
|
+
|
|
146
|
+
# target to preprocess a source file
|
|
147
|
+
Users/exzos/Documents/dev/react-native-audio-analyzer/cpp/react-native-audio-analyzer.cpp.i:
|
|
148
|
+
$(MAKE) $(MAKESILENT) -f CMakeFiles/cpp.dir/build.make CMakeFiles/cpp.dir/Users/exzos/Documents/dev/react-native-audio-analyzer/cpp/react-native-audio-analyzer.cpp.i
|
|
149
|
+
.PHONY : Users/exzos/Documents/dev/react-native-audio-analyzer/cpp/react-native-audio-analyzer.cpp.i
|
|
150
|
+
|
|
151
|
+
Users/exzos/Documents/dev/react-native-audio-analyzer/cpp/react-native-audio-analyzer.s: Users/exzos/Documents/dev/react-native-audio-analyzer/cpp/react-native-audio-analyzer.cpp.s
|
|
152
|
+
.PHONY : Users/exzos/Documents/dev/react-native-audio-analyzer/cpp/react-native-audio-analyzer.s
|
|
153
|
+
|
|
154
|
+
# target to generate assembly for a file
|
|
155
|
+
Users/exzos/Documents/dev/react-native-audio-analyzer/cpp/react-native-audio-analyzer.cpp.s:
|
|
156
|
+
$(MAKE) $(MAKESILENT) -f CMakeFiles/cpp.dir/build.make CMakeFiles/cpp.dir/Users/exzos/Documents/dev/react-native-audio-analyzer/cpp/react-native-audio-analyzer.cpp.s
|
|
157
|
+
.PHONY : Users/exzos/Documents/dev/react-native-audio-analyzer/cpp/react-native-audio-analyzer.cpp.s
|
|
158
|
+
|
|
159
|
+
cpp-adapter.o: cpp-adapter.cpp.o
|
|
160
|
+
.PHONY : cpp-adapter.o
|
|
161
|
+
|
|
162
|
+
# target to build an object file
|
|
163
|
+
cpp-adapter.cpp.o:
|
|
164
|
+
$(MAKE) $(MAKESILENT) -f CMakeFiles/cpp.dir/build.make CMakeFiles/cpp.dir/cpp-adapter.cpp.o
|
|
165
|
+
.PHONY : cpp-adapter.cpp.o
|
|
166
|
+
|
|
167
|
+
cpp-adapter.i: cpp-adapter.cpp.i
|
|
168
|
+
.PHONY : cpp-adapter.i
|
|
169
|
+
|
|
170
|
+
# target to preprocess a source file
|
|
171
|
+
cpp-adapter.cpp.i:
|
|
172
|
+
$(MAKE) $(MAKESILENT) -f CMakeFiles/cpp.dir/build.make CMakeFiles/cpp.dir/cpp-adapter.cpp.i
|
|
173
|
+
.PHONY : cpp-adapter.cpp.i
|
|
174
|
+
|
|
175
|
+
cpp-adapter.s: cpp-adapter.cpp.s
|
|
176
|
+
.PHONY : cpp-adapter.s
|
|
177
|
+
|
|
178
|
+
# target to generate assembly for a file
|
|
179
|
+
cpp-adapter.cpp.s:
|
|
180
|
+
$(MAKE) $(MAKESILENT) -f CMakeFiles/cpp.dir/build.make CMakeFiles/cpp.dir/cpp-adapter.cpp.s
|
|
181
|
+
.PHONY : cpp-adapter.cpp.s
|
|
182
|
+
|
|
183
|
+
# Help Target
|
|
184
|
+
help:
|
|
185
|
+
@echo "The following are some of the valid targets for this Makefile:"
|
|
186
|
+
@echo "... all (the default if no target is provided)"
|
|
187
|
+
@echo "... clean"
|
|
188
|
+
@echo "... depend"
|
|
189
|
+
@echo "... edit_cache"
|
|
190
|
+
@echo "... rebuild_cache"
|
|
191
|
+
@echo "... cpp"
|
|
192
|
+
@echo "... Users/exzos/Documents/dev/react-native-audio-analyzer/cpp/react-native-audio-analyzer.o"
|
|
193
|
+
@echo "... Users/exzos/Documents/dev/react-native-audio-analyzer/cpp/react-native-audio-analyzer.i"
|
|
194
|
+
@echo "... Users/exzos/Documents/dev/react-native-audio-analyzer/cpp/react-native-audio-analyzer.s"
|
|
195
|
+
@echo "... cpp-adapter.o"
|
|
196
|
+
@echo "... cpp-adapter.i"
|
|
197
|
+
@echo "... cpp-adapter.s"
|
|
198
|
+
.PHONY : help
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
#=============================================================================
|
|
203
|
+
# Special targets to cleanup operation of make.
|
|
204
|
+
|
|
205
|
+
# Special rule to run CMake to check the build system integrity.
|
|
206
|
+
# No rule that depends on this can have commands that come from listfiles
|
|
207
|
+
# because they might be regenerated.
|
|
208
|
+
cmake_check_build_system:
|
|
209
|
+
$(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
|
|
210
|
+
.PHONY : cmake_check_build_system
|
|
211
|
+
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
buildscript {
|
|
2
|
+
repositories {
|
|
3
|
+
google()
|
|
4
|
+
mavenCentral()
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
dependencies {
|
|
8
|
+
classpath "com.android.tools.build:gradle:8.13.0"
|
|
9
|
+
classpath "de.undercouch:gradle-download-task:5.0.1"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
def isNewArchitectureEnabled() {
|
|
14
|
+
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
apply plugin: "com.android.library"
|
|
18
|
+
apply plugin: "de.undercouch.download"
|
|
19
|
+
|
|
20
|
+
if (isNewArchitectureEnabled()) {
|
|
21
|
+
apply plugin: "com.facebook.react"
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
def getExtOrDefault(name) {
|
|
25
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["AudioAnalyzer_" + name]
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
def getExtOrIntegerDefault(name) {
|
|
29
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["AudioAnalyzer_" + name]).toInteger()
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
def supportsNamespace() {
|
|
33
|
+
def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
|
|
34
|
+
def major = parsed[0].toInteger()
|
|
35
|
+
def minor = parsed[1].toInteger()
|
|
36
|
+
|
|
37
|
+
// Namespace support was added in 7.3.0
|
|
38
|
+
return (major == 7 && minor >= 3) || major >= 8
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
android {
|
|
42
|
+
if (supportsNamespace()) {
|
|
43
|
+
namespace "com.audioanalyzer"
|
|
44
|
+
|
|
45
|
+
sourceSets {
|
|
46
|
+
main {
|
|
47
|
+
manifest.srcFile "src/main/AndroidManifestNew.xml"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
ndkVersion getExtOrDefault("ndkVersion")
|
|
53
|
+
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
|
|
54
|
+
|
|
55
|
+
defaultConfig {
|
|
56
|
+
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
|
|
57
|
+
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
|
|
58
|
+
|
|
59
|
+
externalNativeBuild {
|
|
60
|
+
cmake {
|
|
61
|
+
cppFlags "-O2 -frtti -fexceptions -Wall -fstack-protector-all"
|
|
62
|
+
abiFilters "x86", "x86_64", "armeabi-v7a", "arm64-v8a"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
externalNativeBuild {
|
|
68
|
+
cmake {
|
|
69
|
+
path "CMakeLists.txt"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
buildTypes {
|
|
74
|
+
release {
|
|
75
|
+
minifyEnabled false
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
lintOptions {
|
|
80
|
+
disable "GradleCompatible"
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
compileOptions {
|
|
84
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
|
85
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
tasks.register('copyHeadersAndLibs', Copy) {
|
|
89
|
+
from 'ffmpeg_16kb'
|
|
90
|
+
into layout.buildDirectory.dir("ffmpeg")
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
afterEvaluate {
|
|
94
|
+
preBuild.dependsOn copyHeadersAndLibs
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
repositories {
|
|
99
|
+
mavenCentral()
|
|
100
|
+
google()
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
dependencies {
|
|
105
|
+
// For < 0.71, this will be from the local maven repo
|
|
106
|
+
// For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
|
|
107
|
+
//noinspection GradleDynamicVersion
|
|
108
|
+
implementation "com.facebook.react:react-native:+"
|
|
109
|
+
}
|
|
110
|
+
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Install script for directory: /Users/exzos/Documents/dev/react-native-audio-analyzer/android
|
|
2
|
+
|
|
3
|
+
# Set the install prefix
|
|
4
|
+
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
|
|
5
|
+
set(CMAKE_INSTALL_PREFIX "/usr/local")
|
|
6
|
+
endif()
|
|
7
|
+
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
|
|
8
|
+
|
|
9
|
+
# Set the install configuration name.
|
|
10
|
+
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
|
|
11
|
+
if(BUILD_TYPE)
|
|
12
|
+
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
|
|
13
|
+
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
|
|
14
|
+
else()
|
|
15
|
+
set(CMAKE_INSTALL_CONFIG_NAME "")
|
|
16
|
+
endif()
|
|
17
|
+
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
|
|
18
|
+
endif()
|
|
19
|
+
|
|
20
|
+
# Set the component getting installed.
|
|
21
|
+
if(NOT CMAKE_INSTALL_COMPONENT)
|
|
22
|
+
if(COMPONENT)
|
|
23
|
+
message(STATUS "Install component: \"${COMPONENT}\"")
|
|
24
|
+
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
|
|
25
|
+
else()
|
|
26
|
+
set(CMAKE_INSTALL_COMPONENT)
|
|
27
|
+
endif()
|
|
28
|
+
endif()
|
|
29
|
+
|
|
30
|
+
# Is this installation the result of a crosscompile?
|
|
31
|
+
if(NOT DEFINED CMAKE_CROSSCOMPILING)
|
|
32
|
+
set(CMAKE_CROSSCOMPILING "FALSE")
|
|
33
|
+
endif()
|
|
34
|
+
|
|
35
|
+
# Set default install directory permissions.
|
|
36
|
+
if(NOT DEFINED CMAKE_OBJDUMP)
|
|
37
|
+
set(CMAKE_OBJDUMP "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/objdump")
|
|
38
|
+
endif()
|
|
39
|
+
|
|
40
|
+
if(CMAKE_INSTALL_COMPONENT)
|
|
41
|
+
set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
|
|
42
|
+
else()
|
|
43
|
+
set(CMAKE_INSTALL_MANIFEST "install_manifest.txt")
|
|
44
|
+
endif()
|
|
45
|
+
|
|
46
|
+
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
|
|
47
|
+
"${CMAKE_INSTALL_MANIFEST_FILES}")
|
|
48
|
+
file(WRITE "/Users/exzos/Documents/dev/react-native-audio-analyzer/android/${CMAKE_INSTALL_MANIFEST}"
|
|
49
|
+
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#include <jni.h>
|
|
2
|
+
#include <iostream>
|
|
3
|
+
#include "react-native-audio-analyzer.h"
|
|
4
|
+
|
|
5
|
+
extern "C"
|
|
6
|
+
JNIEXPORT jobjectArray JNICALL
|
|
7
|
+
Java_com_audioanalyzer_AudioAnalyzerModule_analyzeAudio(JNIEnv *env, jclass obj, jstring filePath) {
|
|
8
|
+
|
|
9
|
+
// Step 1: Convert Java string to C++ string
|
|
10
|
+
const char *nativeFilePath = env->GetStringUTFChars(filePath, nullptr);
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
// Step 2: Call the analyzeAudio function
|
|
14
|
+
audioanalyzer::FFmpegException errorPtr = nullptr;
|
|
15
|
+
std::vector<audioanalyzer::AmplitudeData> amplitudeData = audioanalyzer::analyzeAudio(nativeFilePath, &errorPtr);
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
if (errorPtr.getMessage()) {
|
|
19
|
+
env->ThrowNew(env->FindClass("java/lang/Exception"), errorPtr.getMessage());
|
|
20
|
+
env->ReleaseStringUTFChars(filePath, nativeFilePath);
|
|
21
|
+
return nullptr;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Step 3: Obtain information about the AmplitudeData class
|
|
25
|
+
jclass amplitudeDataClass = env->FindClass("com/audioanalyzer/AmplitudeData");
|
|
26
|
+
jmethodID amplitudeDataConstructor = env->GetMethodID(amplitudeDataClass, "<init>", "(DD)V");
|
|
27
|
+
|
|
28
|
+
// Step 4: Create and populate an array of AmplitudeData objects
|
|
29
|
+
jobjectArray resultArray = env->NewObjectArray(amplitudeData.size(), amplitudeDataClass, nullptr);
|
|
30
|
+
for (size_t i = 0; i < amplitudeData.size(); ++i) {
|
|
31
|
+
jobject amplitudeDataObject = env->NewObject(amplitudeDataClass, amplitudeDataConstructor, amplitudeData[i].timeInSeconds, amplitudeData[i].amplitude);
|
|
32
|
+
env->SetObjectArrayElement(resultArray, i, amplitudeDataObject);
|
|
33
|
+
env->DeleteLocalRef(amplitudeDataObject); // Delete the local reference to the object (to avoid memory leaks)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Step 5: Release resources
|
|
37
|
+
env->ReleaseStringUTFChars(filePath, nativeFilePath);
|
|
38
|
+
|
|
39
|
+
return resultArray;
|
|
40
|
+
}
|