diff --git a/TheAmazingAudioEngine/Core Types/AETime.h b/TheAmazingAudioEngine/Core Types/AETime.h index 4384a1e..264209d 100644 --- a/TheAmazingAudioEngine/Core Types/AETime.h +++ b/TheAmazingAudioEngine/Core Types/AETime.h @@ -32,6 +32,11 @@ extern "C" { typedef uint64_t AEHostTicks; typedef double AESeconds; + +/*! + * Initialize + */ +void AETimeInit(); /*! * Get current global timestamp, in host ticks diff --git a/TheAmazingAudioEngine/Core Types/AETime.m b/TheAmazingAudioEngine/Core Types/AETime.m index f65cd92..546e70d 100644 --- a/TheAmazingAudioEngine/Core Types/AETime.m +++ b/TheAmazingAudioEngine/Core Types/AETime.m @@ -30,7 +30,7 @@ static double __hostTicksToSeconds = 0.0; static double __secondsToHostTicks = 0.0; -static void AETimeInit() { +void AETimeInit() { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ mach_timebase_info_data_t tinfo; diff --git a/TheAmazingAudioEngine/Utilities/AEIOAudioUnit.m b/TheAmazingAudioEngine/Utilities/AEIOAudioUnit.m index dd7708d..3a778e8 100644 --- a/TheAmazingAudioEngine/Utilities/AEIOAudioUnit.m +++ b/TheAmazingAudioEngine/Utilities/AEIOAudioUnit.m @@ -65,6 +65,8 @@ - (instancetype)init { _outputEnabled = YES; self.renderBlockValue = [AEManagedValue new]; + AETimeInit(); + return self; }