Add LiGetPendingAudioDuration() function

This commit is contained in:
Cameron Gutman 2019-11-30 21:31:50 -06:00
parent 52f489bc46
commit 6b42954b47
2 changed files with 11 additions and 1 deletions

View File

@ -408,3 +408,7 @@ int startAudioStream(void* audioContext, int arFlags) {
int LiGetPendingAudioFrames(void) {
return LbqGetItemCount(&packetQueue);
}
int LiGetPendingAudioDuration(void) {
return LiGetPendingAudioFrames() * AudioPacketDuration;
}

View File

@ -454,9 +454,15 @@ int LiFindExternalAddressIP4(const char* stunServer, unsigned short stunPort, un
int LiGetPendingVideoFrames(void);
// Returns the number of queued audio frames ready for delivery. Only relevant
// if CAPABILITY_DIRECT_SUBMIT is not set for the audio renderer.
// if CAPABILITY_DIRECT_SUBMIT is not set for the audio renderer. For most uses,
// LiGetPendingAudioDuration() is probably a better option than this function.
int LiGetPendingAudioFrames(void);
// Similar to LiGetPendingAudioFrames() except it returns the pending audio in
// milliseconds rather than frames, which allows callers to be agnostic of the
// negotiated audio frame duration.
int LiGetPendingAudioDuration(void);
#ifdef __cplusplus
}
#endif