react-native-audio-concat 0.2.3 → 0.3.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/{margelo/nitro/audioconcat/AudioConcat.kt → audioconcat/AudioConcatModule.kt} +73 -31
- 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/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
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// HybridAudioConcatSpec.hpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#pragma once
|
|
9
|
-
|
|
10
|
-
#if __has_include(<NitroModules/HybridObject.hpp>)
|
|
11
|
-
#include <NitroModules/HybridObject.hpp>
|
|
12
|
-
#else
|
|
13
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
-
#endif
|
|
15
|
-
|
|
16
|
-
// Forward declaration of `AudioData` to properly resolve imports.
|
|
17
|
-
namespace margelo::nitro::audioconcat { struct AudioData; }
|
|
18
|
-
// Forward declaration of `SilentData` to properly resolve imports.
|
|
19
|
-
namespace margelo::nitro::audioconcat { struct SilentData; }
|
|
20
|
-
|
|
21
|
-
#include <string>
|
|
22
|
-
#include <NitroModules/Promise.hpp>
|
|
23
|
-
#include "AudioData.hpp"
|
|
24
|
-
#include "SilentData.hpp"
|
|
25
|
-
#include <variant>
|
|
26
|
-
#include <vector>
|
|
27
|
-
|
|
28
|
-
namespace margelo::nitro::audioconcat {
|
|
29
|
-
|
|
30
|
-
using namespace margelo::nitro;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* An abstract base class for `AudioConcat`
|
|
34
|
-
* Inherit this class to create instances of `HybridAudioConcatSpec` in C++.
|
|
35
|
-
* You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
|
|
36
|
-
* @example
|
|
37
|
-
* ```cpp
|
|
38
|
-
* class HybridAudioConcat: public HybridAudioConcatSpec {
|
|
39
|
-
* public:
|
|
40
|
-
* HybridAudioConcat(...): HybridObject(TAG) { ... }
|
|
41
|
-
* // ...
|
|
42
|
-
* };
|
|
43
|
-
* ```
|
|
44
|
-
*/
|
|
45
|
-
class HybridAudioConcatSpec: public virtual HybridObject {
|
|
46
|
-
public:
|
|
47
|
-
// Constructor
|
|
48
|
-
explicit HybridAudioConcatSpec(): HybridObject(TAG) { }
|
|
49
|
-
|
|
50
|
-
// Destructor
|
|
51
|
-
~HybridAudioConcatSpec() override = default;
|
|
52
|
-
|
|
53
|
-
public:
|
|
54
|
-
// Properties
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
public:
|
|
58
|
-
// Methods
|
|
59
|
-
virtual std::shared_ptr<Promise<std::string>> concatAudioFiles(const std::vector<std::variant<AudioData, SilentData>>& data, const std::string& outputPath) = 0;
|
|
60
|
-
|
|
61
|
-
protected:
|
|
62
|
-
// Hybrid Setup
|
|
63
|
-
void loadHybridMethods() override;
|
|
64
|
-
|
|
65
|
-
protected:
|
|
66
|
-
// Tag for logging
|
|
67
|
-
static constexpr auto TAG = "AudioConcat";
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
} // namespace margelo::nitro::audioconcat
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// SilentData.hpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#pragma once
|
|
9
|
-
|
|
10
|
-
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
-
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
-
#else
|
|
13
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
-
#endif
|
|
15
|
-
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
-
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
-
#else
|
|
18
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
-
#endif
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
namespace margelo::nitro::audioconcat {
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* A struct which can be represented as a JavaScript object (SilentData).
|
|
29
|
-
*/
|
|
30
|
-
struct SilentData {
|
|
31
|
-
public:
|
|
32
|
-
double durationMs SWIFT_PRIVATE;
|
|
33
|
-
|
|
34
|
-
public:
|
|
35
|
-
SilentData() = default;
|
|
36
|
-
explicit SilentData(double durationMs): durationMs(durationMs) {}
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
} // namespace margelo::nitro::audioconcat
|
|
40
|
-
|
|
41
|
-
namespace margelo::nitro {
|
|
42
|
-
|
|
43
|
-
// C++ SilentData <> JS SilentData (object)
|
|
44
|
-
template <>
|
|
45
|
-
struct JSIConverter<margelo::nitro::audioconcat::SilentData> final {
|
|
46
|
-
static inline margelo::nitro::audioconcat::SilentData fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
47
|
-
jsi::Object obj = arg.asObject(runtime);
|
|
48
|
-
return margelo::nitro::audioconcat::SilentData(
|
|
49
|
-
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "durationMs"))
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::audioconcat::SilentData& arg) {
|
|
53
|
-
jsi::Object obj(runtime);
|
|
54
|
-
obj.setProperty(runtime, "durationMs", JSIConverter<double>::toJSI(runtime, arg.durationMs));
|
|
55
|
-
return obj;
|
|
56
|
-
}
|
|
57
|
-
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
58
|
-
if (!value.isObject()) {
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
jsi::Object obj = value.getObject(runtime);
|
|
62
|
-
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "durationMs"))) return false;
|
|
63
|
-
return true;
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
} // namespace margelo::nitro
|
package/src/AudioConcat.nitro.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { HybridObject } from 'react-native-nitro-modules';
|
|
2
|
-
|
|
3
|
-
type SilentData = {
|
|
4
|
-
durationMs: number;
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
type AudioData = {
|
|
8
|
-
filePath: string;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export type AudioDataOrSilence = AudioData | SilentData;
|
|
12
|
-
|
|
13
|
-
export interface AudioConcat
|
|
14
|
-
extends HybridObject<{ ios: 'swift'; android: 'kotlin' }> {
|
|
15
|
-
concatAudioFiles(
|
|
16
|
-
data: AudioDataOrSilence[],
|
|
17
|
-
outputPath: string
|
|
18
|
-
): Promise<string>;
|
|
19
|
-
}
|