Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ let package = Package(
)
],
dependencies: [
.package(name: "WebRTC", url: "https://github.com/webrtc-sdk/Specs.git", .exact("114.5735.02")),
.package(name: "WebRTC", url: "https://github.com/webrtc-sdk/Specs.git", .exact("114.5735.04")),
.package(name: "SwiftProtobuf", url: "https://github.com/apple/swift-protobuf.git", .upToNextMajor(from: "1.21.0")),
.package(name: "Promises", url: "https://github.com/google/promises.git", .upToNextMajor(from: "2.2.0")),
.package(url: "https://github.com/apple/swift-log.git", .upToNextMajor(from: "1.5.2"))
Expand Down
7 changes: 6 additions & 1 deletion Sources/LiveKit/Core/Engine+WebRTC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ internal extension Engine {

static private let decoderFactory = VideoDecoderFactory()

static let audioProcessingModule: RTCDefaultAudioProcessingModule = {
RTCDefaultAudioProcessingModule()
}()

static let peerConnectionFactory: RTCPeerConnectionFactory = {

logger.log("Initializing SSL...", type: Engine.self)
Expand All @@ -94,7 +98,8 @@ internal extension Engine {

return RTCPeerConnectionFactory(bypassVoiceProcessing: bypassVoiceProcessing,
encoderFactory: encoderFactory,
decoderFactory: decoderFactory)
decoderFactory: decoderFactory,
audioProcessingModule: audioProcessingModule)
}()

// forbid direct access
Expand Down
10 changes: 10 additions & 0 deletions Sources/LiveKit/Core/Room.swift
Original file line number Diff line number Diff line change
Expand Up @@ -442,3 +442,13 @@ extension Room {
set { Engine.bypassVoiceProcessing = newValue }
}
}

// MARK: - Audio Processing

extension Room {

@objc
public static var audioProcessingModule: RTCDefaultAudioProcessingModule {
Engine.audioProcessingModule
}
}
2 changes: 1 addition & 1 deletion Sources/LiveKit/Core/Transport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ extension Transport: RTCPeerConnectionDelegate {
return
}

log("didAdd track \(track.trackId)")
log("didAddTrack type: \(type(of: track)), id: \(track.trackId)")
notify { $0.transport(self, didAddTrack: track, rtpReceiver: rtpReceiver, streams: mediaStreams) }
}

Expand Down
5 changes: 0 additions & 5 deletions Sources/LiveKit/Track/AudioTrack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,4 @@ import WebRTC

@objc
public protocol AudioTrack where Self: Track {

}

extension AudioTrack {

}
10 changes: 10 additions & 0 deletions Sources/LiveKit/Track/Remote/RemoteAudioTrack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,14 @@ public class RemoteAudioTrack: Track, RemoteTrack, AudioTrack {
return didStop
}
}

public func add(audioRenderer: RTCAudioRenderer) {
guard let audioTrack = mediaTrack as? RTCAudioTrack else { return }
audioTrack.add(audioRenderer)
}

public func remove(audioRenderer: RTCAudioRenderer) {
guard let audioTrack = mediaTrack as? RTCAudioTrack else { return }
audioTrack.remove(audioRenderer)
}
}