sezo-audio-engine 0.0.2
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 +21 -0
- package/README.md +51 -0
- package/android/build.gradle +44 -0
- package/android/cpp/CMakeLists.txt +23 -0
- package/android/cpp/NativeBridge.cpp +6 -0
- package/android/settings.gradle +12 -0
- package/android/src/main/java/expo/modules/audioengine/ExpoAudioEngineModule.kt +549 -0
- package/dist/AudioEngineModule.d.ts +2 -0
- package/dist/AudioEngineModule.js +46 -0
- package/dist/AudioEngineModule.types.d.ts +108 -0
- package/dist/AudioEngineModule.types.js +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/expo-module.config.json +9 -0
- package/ios/AudioEngine/AudioEngineConfig.swift +13 -0
- package/ios/AudioEngine/AudioSessionManager.swift +61 -0
- package/ios/AudioEngine/AudioTrack.swift +72 -0
- package/ios/AudioEngine/NativeAudioEngine.swift +1180 -0
- package/ios/ExpoAudioEngine.podspec +26 -0
- package/ios/ExpoAudioEngineModule.swift +156 -0
- package/package.json +60 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Sezo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Sezo Audio Engine (Expo module)
|
|
2
|
+
|
|
3
|
+
The Expo module is the cross-platform package for Sezo Audio Engine. It includes a full iOS implementation and adds background playback support.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install sezo-audio-engine
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
yarn add sezo-audio-engine
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Configure permissions
|
|
18
|
+
|
|
19
|
+
Android recording:
|
|
20
|
+
|
|
21
|
+
```xml
|
|
22
|
+
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
iOS recording or background playback:
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"expo": {
|
|
30
|
+
"ios": {
|
|
31
|
+
"infoPlist": {
|
|
32
|
+
"NSMicrophoneUsageDescription": "Allow access to the microphone for recording audio.",
|
|
33
|
+
"UIBackgroundModes": ["audio"]
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Usage
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
import { AudioEngineModule } from 'sezo-audio-engine';
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
See the docs for full API details and examples.
|
|
47
|
+
|
|
48
|
+
## Docs
|
|
49
|
+
|
|
50
|
+
- Overview: https://sepzie.github.io/SezoAudioEngine/expo/overview/
|
|
51
|
+
- Install: https://sepzie.github.io/SezoAudioEngine/expo/install/
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
plugins {
|
|
2
|
+
id "com.android.library"
|
|
3
|
+
id "org.jetbrains.kotlin.android"
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
android {
|
|
7
|
+
namespace "expo.modules.audioengine"
|
|
8
|
+
compileSdk 34
|
|
9
|
+
ndkVersion "26.1.10909125"
|
|
10
|
+
|
|
11
|
+
defaultConfig {
|
|
12
|
+
minSdk 24
|
|
13
|
+
targetSdk 34
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// Note: No native build needed here - we use the android-engine library
|
|
17
|
+
// which provides libsezo_audio_engine.so through the Gradle dependency
|
|
18
|
+
|
|
19
|
+
buildTypes {
|
|
20
|
+
release {
|
|
21
|
+
minifyEnabled false
|
|
22
|
+
}
|
|
23
|
+
debug {
|
|
24
|
+
minifyEnabled false
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
compileOptions {
|
|
29
|
+
sourceCompatibility JavaVersion.VERSION_17
|
|
30
|
+
targetCompatibility JavaVersion.VERSION_17
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
kotlinOptions {
|
|
34
|
+
jvmTarget = "17"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
dependencies {
|
|
39
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.9.0"
|
|
40
|
+
implementation project(":expo-modules-core")
|
|
41
|
+
|
|
42
|
+
// Link to the android-engine package
|
|
43
|
+
implementation project(':android-engine')
|
|
44
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.18)
|
|
2
|
+
project(expo_audio_engine_bridge)
|
|
3
|
+
|
|
4
|
+
# Set C++ standard
|
|
5
|
+
set(CMAKE_CXX_STANDARD 17)
|
|
6
|
+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
7
|
+
|
|
8
|
+
# JNI bridge library
|
|
9
|
+
add_library(expo_audio_engine_bridge SHARED
|
|
10
|
+
NativeBridge.cpp
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
# Include directories
|
|
14
|
+
target_include_directories(expo_audio_engine_bridge PRIVATE
|
|
15
|
+
${CMAKE_CURRENT_SOURCE_DIR}
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
# Link to android-engine and Android libs
|
|
19
|
+
target_link_libraries(expo_audio_engine_bridge
|
|
20
|
+
sezo_audio_engine
|
|
21
|
+
android
|
|
22
|
+
log
|
|
23
|
+
)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Include the android-engine module
|
|
2
|
+
// This path works whether we're building standalone or as part of an Expo app
|
|
3
|
+
include ':android-engine'
|
|
4
|
+
|
|
5
|
+
// Try to find android-engine relative to this settings.gradle file
|
|
6
|
+
def androidEnginePath = new File(settingsDir, '../../android-engine/android/engine')
|
|
7
|
+
if (!androidEnginePath.exists()) {
|
|
8
|
+
// If not found, we might be in node_modules of an example app - go up more levels
|
|
9
|
+
androidEnginePath = new File(settingsDir, '../../../../android-engine/android/engine')
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
project(':android-engine').projectDir = androidEnginePath
|