@edkimmel/expo-audio-stream 0.6.3 → 0.6.4
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/ios/ExpoPlayAudioStreamModule.swift +6 -2
- package/ios/Microphone.swift +2 -1
- package/package.json +1 -1
- package/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.9/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/vcs-1/gc.properties +0 -0
|
@@ -31,6 +31,7 @@ public class ExpoPlayAudioStreamModule: Module, MicrophoneDataDelegate, Pipeline
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
private var isAudioSessionInitialized: Bool = false
|
|
34
|
+
private var micTotalDataSize: Int = 0
|
|
34
35
|
|
|
35
36
|
// ── PipelineEventSender conformance ───────────────────────────────
|
|
36
37
|
func sendPipelineEvent(_ eventName: String, _ params: [String: Any]) {
|
|
@@ -150,6 +151,7 @@ public class ExpoPlayAudioStreamModule: Module, MicrophoneDataDelegate, Pipeline
|
|
|
150
151
|
"sampleRate": result.sampleRate ?? 48000,
|
|
151
152
|
"mimeType": result.mimeType ?? "",
|
|
152
153
|
]
|
|
154
|
+
micTotalDataSize = 0
|
|
153
155
|
promise.resolve(resultDict)
|
|
154
156
|
}
|
|
155
157
|
} else {
|
|
@@ -328,13 +330,15 @@ public class ExpoPlayAudioStreamModule: Module, MicrophoneDataDelegate, Pipeline
|
|
|
328
330
|
|
|
329
331
|
func onMicrophoneData(_ microphoneData: Data, _ soundLevel: Float?, _ frequencyBands: FrequencyBands?) {
|
|
330
332
|
let encodedData = microphoneData.base64EncodedString()
|
|
333
|
+
let deltaSize = microphoneData.count
|
|
334
|
+
micTotalDataSize += deltaSize
|
|
331
335
|
var eventBody: [String: Any] = [
|
|
332
336
|
"fileUri": "",
|
|
333
337
|
"lastEmittedSize": 0,
|
|
334
338
|
"position": 0,
|
|
335
339
|
"encoded": encodedData,
|
|
336
|
-
"deltaSize":
|
|
337
|
-
"totalSize":
|
|
340
|
+
"deltaSize": deltaSize,
|
|
341
|
+
"totalSize": micTotalDataSize,
|
|
338
342
|
"mimeType": "",
|
|
339
343
|
"soundLevel": soundLevel ?? -160
|
|
340
344
|
]
|
package/ios/Microphone.swift
CHANGED
|
@@ -301,7 +301,8 @@ class Microphone: SharedAudioEngineDelegate {
|
|
|
301
301
|
|
|
302
302
|
let data: Data
|
|
303
303
|
if isSilent {
|
|
304
|
-
let
|
|
304
|
+
let bytesPerSample = targetBitDepth / 8
|
|
305
|
+
let byteCount = Int(currentBuffer.frameLength) * Int(currentBuffer.format.channelCount) * bytesPerSample
|
|
305
306
|
data = Data(repeating: 0, count: byteCount)
|
|
306
307
|
} else if targetBitDepth == 16 && currentBuffer.format.commonFormat == .pcmFormatFloat32,
|
|
307
308
|
let floatData = currentBuffer.floatChannelData {
|
package/package.json
CHANGED
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
File without changes
|