OwnAudioClock

Takes ownership of audio clock.

Synopsis

Item OwnAudioClock (void)

Description

This function takes ownership of the audio clock so that it can change the rate or so that no other task can change the clock rate during ownership, or both. The audio clock rate is set to a default of around 240 Hz. Taking clock ownership without changing the rate ensures that no other task will change the rate, which assures a steady clock.

Note that a task can't change the clock rate without owning the clock.

Ownership can be relinquished with DisownAudioClock().

Arguments

None.

Return Value

The function returns the item number of a semaphore used to claim ownership of the clock if successful (a positive value). It returns an error code (a negative value) if an error occurs.

Implementation

Folio call implemented in Audio folio V20.

Caveats

Owning the audio clock and hanging onto the lock forever causes any other task trying to the same to fail.

Associated Files

audio.h

See Also

DisownAudioClock(), SetAudioRate(), SetAudioDuration GetAudioRate(), GetAudioDuration(), SignalAtTime(), SleepUntilTime(), GetAudioTime()