@siteed/expo-audio-stream 2.0.1 → 2.2.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/README.md +46 -27
- package/build/index.d.ts +11 -12
- package/build/index.js +44 -10
- package/package.json +49 -110
- package/src/index.ts +18 -33
- package/CHANGELOG.md +0 -195
- package/android/build.gradle +0 -105
- package/android/src/main/AndroidManifest.xml +0 -27
- package/android/src/main/java/net/siteed/audiostream/AudioAnalysisData.kt +0 -166
- package/android/src/main/java/net/siteed/audiostream/AudioDataEncoder.kt +0 -9
- package/android/src/main/java/net/siteed/audiostream/AudioFileHandler.kt +0 -131
- package/android/src/main/java/net/siteed/audiostream/AudioFormatUtils.kt +0 -103
- package/android/src/main/java/net/siteed/audiostream/AudioNotificationsManager.kt +0 -435
- package/android/src/main/java/net/siteed/audiostream/AudioProcessor.kt +0 -1936
- package/android/src/main/java/net/siteed/audiostream/AudioRecorderManager.kt +0 -1437
- package/android/src/main/java/net/siteed/audiostream/AudioRecordingService.kt +0 -138
- package/android/src/main/java/net/siteed/audiostream/Constants.kt +0 -20
- package/android/src/main/java/net/siteed/audiostream/EventSender.kt +0 -7
- package/android/src/main/java/net/siteed/audiostream/ExpoAudioStreamModule.kt +0 -509
- package/android/src/main/java/net/siteed/audiostream/FFT.kt +0 -99
- package/android/src/main/java/net/siteed/audiostream/Features.kt +0 -98
- package/android/src/main/java/net/siteed/audiostream/NotificationConfig.kt +0 -70
- package/android/src/main/java/net/siteed/audiostream/PermissionUtils.kt +0 -59
- package/android/src/main/java/net/siteed/audiostream/RecordingActionReceiver.kt +0 -59
- package/android/src/main/java/net/siteed/audiostream/RecordingConfig.kt +0 -205
- package/android/src/main/java/net/siteed/audiostream/WaveformConfig.kt +0 -19
- package/android/src/main/java/net/siteed/audiostream/WaveformRenderer.kt +0 -159
- package/android/src/main/res/drawable/ic_default_action_icon.xml +0 -16
- package/android/src/main/res/drawable/ic_microphone.xml +0 -13
- package/android/src/main/res/drawable/ic_pause.xml +0 -10
- package/android/src/main/res/drawable/ic_play.xml +0 -10
- package/android/src/main/res/drawable/ic_stop.xml +0 -10
- package/android/src/main/res/layout/notification_recording.xml +0 -37
- package/android/src/main/test/java/net/siteed/audiostream/AudioProcessorTest.kt +0 -56
- package/app.plugin.js +0 -1
- package/build/AudioAnalysis/AudioAnalysis.types.d.ts +0 -144
- package/build/AudioAnalysis/AudioAnalysis.types.d.ts.map +0 -1
- package/build/AudioAnalysis/AudioAnalysis.types.js +0 -3
- package/build/AudioAnalysis/AudioAnalysis.types.js.map +0 -1
- package/build/AudioAnalysis/extractAudioAnalysis.d.ts +0 -78
- package/build/AudioAnalysis/extractAudioAnalysis.d.ts.map +0 -1
- package/build/AudioAnalysis/extractAudioAnalysis.js +0 -229
- package/build/AudioAnalysis/extractAudioAnalysis.js.map +0 -1
- package/build/AudioAnalysis/extractWaveform.d.ts +0 -8
- package/build/AudioAnalysis/extractWaveform.d.ts.map +0 -1
- package/build/AudioAnalysis/extractWaveform.js +0 -11
- package/build/AudioAnalysis/extractWaveform.js.map +0 -1
- package/build/AudioRecorder.provider.d.ts +0 -11
- package/build/AudioRecorder.provider.d.ts.map +0 -1
- package/build/AudioRecorder.provider.js +0 -37
- package/build/AudioRecorder.provider.js.map +0 -1
- package/build/ExpoAudioStream.native.d.ts +0 -3
- package/build/ExpoAudioStream.native.d.ts.map +0 -1
- package/build/ExpoAudioStream.native.js +0 -6
- package/build/ExpoAudioStream.native.js.map +0 -1
- package/build/ExpoAudioStream.types.d.ts +0 -206
- package/build/ExpoAudioStream.types.d.ts.map +0 -1
- package/build/ExpoAudioStream.types.js +0 -2
- package/build/ExpoAudioStream.types.js.map +0 -1
- package/build/ExpoAudioStream.web.d.ts +0 -59
- package/build/ExpoAudioStream.web.d.ts.map +0 -1
- package/build/ExpoAudioStream.web.js +0 -285
- package/build/ExpoAudioStream.web.js.map +0 -1
- package/build/ExpoAudioStreamModule.d.ts +0 -3
- package/build/ExpoAudioStreamModule.d.ts.map +0 -1
- package/build/ExpoAudioStreamModule.js +0 -239
- package/build/ExpoAudioStreamModule.js.map +0 -1
- package/build/WebRecorder.web.d.ts +0 -119
- package/build/WebRecorder.web.d.ts.map +0 -1
- package/build/WebRecorder.web.js +0 -436
- package/build/WebRecorder.web.js.map +0 -1
- package/build/constants.d.ts +0 -11
- package/build/constants.d.ts.map +0 -1
- package/build/constants.js +0 -14
- package/build/constants.js.map +0 -1
- package/build/events.d.ts +0 -26
- package/build/events.d.ts.map +0 -1
- package/build/events.js +0 -21
- package/build/events.js.map +0 -1
- package/build/index.d.ts.map +0 -1
- package/build/index.js.map +0 -1
- package/build/useAudioRecorder.d.ts +0 -21
- package/build/useAudioRecorder.d.ts.map +0 -1
- package/build/useAudioRecorder.js +0 -427
- package/build/useAudioRecorder.js.map +0 -1
- package/build/utils/BlobFix.d.ts +0 -9
- package/build/utils/BlobFix.d.ts.map +0 -1
- package/build/utils/BlobFix.js +0 -498
- package/build/utils/BlobFix.js.map +0 -1
- package/build/utils/audioProcessing.d.ts +0 -24
- package/build/utils/audioProcessing.d.ts.map +0 -1
- package/build/utils/audioProcessing.js +0 -133
- package/build/utils/audioProcessing.js.map +0 -1
- package/build/utils/concatenateBuffers.d.ts +0 -8
- package/build/utils/concatenateBuffers.d.ts.map +0 -1
- package/build/utils/concatenateBuffers.js +0 -21
- package/build/utils/concatenateBuffers.js.map +0 -1
- package/build/utils/convertPCMToFloat32.d.ts +0 -13
- package/build/utils/convertPCMToFloat32.d.ts.map +0 -1
- package/build/utils/convertPCMToFloat32.js +0 -120
- package/build/utils/convertPCMToFloat32.js.map +0 -1
- package/build/utils/encodingToBitDepth.d.ts +0 -5
- package/build/utils/encodingToBitDepth.d.ts.map +0 -1
- package/build/utils/encodingToBitDepth.js +0 -13
- package/build/utils/encodingToBitDepth.js.map +0 -1
- package/build/utils/getWavFileInfo.d.ts +0 -26
- package/build/utils/getWavFileInfo.d.ts.map +0 -1
- package/build/utils/getWavFileInfo.js +0 -92
- package/build/utils/getWavFileInfo.js.map +0 -1
- package/build/utils/writeWavHeader.d.ts +0 -49
- package/build/utils/writeWavHeader.d.ts.map +0 -1
- package/build/utils/writeWavHeader.js +0 -91
- package/build/utils/writeWavHeader.js.map +0 -1
- package/build/workers/InlineFeaturesExtractor.web.d.ts +0 -2
- package/build/workers/InlineFeaturesExtractor.web.d.ts.map +0 -1
- package/build/workers/InlineFeaturesExtractor.web.js +0 -828
- package/build/workers/InlineFeaturesExtractor.web.js.map +0 -1
- package/build/workers/inlineAudioWebWorker.web.d.ts +0 -2
- package/build/workers/inlineAudioWebWorker.web.d.ts.map +0 -1
- package/build/workers/inlineAudioWebWorker.web.js +0 -157
- package/build/workers/inlineAudioWebWorker.web.js.map +0 -1
- package/expo-module.config.json +0 -9
- package/ios/AudioAnalysisData.swift +0 -74
- package/ios/AudioNotificationManager.swift +0 -135
- package/ios/AudioProcessingHelpers.swift +0 -743
- package/ios/AudioProcessor.swift +0 -858
- package/ios/AudioStreamError.swift +0 -7
- package/ios/AudioStreamManager.swift +0 -1708
- package/ios/AudioStreamManagerDelegate.swift +0 -16
- package/ios/DataPoint.swift +0 -54
- package/ios/DecodingConfig.swift +0 -47
- package/ios/ExpoAudioStream.podspec +0 -27
- package/ios/ExpoAudioStreamModule.swift +0 -698
- package/ios/FFT.swift +0 -62
- package/ios/Features.swift +0 -95
- package/ios/Logger.swift +0 -7
- package/ios/NotificationExtension.swift +0 -15
- package/ios/RecordingResult.swift +0 -22
- package/ios/RecordingSettings.swift +0 -265
- package/ios/WaveformExtractor.swift +0 -105
- package/plugin/build/index.d.ts +0 -21
- package/plugin/build/index.js +0 -191
- package/plugin/src/index.ts +0 -278
- package/plugin/tsconfig.json +0 -10
- package/plugin/tsconfig.tsbuildinfo +0 -1
- package/src/AudioAnalysis/AudioAnalysis.types.ts +0 -165
- package/src/AudioAnalysis/extractAudioAnalysis.ts +0 -370
- package/src/AudioAnalysis/extractWaveform.ts +0 -22
- package/src/AudioRecorder.provider.tsx +0 -54
- package/src/ExpoAudioStream.native.ts +0 -6
- package/src/ExpoAudioStream.types.ts +0 -329
- package/src/ExpoAudioStream.web.ts +0 -359
- package/src/ExpoAudioStreamModule.ts +0 -286
- package/src/WebRecorder.web.ts +0 -580
- package/src/constants.ts +0 -18
- package/src/events.ts +0 -60
- package/src/useAudioRecorder.tsx +0 -620
- package/src/utils/BlobFix.ts +0 -559
- package/src/utils/audioProcessing.ts +0 -205
- package/src/utils/concatenateBuffers.ts +0 -24
- package/src/utils/convertPCMToFloat32.ts +0 -170
- package/src/utils/encodingToBitDepth.ts +0 -18
- package/src/utils/getWavFileInfo.ts +0 -132
- package/src/utils/writeWavHeader.ts +0 -114
- package/src/workers/InlineFeaturesExtractor.web.tsx +0 -827
- package/src/workers/inlineAudioWebWorker.web.tsx +0 -156
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
protocol AudioStreamManagerDelegate: AnyObject {
|
|
2
|
-
func audioStreamManager(
|
|
3
|
-
_ manager: AudioStreamManager,
|
|
4
|
-
didReceiveAudioData data: Data,
|
|
5
|
-
recordingTime: TimeInterval,
|
|
6
|
-
totalDataSize: Int64,
|
|
7
|
-
compressionInfo: [String: Any]?
|
|
8
|
-
)
|
|
9
|
-
|
|
10
|
-
func audioStreamManager(_ manager: AudioStreamManager, didReceiveProcessingResult result: AudioAnalysisData?)
|
|
11
|
-
func audioStreamManager(_ manager: AudioStreamManager, didPauseRecording pauseTime: Date)
|
|
12
|
-
func audioStreamManager(_ manager: AudioStreamManager, didResumeRecording resumeTime: Date)
|
|
13
|
-
func audioStreamManager(_ manager: AudioStreamManager, didUpdateNotificationState isPaused: Bool)
|
|
14
|
-
func audioStreamManager(_ manager: AudioStreamManager, didReceiveInterruption info: [String: Any])
|
|
15
|
-
func audioStreamManager(_ manager: AudioStreamManager, didFailWithError error: String)
|
|
16
|
-
}
|
package/ios/DataPoint.swift
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// DataPoint.swift
|
|
3
|
-
// ExpoAudioStream
|
|
4
|
-
//
|
|
5
|
-
// Created by Arthur Breton on 23/6/2024.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
import Foundation
|
|
9
|
-
|
|
10
|
-
public struct SpeechFeatures {
|
|
11
|
-
public var isActive: Bool
|
|
12
|
-
public var speakerId: Int?
|
|
13
|
-
|
|
14
|
-
func toDictionary() -> [String: Any] {
|
|
15
|
-
return [
|
|
16
|
-
"isActive": isActive,
|
|
17
|
-
"speakerId": speakerId as Any
|
|
18
|
-
]
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
public struct DataPoint {
|
|
23
|
-
public var id: Int
|
|
24
|
-
public var amplitude: Float
|
|
25
|
-
public var rms: Float
|
|
26
|
-
public var dB: Float
|
|
27
|
-
public var silent: Bool
|
|
28
|
-
public var features: Features?
|
|
29
|
-
public var speech: SpeechFeatures?
|
|
30
|
-
public let startTime: Float // in seconds
|
|
31
|
-
public let endTime: Float // in seconds
|
|
32
|
-
public let startPosition: Int // byte position in audio file
|
|
33
|
-
public let endPosition: Int // byte position in audio file
|
|
34
|
-
public let samples: Int // number of samples in segment
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
extension DataPoint {
|
|
38
|
-
func toDictionary() -> [String: Any] {
|
|
39
|
-
return [
|
|
40
|
-
"id": id,
|
|
41
|
-
"amplitude": amplitude,
|
|
42
|
-
"rms": rms,
|
|
43
|
-
"dB": dB,
|
|
44
|
-
"silent": silent,
|
|
45
|
-
"features": features?.toDictionary() ?? [:],
|
|
46
|
-
"speech": speech?.toDictionary() ?? [:],
|
|
47
|
-
"startTime": startTime ?? 0,
|
|
48
|
-
"endTime": endTime ?? 0,
|
|
49
|
-
"startPosition": startPosition ?? 0,
|
|
50
|
-
"endPosition": endPosition ?? 0,
|
|
51
|
-
"samples": samples ?? 0
|
|
52
|
-
]
|
|
53
|
-
}
|
|
54
|
-
}
|
package/ios/DecodingConfig.swift
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// DecodingConfig.swift
|
|
3
|
-
// Pods
|
|
4
|
-
//
|
|
5
|
-
// Created by Arthur Breton on 24/2/2025.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
import AVFoundation
|
|
9
|
-
|
|
10
|
-
public struct DecodingConfig {
|
|
11
|
-
let targetSampleRate: Double?
|
|
12
|
-
let targetChannels: Int?
|
|
13
|
-
let targetBitDepth: Int?
|
|
14
|
-
let normalizeAudio: Bool
|
|
15
|
-
|
|
16
|
-
static func fromDictionary(_ dict: [String: Any]?) -> DecodingConfig {
|
|
17
|
-
guard let dict = dict else {
|
|
18
|
-
return DecodingConfig.default
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return DecodingConfig(
|
|
22
|
-
targetSampleRate: dict["targetSampleRate"] as? Double,
|
|
23
|
-
targetChannels: dict["targetChannels"] as? Int,
|
|
24
|
-
targetBitDepth: dict["targetBitDepth"] as? Int,
|
|
25
|
-
normalizeAudio: dict["normalizeAudio"] as? Bool ?? false
|
|
26
|
-
)
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
static var `default`: DecodingConfig {
|
|
30
|
-
return DecodingConfig(
|
|
31
|
-
targetSampleRate: nil,
|
|
32
|
-
targetChannels: nil,
|
|
33
|
-
targetBitDepth: nil,
|
|
34
|
-
normalizeAudio: false
|
|
35
|
-
)
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
func toAudioFormat(baseFormat: AVAudioFormat) -> AVAudioFormat {
|
|
39
|
-
let sampleRate = targetSampleRate ?? baseFormat.sampleRate
|
|
40
|
-
let channels = targetChannels ?? Int(baseFormat.channelCount)
|
|
41
|
-
|
|
42
|
-
return AVAudioFormat(
|
|
43
|
-
standardFormatWithSampleRate: sampleRate,
|
|
44
|
-
channels: AVAudioChannelCount(channels)
|
|
45
|
-
)!
|
|
46
|
-
}
|
|
47
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
require 'json'
|
|
2
|
-
|
|
3
|
-
package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))
|
|
4
|
-
|
|
5
|
-
Pod::Spec.new do |s|
|
|
6
|
-
s.name = 'ExpoAudioStream'
|
|
7
|
-
s.version = package['version']
|
|
8
|
-
s.summary = package['description']
|
|
9
|
-
s.description = package['description']
|
|
10
|
-
s.license = package['license']
|
|
11
|
-
s.author = package['author']
|
|
12
|
-
s.homepage = package['homepage']
|
|
13
|
-
s.platforms = { :ios => '13.4', :tvos => '13.4' }
|
|
14
|
-
s.swift_version = '5.4'
|
|
15
|
-
s.source = { git: 'https://github.com/deeeed/expo-audio-stream' }
|
|
16
|
-
s.static_framework = true
|
|
17
|
-
|
|
18
|
-
s.dependency 'ExpoModulesCore'
|
|
19
|
-
|
|
20
|
-
# Swift/Objective-C compatibility
|
|
21
|
-
s.pod_target_xcconfig = {
|
|
22
|
-
'DEFINES_MODULE' => 'YES',
|
|
23
|
-
'SWIFT_COMPILATION_MODE' => 'wholemodule'
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
s.source_files = "**/*.{h,m,mm,swift}"
|
|
27
|
-
end
|