break;
case WCMRAudioDeviceManagerClient::AudioCallback:
if (parameter) {
- AudioCallbackData* audio_callback_data = (AudioCallbackData*)parameter;
+ const AudioCallbackData* audio_callback_data = (AudioCallbackData*)parameter;
_audio_device_callback (
audio_callback_data->acdInputBuffer,
audio_callback_data->acdOutputBuffer,
const float *acdInputBuffer;
float *acdOutputBuffer;
size_t acdFrames;
- uint32_t acdSampleTime;
+ uint64_t acdSampleTime;
uint64_t acdCycleStartTimeNanos;
};
AudioDeviceID m_DeviceID; ///< The CoreAudio device id
bool m_StopRequested; ///< should be set to true when want to stop, set to false otherwise.
float *m_pInputData; ///< This is what came in with the most recent callback.
- int m_SampleCounter; ///< The current running sample counter, updated by the audio callback.
- int m_SampleCountAtLastIdle; ///< What was the sample count last time we checked...
+ uint64_t m_SampleCounter; ///< The current running sample counter, updated by the audio callback.
+ uint64_t m_SampleCountAtLastIdle; ///< What was the sample count last time we checked...
int m_StalledSampleCounter; ///< The number of idle calls with same sample count detected
int m_ChangeCheckCounter; ///< The number of idle calls passed since we checked the buffer size change.
float* theInpBuffers = _m_inputBuffer;
#endif
- uint32_t currentSampleTime = 0;
const size_t buffer_size = CurrentBufferSize();
const uint64_t cyclePeriodNanos = (1000000000.0 * buffer_size) / CurrentSamplingRate();
m_pMyManager->NotifyClient (WCMRAudioDeviceManagerClient::AudioCallback, (void *)&audioCallbackData);
- currentSampleTime += buffer_size;
+ audioCallbackData.acdSampleTime += buffer_size;
int64_t timeToSleepUsecs = ((int64_t)cycleEndTimeNanos - (int64_t)__get_time_nanos())/1000;
PaStream* m_PortAudioStream; ///< Port audio stream, when the device is active!
bool m_StopRequested; ///< should be set to true when want to stop, set to false otherwise.
const float *m_pInputData; ///< This is what came in with the most recent callback.
- int m_SampleCounter; ///< The current running sample counter, updated by the audio callback.
- int m_SampleCountAtLastIdle;
+ uint64_t m_SampleCounter; ///< The current running sample counter, updated by the audio callback.
+ uint64_t m_SampleCountAtLastIdle;
int m_DropsDetected; ///< Number of times audio drops have been detected so far.
int m_DropsReported; ///< Number of times audio drops have been reported so far to the client.