Added missing documentation to the source code in the Playdate bindings target.
This commit is contained in:
@@ -13,8 +13,11 @@ extension Sound {
|
||||
init(_ format: SoundFormat) { self = Format(rawValue: UInt32(format.rawValue)) ?? .mono16bit }
|
||||
var cValue: SoundFormat { SoundFormat(SoundFormat.RawValue(rawValue)) }
|
||||
|
||||
/// Whether the format has two channels.
|
||||
public var isStereo: Bool { rawValue & 1 != 0 }
|
||||
/// Whether samples are 16-bit (rather than 8-bit or ADPCM).
|
||||
public var is16bit: Bool { rawValue >= 2 && rawValue < 4 }
|
||||
/// The size of one sample frame, in bytes.
|
||||
public var bytesPerFrame: Int { Int(SoundFormat_bytesPerFrame(cValue)) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
extension Sound {
|
||||
/// The microphone used when recording.
|
||||
public enum MicSource: UInt32, Sendable {
|
||||
/// Use the headset microphone if one is connected, otherwise the
|
||||
/// built-in microphone.
|
||||
case autodetect = 0
|
||||
/// Always use the built-in microphone.
|
||||
case internalMic = 1
|
||||
/// Always use the headset microphone.
|
||||
case headset = 2
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user