Skip to content

Commit

Permalink
Change static var stored properties to static let. (#190)
Browse files Browse the repository at this point in the history
As far as I can tell, these stored properties are not meant to be changed. Therefore, change them to be immutable. This change also makes these static properties concurrency-safe.
  • Loading branch information
fumoboy007 authored Aug 11, 2024
1 parent c268c8d commit 59aaa4e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Sources/WhisperKit/Core/WhisperKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ open class WhisperKit {
public var segmentSeeker: any SegmentSeeking

/// Shapes
public static var sampleRate: Int = 16000
public static var hopLength: Int = 160
public static var chunkLength: Int = 30 // seconds
public static var windowSamples: Int = 480_000 // sampleRate * chunkLength
public static var secondsPerTimeToken = Float(0.02)
public static let sampleRate: Int = 16000
public static let hopLength: Int = 160
public static let chunkLength: Int = 30 // seconds
public static let windowSamples: Int = 480_000 // sampleRate * chunkLength
public static let secondsPerTimeToken = Float(0.02)

/// Progress
public private(set) var currentTimings: TranscriptionTimings
Expand Down

0 comments on commit 59aaa4e

Please # to comment.