react-native-audio-concat 0.2.3 → 0.4.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/AudioConcat.podspec +2 -21
- package/README.md +3 -7
- package/android/build.gradle +2 -54
- package/android/src/main/java/com/audioconcat/AudioConcatModule.kt +1178 -0
- package/android/src/main/java/com/audioconcat/AudioConcatPackage.kt +33 -0
- package/ios/AudioConcat.h +5 -0
- package/ios/AudioConcat.mm +104 -0
- package/lib/module/NativeAudioConcat.js +5 -0
- package/lib/module/NativeAudioConcat.js.map +1 -0
- package/lib/module/index.js +2 -28
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/NativeAudioConcat.d.ts +12 -0
- package/lib/typescript/src/NativeAudioConcat.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +6 -27
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +14 -18
- package/src/NativeAudioConcat.ts +12 -0
- package/src/index.tsx +4 -32
- package/android/CMakeLists.txt +0 -24
- package/android/src/main/cpp/cpp-adapter.cpp +0 -6
- package/android/src/main/java/com/margelo/nitro/audioconcat/AudioConcat.kt +0 -349
- package/android/src/main/java/com/margelo/nitro/audioconcat/AudioConcatPackage.kt +0 -22
- package/ios/AudioConcat.swift +0 -75
- package/lib/module/AudioConcat.nitro.js +0 -4
- package/lib/module/AudioConcat.nitro.js.map +0 -1
- package/lib/typescript/src/AudioConcat.nitro.d.ts +0 -16
- package/lib/typescript/src/AudioConcat.nitro.d.ts.map +0 -1
- package/nitro.json +0 -17
- package/nitrogen/generated/android/audioconcat+autolinking.cmake +0 -82
- package/nitrogen/generated/android/audioconcat+autolinking.gradle +0 -27
- package/nitrogen/generated/android/audioconcatOnLoad.cpp +0 -44
- package/nitrogen/generated/android/audioconcatOnLoad.hpp +0 -25
- package/nitrogen/generated/android/c++/JAudioData.hpp +0 -53
- package/nitrogen/generated/android/c++/JAudioDataOrSilence.cpp +0 -26
- package/nitrogen/generated/android/c++/JAudioDataOrSilence.hpp +0 -72
- package/nitrogen/generated/android/c++/JHybridAudioConcatSpec.cpp +0 -77
- package/nitrogen/generated/android/c++/JHybridAudioConcatSpec.hpp +0 -64
- package/nitrogen/generated/android/c++/JSilentData.hpp +0 -53
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audioconcat/AudioData.kt +0 -29
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audioconcat/AudioDataOrSilence.kt +0 -42
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audioconcat/HybridAudioConcatSpec.kt +0 -52
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audioconcat/SilentData.kt +0 -29
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audioconcat/audioconcatOnLoad.kt +0 -35
- package/nitrogen/generated/ios/AudioConcat+autolinking.rb +0 -60
- package/nitrogen/generated/ios/AudioConcat-Swift-Cxx-Bridge.cpp +0 -48
- package/nitrogen/generated/ios/AudioConcat-Swift-Cxx-Bridge.hpp +0 -160
- package/nitrogen/generated/ios/AudioConcat-Swift-Cxx-Umbrella.hpp +0 -53
- package/nitrogen/generated/ios/AudioConcatAutolinking.mm +0 -33
- package/nitrogen/generated/ios/AudioConcatAutolinking.swift +0 -25
- package/nitrogen/generated/ios/c++/HybridAudioConcatSpecSwift.cpp +0 -11
- package/nitrogen/generated/ios/c++/HybridAudioConcatSpecSwift.hpp +0 -81
- package/nitrogen/generated/ios/swift/AudioData.swift +0 -35
- package/nitrogen/generated/ios/swift/AudioDataOrSilence.swift +0 -18
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +0 -47
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +0 -47
- package/nitrogen/generated/ios/swift/HybridAudioConcatSpec.swift +0 -49
- package/nitrogen/generated/ios/swift/HybridAudioConcatSpec_cxx.swift +0 -142
- package/nitrogen/generated/ios/swift/SilentData.swift +0 -35
- package/nitrogen/generated/shared/c++/AudioData.hpp +0 -67
- package/nitrogen/generated/shared/c++/HybridAudioConcatSpec.cpp +0 -21
- package/nitrogen/generated/shared/c++/HybridAudioConcatSpec.hpp +0 -70
- package/nitrogen/generated/shared/c++/SilentData.hpp +0 -67
- package/src/AudioConcat.nitro.ts +0 -19
package/AudioConcat.podspec
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
require "json"
|
|
2
2
|
|
|
3
3
|
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
-
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1'
|
|
5
4
|
|
|
6
5
|
Pod::Spec.new do |s|
|
|
7
6
|
s.name = "AudioConcat"
|
|
@@ -14,27 +13,9 @@ Pod::Spec.new do |s|
|
|
|
14
13
|
s.platforms = { :ios => min_ios_version_supported }
|
|
15
14
|
s.source = { :git => "https://github.com/felixchen-dev/react-native-audio-concat.git", :tag => "#{s.version}" }
|
|
16
15
|
|
|
16
|
+
s.source_files = "ios/**/*.{h,m,mm,cpp}"
|
|
17
|
+
s.private_header_files = "ios/**/*.h"
|
|
17
18
|
|
|
18
|
-
s.source_files = [
|
|
19
|
-
"ios/**/*.{swift}",
|
|
20
|
-
"ios/**/*.{m,mm}",
|
|
21
|
-
"cpp/**/*.{hpp,cpp}",
|
|
22
|
-
]
|
|
23
|
-
|
|
24
|
-
s.pod_target_xcconfig = {
|
|
25
|
-
"HEADER_SEARCH_PATHS" => [
|
|
26
|
-
"${PODS_ROOT}/RCT-Folly",
|
|
27
|
-
],
|
|
28
|
-
"GCC_PREPROCESSOR_DEFINITIONS" => "$(inherited) FOLLY_NO_CONFIG FOLLY_CFG_NO_COROUTINES",
|
|
29
|
-
"OTHER_CPLUSPLUSFLAGS" => folly_compiler_flags,
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
s.dependency 'React-jsi'
|
|
34
|
-
s.dependency 'React-callinvoker'
|
|
35
|
-
|
|
36
|
-
load 'nitrogen/generated/ios/AudioConcat+autolinking.rb'
|
|
37
|
-
add_nitrogen_files(s)
|
|
38
19
|
|
|
39
20
|
install_modules_dependencies(s)
|
|
40
21
|
end
|
package/README.md
CHANGED
|
@@ -6,17 +6,14 @@ Concatenate audio files and silence periods into a single audio file for React N
|
|
|
6
6
|
|
|
7
7
|
- ✅ Concat multiple audio files with silence periods
|
|
8
8
|
- ✅ Support for iOS and Android
|
|
9
|
-
- ✅ High performance using [Nitro Modules](https://nitro.margelo.com/)
|
|
10
9
|
- ✅ Output in M4A format
|
|
11
10
|
|
|
12
11
|
## Installation
|
|
13
12
|
|
|
14
13
|
```sh
|
|
15
|
-
npm install react-native-audio-concat
|
|
14
|
+
npm install react-native-audio-concat
|
|
16
15
|
```
|
|
17
16
|
|
|
18
|
-
> **Note:** `react-native-nitro-modules` is required as this library relies on [Nitro Modules](https://nitro.margelo.com/).
|
|
19
|
-
|
|
20
17
|
### iOS
|
|
21
18
|
|
|
22
19
|
```sh
|
|
@@ -35,10 +32,10 @@ import { concatAudioFiles } from 'react-native-audio-concat';
|
|
|
35
32
|
// Concatenate audio files with silence periods
|
|
36
33
|
const data = [
|
|
37
34
|
{ filePath: '/path/to/audio1.m4a' },
|
|
38
|
-
{ durationMs: 500 },
|
|
35
|
+
{ durationMs: 500 }, // 500ms silence
|
|
39
36
|
{ filePath: '/path/to/audio2.m4a' },
|
|
40
37
|
{ durationMs: 1000 }, // 1 second silence
|
|
41
|
-
{ filePath: '/path/to/audio3.m4a' }
|
|
38
|
+
{ filePath: '/path/to/audio3.m4a' },
|
|
42
39
|
];
|
|
43
40
|
|
|
44
41
|
const outputPath = '/path/to/merged.m4a';
|
|
@@ -72,7 +69,6 @@ Concatenates audio files and silence periods into a single output file.
|
|
|
72
69
|
|
|
73
70
|
Check out the [example app](example/) for a complete working example.
|
|
74
71
|
|
|
75
|
-
|
|
76
72
|
## Contributing
|
|
77
73
|
|
|
78
74
|
- [Development workflow](CONTRIBUTING.md#development-workflow)
|
package/android/build.gradle
CHANGED
|
@@ -15,79 +15,28 @@ buildscript {
|
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
def reactNativeArchitectures() {
|
|
19
|
-
def value = rootProject.getProperties().get("reactNativeArchitectures")
|
|
20
|
-
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
|
|
21
|
-
}
|
|
22
18
|
|
|
23
19
|
apply plugin: "com.android.library"
|
|
24
20
|
apply plugin: "kotlin-android"
|
|
25
|
-
apply from: '../nitrogen/generated/android/audioconcat+autolinking.gradle'
|
|
26
21
|
|
|
27
|
-
|
|
28
|
-
// as it triggers autolinking. Only the app module should autolink dependencies.
|
|
22
|
+
apply plugin: "com.facebook.react"
|
|
29
23
|
|
|
30
24
|
def getExtOrIntegerDefault(name) {
|
|
31
25
|
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["AudioConcat_" + name]).toInteger()
|
|
32
26
|
}
|
|
33
27
|
|
|
34
28
|
android {
|
|
35
|
-
namespace "com.
|
|
29
|
+
namespace "com.audioconcat"
|
|
36
30
|
|
|
37
31
|
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
|
|
38
32
|
|
|
39
33
|
defaultConfig {
|
|
40
34
|
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
|
|
41
35
|
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
|
|
42
|
-
|
|
43
|
-
externalNativeBuild {
|
|
44
|
-
cmake {
|
|
45
|
-
cppFlags "-frtti -fexceptions -Wall -fstack-protector-all"
|
|
46
|
-
arguments "-DANDROID_STL=c++_shared", "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON"
|
|
47
|
-
abiFilters (*reactNativeArchitectures())
|
|
48
|
-
|
|
49
|
-
buildTypes {
|
|
50
|
-
debug {
|
|
51
|
-
cppFlags "-O1 -g"
|
|
52
|
-
}
|
|
53
|
-
release {
|
|
54
|
-
cppFlags "-O2"
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
externalNativeBuild {
|
|
62
|
-
cmake {
|
|
63
|
-
path "CMakeLists.txt"
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
packagingOptions {
|
|
68
|
-
excludes = [
|
|
69
|
-
"META-INF",
|
|
70
|
-
"META-INF/**",
|
|
71
|
-
"**/libc++_shared.so",
|
|
72
|
-
"**/libfbjni.so",
|
|
73
|
-
"**/libjsi.so",
|
|
74
|
-
"**/libfolly_json.so",
|
|
75
|
-
"**/libfolly_runtime.so",
|
|
76
|
-
"**/libglog.so",
|
|
77
|
-
"**/libhermes.so",
|
|
78
|
-
"**/libhermes-executor-debug.so",
|
|
79
|
-
"**/libhermes_executor.so",
|
|
80
|
-
"**/libreactnative.so",
|
|
81
|
-
"**/libreactnativejni.so",
|
|
82
|
-
"**/libturbomodulejsijni.so",
|
|
83
|
-
"**/libreact_nativemodule_core.so",
|
|
84
|
-
"**/libjscexecutor.so"
|
|
85
|
-
]
|
|
86
36
|
}
|
|
87
37
|
|
|
88
38
|
buildFeatures {
|
|
89
39
|
buildConfig true
|
|
90
|
-
prefab true
|
|
91
40
|
}
|
|
92
41
|
|
|
93
42
|
buildTypes {
|
|
@@ -125,5 +74,4 @@ def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
|
125
74
|
dependencies {
|
|
126
75
|
implementation "com.facebook.react:react-android"
|
|
127
76
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
128
|
-
implementation project(":react-native-nitro-modules")
|
|
129
77
|
}
|