Skip to content

Commit 6f2ff5f

Browse files
committed
fix parse
1 parent b10c50d commit 6f2ff5f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

shared_swift/LiveKitPlugin.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ public class LiveKitPlugin: NSObject, FlutterPlugin {
207207

208208
public func parseAudioFormat(args: [String: Any?]) -> AVAudioFormat? {
209209
guard let commonFormatString = args[commonFormatKey] as? String,
210-
let sampleRate = args[sampleRateKey] as? Double,
211-
let channels = args[channelsKey] as? AVAudioChannelCount else {
210+
let sampleRate = args[sampleRateKey] as? Int,
211+
let channels = args[channelsKey] as? Int else {
212212
return nil
213213
}
214214

@@ -224,7 +224,10 @@ public class LiveKitPlugin: NSObject, FlutterPlugin {
224224
return nil
225225
}
226226

227-
return AVAudioFormat(commonFormat: commonFormat, sampleRate: sampleRate, channels: channels, interleaved: false)
227+
return AVAudioFormat(commonFormat: commonFormat,
228+
sampleRate: Double(sampleRate),
229+
channels: AVAudioChannelCount(channels),
230+
interleaved: false)
228231
}
229232

230233
public func handleStartAudioRenderer(args: [String: Any?], result: @escaping FlutterResult) {

0 commit comments

Comments
 (0)