23 lines
584 B
Swift
23 lines
584 B
Swift
import Foundation
|
|
|
|
public enum AudioSource: String, Equatable {
|
|
case microphone
|
|
case system
|
|
}
|
|
|
|
public struct PCMFrame: Equatable {
|
|
public let source: AudioSource
|
|
public let sampleRate: Int
|
|
public let channels: Int
|
|
public let pcmS16LE: Data
|
|
public let timestamp: Date
|
|
|
|
public init(source: AudioSource, sampleRate: Int, channels: Int, pcmS16LE: Data, timestamp: Date = Date()) {
|
|
self.source = source
|
|
self.sampleRate = sampleRate
|
|
self.channels = channels
|
|
self.pcmS16LE = pcmS16LE
|
|
self.timestamp = timestamp
|
|
}
|
|
}
|