Skip to main content
Stack Overflow
  1. About
  2. For Teams

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

The issue of switching the clock source on devices

I am using SimplyCoreAudio to switch the clock source. The code is as follows:

 debugPrint("nullAudioDevice.clockSourceID \(nullAudioDevice.clockSourceID)")
 if let cid = hardwareDevice.clockSourceID {
 if nullAudioDevice.setClockSourceID(cid) {
 debugPrint("hardwareDevice.clockSourceID \(hardwareDevice.clockSourceID)")
 debugPrint("nullAudioDevice.clockSourceID \(nullAudioDevice.clockSourceID)")
 }else{
 debugPrint("false")
 }
 }

The printed result is as follows:

nullAudioDevice.clockSourceID Optional(4294967295)
hardwareDevice.clockSourceID Optional(690487296)
nullAudioDevice.clockSourceID Optional(4294967295)

Why does the ID returned after successfully setting the clock source with setClockSourceID still show the original one? Does this mean the setting was not successful? Is there a proper method to synchronize the clock source setting?

Answer*

Draft saved
Draft discarded
Cancel

lang-swift

AltStyle によって変換されたページ (->オリジナル) /