Skip to content

Commit d9c38f2

Browse files
authored
Merge pull request #13 from exzos28/v3
2 parents 36ab12f + e672198 commit d9c38f2

File tree

78 files changed

+5583
-6866
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+5583
-6866
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
*.pbxproj -text
22
# specific for windows script files
3-
*.bat text eol=crlf
3+
*.bat text eol=crlf
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: 🐛 Bug report
2+
description: Report a reproducible bug or regression in this library.
3+
labels: [bug]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
# Bug report
9+
10+
👋 Hi!
11+
12+
**Please fill the following carefully before opening a new issue ❗**
13+
*(Your issue may be closed if it doesn't provide the required pieces of information)*
14+
- type: checkboxes
15+
attributes:
16+
label: Before submitting a new issue
17+
description: Please perform simple checks first.
18+
options:
19+
- label: I tested using the latest version of the library, as the bug might be already fixed.
20+
required: true
21+
- label: I tested using a [supported version](https://github.com/reactwg/react-native-releases/blob/main/docs/support.md) of react native.
22+
required: true
23+
- label: I checked for possible duplicate issues, with possible answers.
24+
required: true
25+
- type: textarea
26+
id: summary
27+
attributes:
28+
label: Bug summary
29+
description: |
30+
Provide a clear and concise description of what the bug is.
31+
If needed, you can also provide other samples: error messages / stack traces, screenshots, gifs, etc.
32+
validations:
33+
required: true
34+
- type: input
35+
id: library-version
36+
attributes:
37+
label: Library version
38+
description: What version of the library are you using?
39+
placeholder: "x.x.x"
40+
validations:
41+
required: true
42+
- type: textarea
43+
id: react-native-info
44+
attributes:
45+
label: Environment info
46+
description: Run `react-native info` in your terminal and paste the results here.
47+
render: shell
48+
validations:
49+
required: true
50+
- type: textarea
51+
id: steps-to-reproduce
52+
attributes:
53+
label: Steps to reproduce
54+
description: |
55+
You must provide a clear list of steps and code to reproduce the problem.
56+
value: |
57+
1. …
58+
2. …
59+
validations:
60+
required: true
61+
- type: input
62+
id: reproducible-example
63+
attributes:
64+
label: Reproducible example repository
65+
description: Please provide a link to a repository on GitHub with a reproducible example.
66+
validations:
67+
required: true

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Feature Request 💡
4+
url: https://github.com/exzos28/react-native-audio-analyzer/discussions/new?category=ideas
5+
about: If you have a feature request, please create a new discussion on GitHub.
6+
- name: Discussions on GitHub 💬
7+
url: https://github.com/exzos28/react-native-audio-analyzer/discussions
8+
about: If this library works as promised but you need help, please ask questions there.

.github/actions/setup/action.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ runs:
55
using: composite
66
steps:
77
- name: Setup Node.js
8-
uses: actions/setup-node@v3
8+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
99
with:
1010
node-version-file: .nvmrc
1111

12-
- name: Cache dependencies
12+
- name: Restore dependencies
1313
id: yarn-cache
14-
uses: actions/cache@v3
14+
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
1515
with:
1616
path: |
1717
**/node_modules
@@ -25,3 +25,12 @@ runs:
2525
if: steps.yarn-cache.outputs.cache-hit != 'true'
2626
run: yarn install --immutable
2727
shell: bash
28+
29+
- name: Cache dependencies
30+
if: steps.yarn-cache.outputs.cache-hit != 'true'
31+
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
32+
with:
33+
path: |
34+
**/node_modules
35+
.yarn/install-state.gz
36+
key: ${{ steps.yarn-cache.outputs.cache-primary-key }}

.github/workflows/ci.yml

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: Checkout
18-
uses: actions/checkout@v3
18+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1919

2020
- name: Setup
2121
uses: ./.github/actions/setup
@@ -30,7 +30,7 @@ jobs:
3030
runs-on: ubuntu-latest
3131
steps:
3232
- name: Checkout
33-
uses: actions/checkout@v3
33+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3434

3535
- name: Setup
3636
uses: ./.github/actions/setup
@@ -42,7 +42,7 @@ jobs:
4242
runs-on: ubuntu-latest
4343
steps:
4444
- name: Checkout
45-
uses: actions/checkout@v3
45+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4646

4747
- name: Setup
4848
uses: ./.github/actions/setup
@@ -56,13 +56,16 @@ jobs:
5656
TURBO_CACHE_DIR: .turbo/android
5757
steps:
5858
- name: Checkout
59-
uses: actions/checkout@v3
59+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6060

6161
- name: Setup
6262
uses: ./.github/actions/setup
6363

64+
- name: Generate nitrogen code
65+
run: yarn nitrogen
66+
6467
- name: Cache turborepo for Android
65-
uses: actions/cache@v3
68+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
6669
with:
6770
path: ${{ env.TURBO_CACHE_DIR }}
6871
key: ${{ runner.os }}-turborepo-android-${{ hashFiles('yarn.lock') }}
@@ -79,7 +82,7 @@ jobs:
7982
8083
- name: Install JDK
8184
if: env.turbo_cache_hit != 1
82-
uses: actions/setup-java@v3
85+
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
8386
with:
8487
distribution: 'zulu'
8588
java-version: '17'
@@ -91,7 +94,7 @@ jobs:
9194
9295
- name: Cache Gradle
9396
if: env.turbo_cache_hit != 1
94-
uses: actions/cache@v3
97+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
9598
with:
9699
path: |
97100
~/.gradle/wrapper
@@ -107,18 +110,22 @@ jobs:
107110
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}"
108111
109112
build-ios:
110-
runs-on: macos-14
113+
runs-on: macos-latest
111114
env:
115+
XCODE_VERSION: 16.2
112116
TURBO_CACHE_DIR: .turbo/ios
113117
steps:
114118
- name: Checkout
115-
uses: actions/checkout@v3
119+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
116120

117121
- name: Setup
118122
uses: ./.github/actions/setup
119123

124+
- name: Generate nitrogen code
125+
run: yarn nitrogen
126+
120127
- name: Cache turborepo for iOS
121-
uses: actions/cache@v3
128+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
122129
with:
123130
path: ${{ env.TURBO_CACHE_DIR }}
124131
key: ${{ runner.os }}-turborepo-ios-${{ hashFiles('yarn.lock') }}
@@ -133,24 +140,19 @@ jobs:
133140
echo "turbo_cache_hit=1" >> $GITHUB_ENV
134141
fi
135142
136-
- name: Cache cocoapods
143+
- name: Use appropriate Xcode version
137144
if: env.turbo_cache_hit != 1
138-
id: cocoapods-cache
139-
uses: actions/cache@v3
145+
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
140146
with:
141-
path: |
142-
**/ios/Pods
143-
key: ${{ runner.os }}-cocoapods-${{ hashFiles('example/ios/Podfile.lock') }}
144-
restore-keys: |
145-
${{ runner.os }}-cocoapods-
147+
xcode-version: ${{ env.XCODE_VERSION }}
146148

147149
- name: Install cocoapods
148150
if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true'
149151
run: |
150-
cd example/ios
151-
pod install
152-
env:
153-
NO_FLIPPER: 1
152+
cd example
153+
bundle install
154+
bundle exec pod repo update --verbose
155+
bundle exec pod install --project-directory=ios
154156
155157
- name: Build example for iOS
156158
run: |

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ DerivedData
2828
*.ipa
2929
*.xcuserstate
3030
project.xcworkspace
31-
.xcode.env.local
31+
**/.xcode.env.local
3232

3333
# Android/IJ
3434
#
@@ -81,3 +81,8 @@ lib/
8181
# React Native Codegen
8282
ios/generated
8383
android/generated
84+
85+
# React Native Nitro Modules
86+
nitrogen/
87+
88+
libs/generated

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "libs/miniaudio"]
2+
path = libs/miniaudio
3+
url = https://github.com/mackron/miniaudio.git

