react-native-audio-api 0.11.3 → 0.11.5

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.
@@ -61,7 +61,8 @@ JSI_HOST_FUNCTION_IMPL(BiquadFilterNodeHostObject, getFrequencyResponse) {
61
61
  auto arrayBufferFrequency =
62
62
  args[0].getObject(runtime).getPropertyAsObject(runtime, "buffer").getArrayBuffer(runtime);
63
63
  auto frequencyArray = reinterpret_cast<float *>(arrayBufferFrequency.data(runtime));
64
- auto length = static_cast<size_t>(arrayBufferFrequency.size(runtime));
64
+ // arrayBufferFrequency is Float32Array from JS and size is in bytes thus hardcoded division by 4
65
+ auto length = static_cast<size_t>(arrayBufferFrequency.size(runtime) / 4);
65
66
 
66
67
  auto arrayBufferMag =
67
68
  args[1].getObject(runtime).getPropertyAsObject(runtime, "buffer").getArrayBuffer(runtime);
@@ -399,7 +399,12 @@ static AudioSessionManager *_sharedInstance = nil;
399
399
  }
400
400
 
401
401
  if ([option isEqualToString:@"allowBluetoothHFP"]) {
402
- options |= AVAudioSessionCategoryOptionAllowBluetoothHFP;
402
+ // XCode 26.x (default support SDK >= 26.x) uses AVAudioSessionCategoryOptionAllowBluetoothHFP as new standard for every platfrom (down to iOS 1.0)
403
+ // Older Xcode (default support SDKs) versions doesn't define it at all.
404
+ // Both (AVAudioSessionCategoryOptionAllowBluetooth in SDK < 26.x) and (AVAudioSessionCategoryOptionAllowBluetoothHFP in SDK >= 26.x) resolve to this value
405
+ // We use it here directly as there is no reliable way to switch between them (no @available for this).
406
+ // TODO: replace with AVAudioSessionCategoryOptionAllowBluetoothHFP once XCode 16.x will dig its grave
407
+ options |= 0x4;
403
408
  }
404
409
 
405
410
  if ([option isEqualToString:@"defaultToSpeaker"]) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-audio-api",
3
- "version": "0.11.3",
3
+ "version": "0.11.5",
4
4
  "description": "react-native-audio-api provides system for controlling audio in React Native environment compatible with Web Audio API specification",
5
5
  "bin": {
6
6
  "setup-rn-audio-api-web": "./scripts/setup-rn-audio-api-web.js"