Skip to content

Expose engine properties #609

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions Sources/LiveKit/Track/AudioManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@
public var localTracksCount: Int = 0
public var remoteTracksCount: Int = 0
public var isSpeakerOutputPreferred: Bool = true
public var customConfigureFunc: ConfigureAudioSessionFunc?

Check warning on line 104 in Sources/LiveKit/Track/AudioManager.swift

View workflow job for this annotation

GitHub Actions / test (macos-15, 16.2, macOS,variant=Mac Catalyst)

'ConfigureAudioSessionFunc' is deprecated

Check warning on line 104 in Sources/LiveKit/Track/AudioManager.swift

View workflow job for this annotation

GitHub Actions / test (macos-14, 15.4, tvOS Simulator,name=Apple TV)

'ConfigureAudioSessionFunc' is deprecated

Check warning on line 104 in Sources/LiveKit/Track/AudioManager.swift

View workflow job for this annotation

GitHub Actions / test (macos-14, 15.4, macOS,variant=Mac Catalyst)

'ConfigureAudioSessionFunc' is deprecated

Check warning on line 104 in Sources/LiveKit/Track/AudioManager.swift

View workflow job for this annotation

GitHub Actions / test (macos-14, 15.4, macOS,variant=Mac Catalyst)

'ConfigureAudioSessionFunc' is deprecated

Check warning on line 104 in Sources/LiveKit/Track/AudioManager.swift

View workflow job for this annotation

GitHub Actions / test (macos-14, 15.4, visionOS Simulator,name=Apple Vision Pro)

'ConfigureAudioSessionFunc' is deprecated

Check warning on line 104 in Sources/LiveKit/Track/AudioManager.swift

View workflow job for this annotation

GitHub Actions / test (macos-14, 15.4, visionOS Simulator,name=Apple Vision Pro)

'ConfigureAudioSessionFunc' is deprecated

Check warning on line 104 in Sources/LiveKit/Track/AudioManager.swift

View workflow job for this annotation

GitHub Actions / test (macos-15, 16.2, iOS Simulator,OS=18.1,name=iPhone 16 Pro)

'ConfigureAudioSessionFunc' is deprecated

Check warning on line 104 in Sources/LiveKit/Track/AudioManager.swift

View workflow job for this annotation

GitHub Actions / test (macos-14, 15.4, iOS Simulator,OS=17.5,name=iPhone 15 Pro)

'ConfigureAudioSessionFunc' is deprecated

Check warning on line 104 in Sources/LiveKit/Track/AudioManager.swift

View workflow job for this annotation

GitHub Actions / test (macos-14, 15.4, iOS Simulator,OS=17.5,name=iPhone 15 Pro)

'ConfigureAudioSessionFunc' is deprecated
public var sessionConfiguration: AudioSessionConfiguration?

public var trackState: TrackState {

Check warning on line 107 in Sources/LiveKit/Track/AudioManager.swift

View workflow job for this annotation

GitHub Actions / test (macos-15, 16.2, macOS,variant=Mac Catalyst)

'TrackState' is deprecated

Check warning on line 107 in Sources/LiveKit/Track/AudioManager.swift

View workflow job for this annotation

GitHub Actions / test (macos-14, 15.4, tvOS Simulator,name=Apple TV)

'TrackState' is deprecated

Check warning on line 107 in Sources/LiveKit/Track/AudioManager.swift

View workflow job for this annotation

GitHub Actions / test (macos-14, 15.4, macOS,variant=Mac Catalyst)

'TrackState' is deprecated

Check warning on line 107 in Sources/LiveKit/Track/AudioManager.swift

View workflow job for this annotation

GitHub Actions / test (macos-14, 15.4, macOS,variant=Mac Catalyst)

'TrackState' is deprecated

Check warning on line 107 in Sources/LiveKit/Track/AudioManager.swift

View workflow job for this annotation

GitHub Actions / test (macos-14, 15.4, visionOS Simulator,name=Apple Vision Pro)

'TrackState' is deprecated

Check warning on line 107 in Sources/LiveKit/Track/AudioManager.swift

View workflow job for this annotation

GitHub Actions / test (macos-15, 16.2, iOS Simulator,OS=18.1,name=iPhone 16 Pro)

'TrackState' is deprecated

Check warning on line 107 in Sources/LiveKit/Track/AudioManager.swift

View workflow job for this annotation

GitHub Actions / test (macos-14, 15.4, iOS Simulator,OS=17.5,name=iPhone 15 Pro)

'TrackState' is deprecated

Check warning on line 107 in Sources/LiveKit/Track/AudioManager.swift

View workflow job for this annotation

GitHub Actions / test (macos-14, 15.4, iOS Simulator,OS=17.5,name=iPhone 15 Pro)

'TrackState' is deprecated
switch (localTracksCount > 0, remoteTracksCount > 0) {
case (true, false): return .localOnly
case (false, true): return .remoteOnly
Expand Down Expand Up @@ -286,17 +286,19 @@
set { RTC.audioDeviceModule.muteMode = newValue ? .restartEngine : .voiceProcessing }
}

// MARK: - For testing

var isEngineRunning: Bool {
public var isEngineRunning: Bool {
RTC.audioDeviceModule.isEngineRunning
}

var isMicrophoneMuted: Bool {
/// The mute state of internal audio engine which uses Voice Processing I/O mute API ``AVAudioInputNode.isVoiceProcessingInputMuted``.
/// Normally, you do not need to set this manually since it will be handled automatically.
public var isMicrophoneMuted: Bool {
get { RTC.audioDeviceModule.isMicrophoneMuted }
set { RTC.audioDeviceModule.isMicrophoneMuted = newValue }
}

// MARK: - For testing

var engineState: RTCAudioEngineState {
get { RTC.audioDeviceModule.engineState }
set { RTC.audioDeviceModule.engineState = newValue }
Expand Down
Loading