.java-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v18
1+
v20.19.0

AudioAnalyzer.podspec

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
require "json"
2+
3+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4+
5+
# Run the miniaudio preparation script
6+
script_path = File.join(__dir__, "scripts", "prepare_miniaudio.rb")
7+
if File.exist?(script_path)
8+
system("ruby #{script_path}")
9+
else
10+
puts "Warning: Miniaudio preparation script not found at #{script_path}"
11+
end
12+
13+
Pod::Spec.new do |s|
14+
s.name = "AudioAnalyzer"
15+
s.version = package["version"]
16+
s.summary = package["description"]
17+
s.homepage = package["homepage"]
18+
s.license = package["license"]
19+
s.authors = package["author"]
20+
21+
s.platforms = { :ios => min_ios_version_supported }
22+
s.source = { :git => "https://github.com/exzos28/react-native-audio-analyzer.git", :tag => "#{s.version}" }
23+
24+
# Use pod_target_xcconfig instead of compiler_flags
25+
s.pod_target_xcconfig = {
26+
# C++ compiler flags for miniaudio on iOS
27+
'GCC_PREPROCESSOR_DEFINITIONS' => 'MA_NO_PTHREAD_IN_HEADER=1',
28+
'OTHER_CFLAGS' => '-DMA_NO_PTHREAD_IN_HEADER',
29+
'OTHER_LDFLAGS' => '-lm -lpthread',
30+
'CLANG_CXX_LANGUAGE_STANDARD' => 'c++11',
31+
'CLANG_CXX_LIBRARY' => 'libstdc++'
32+
}
33+
34+
# Required frameworks for iOS audio (Core Audio)
35+
s.frameworks = [
36+
'AVFoundation'
37+
]
38+
39+
s.source_files = [
40+
# Implementation (Swift)
41+
"ios/**/*.{swift}",
42+
# Autolinking/Registration (Objective-C++)
43+
"ios/**/*.{m,mm}",
44+
# Miniaudio implementation - compile as Objective-C (generated)
45+
"libs/generated/miniaudio.m",
46+
"libs/miniaudio/miniaudio.h",
47+
# Implementation (C++ objects)
48+
"cpp/**/*.{hpp,cpp}",
49+
]
50+
s.public_header_files = "libs/miniaudio/miniaudio.h"
51+
52+
s.dependency 'React-jsi'
53+
s.dependency 'React-callinvoker'
54+
55+
load 'nitrogen/generated/ios/AudioAnalyzer+autolinking.rb'
56+
add_nitrogen_files(s)
57+
58+
install_modules_dependencies(s)
59+
end

0 commit comments

Comments
 (0)