src/media/audio/drivers/virtual_audio/virtual_audio_stream.cc
// Handler for sending alternate position notifications: those going to VAD clients that specified a
// different notification frequency. These are not sent to AudioCore.
Handler for sending alternate position notifications: those going to VAD clients that specified a
different notification frequency. These are not sent to AudioCore.
Handler for sending alternate position notifications : those going to VAD clients that specified a different notification frequency . These are not sent to AudioCore .
void VirtualAudioStream::ProcessAltRingNotification() {
  audio::ScopedToken t(
      domain_token());  
  ZX_DEBUG_ASSERT(using_alt_notifications_);
  ZX_DEBUG_ASSERT(alt_notification_period_.get() > 0);
  auto monotonic_time = target_alt_notification_time_.get();
  ZX_DEBUG_ASSERT(monotonic_time > 0);
  auto running_duration = target_alt_notification_time_ - start_time_;
  uint64_t frames = (running_duration * frame_rate_) / zx::sec(1);
  uint32_t ring_buffer_position = (frames % num_ring_buffer_frames_) * frame_size_;
  parent_->NotifyPosition(monotonic_time, ring_buffer_position);
  target_alt_notification_time_ += alt_notification_period_;
  alt_notify_timer_.PostForTime(dispatcher(), target_alt_notification_time_);
}
void VirtualAudioStream :: ProcessAltRingNotification ( ) { audio :: ScopedToken t ( domain_token ( ) ) ; ZX_DEBUG_ASSERT ( using_alt_notifications_ ) ; ZX_DEBUG_ASSERT ( alt_notification_period_ . get ( ) > 0 ) ; auto monotonic_time = target_alt_notification_time_ . get ( ) ; ZX_DEBUG_ASSERT ( monotonic_time > 0 ) ; auto running_duration = target_alt_notification_time_ - start_time_ ; uint64_t frames = ( running_duration * frame_rate_ ) / zx :: sec ( 1 ) ; uint32_t ring_buffer_position = ( frames % num_ring_buffer_frames_ ) * frame_size_ ; parent_ -> NotifyPosition ( monotonic_time , ring_buffer_position ) ; target_alt_notification_time_ += alt_notification_period_ ; alt_notify_timer_ . PostForTime ( dispatcher ( ) , target_alt_notification_time_ ) ; }
Handler for sending alternate position notifications: those going to VAD clients that specified a
different notification frequency.
Handler for sending alternate position notifications : those going to VAD clients that specified a different notification frequency .
// This method handles posts to alt_notify_timer_ sent to dispatcher(). // TODO(MTWN-57): use a proper Timeline object here.