whisper.rn 0.3.8 → 0.3.9

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.
@@ -1,5 +1,9 @@
1
1
  #import "RNWhisperAudioSessionUtils.h"
2
2
 
3
+ #if defined(TARGET_OS_TV) && TARGET_OS_TV == 1
4
+ #define APPLE_TV
5
+ #endif
6
+
3
7
  @implementation RNWhisperAudioSessionUtils
4
8
 
5
9
  static NSDictionary *_categories;
@@ -19,10 +23,12 @@ static NSDictionary *_modes;
19
23
  @"MixWithOthers": @(AVAudioSessionCategoryOptionMixWithOthers),
20
24
  @"DuckOthers": @(AVAudioSessionCategoryOptionDuckOthers),
21
25
  @"InterruptSpokenAudioAndMixWithOthers": @(AVAudioSessionCategoryOptionInterruptSpokenAudioAndMixWithOthers),
22
- @"AllowBluetooth": @(AVAudioSessionCategoryOptionAllowBluetooth),
23
26
  @"AllowBluetoothA2DP": @(AVAudioSessionCategoryOptionAllowBluetoothA2DP),
24
27
  @"AllowAirPlay": @(AVAudioSessionCategoryOptionAllowAirPlay),
28
+ #if !defined(APPLE_TV)
29
+ @"AllowBluetooth": @(AVAudioSessionCategoryOptionAllowBluetooth),
25
30
  @"DefaultToSpeaker": @(AVAudioSessionCategoryOptionDefaultToSpeaker)
31
+ #endif
26
32
  };
27
33
  _modes = @{
28
34
  @"Default": AVAudioSessionModeDefault,
package/jest/mock.js CHANGED
@@ -48,6 +48,16 @@ if (!NativeModules.RNWhisper) {
48
48
  releaseContext: jest.fn(() => Promise.resolve()),
49
49
  releaseAllContexts: jest.fn(() => Promise.resolve()),
50
50
 
51
+ // iOS AudioSession utils
52
+ getAudioSessionCurrentCategory: jest.fn(() => Promise.resolve({
53
+ category: 'AVAudioSessionCategoryPlayAndRecord',
54
+ options: [],
55
+ })),
56
+ getAudioSessionCurrentMode: jest.fn(() => Promise.resolve('')),
57
+ setAudioSessionCategory: jest.fn(() => Promise.resolve()),
58
+ setAudioSessionMode: jest.fn(() => Promise.resolve()),
59
+ setAudioSessionActive: jest.fn(() => Promise.resolve()),
60
+
51
61
  // For NativeEventEmitter
52
62
  addListener: jest.fn(),
53
63
  removeListeners: jest.fn(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whisper.rn",
3
- "version": "0.3.8",
3
+ "version": "0.3.9",
4
4
  "description": "React Native binding of whisper.cpp",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",