Skip to contentSkip to navigationSkip to topbar
Page toolsOn this pageProducts used
Looking for more inspiration?Visit the

31931: Stream - Media - Media Discarded


WARNING: 31931

warning-31931 page anchor
VOICE
WARNING

Twilio sends this warning once per Stream when audio sent to a bidirectional Media Stream is discarded because the downstream buffer has overflowed. Twilio buffers outbound media messages and plays them in the order received. If buffered audio grows beyond 10 minutes, Twilio stops accepting more audio for that Stream.

Possible causes

possible-causes page anchor
  • Your WebSocket server sent media messages faster than Twilio could play them back on the Call.
  • More than 10 minutes of audio was buffered for the Stream. After that limit is reached, no more audio is accepted.
  • Your application kept queueing audio without tracking playback completion with mark messages.
  • Send audio only on bidirectional Streams created with <Connect><Stream>. If you only need to receive audio, use a unidirectional Stream instead of sending media back to Twilio.
  • Pace outbound media messages so the buffer can drain before you send more audio.
  • Send a mark message after each media message and wait for the matching mark event before sending large amounts of additional audio.
  • If you need to interrupt queued audio, send a clear message to empty the buffer before sending replacement audio.

Additional resources

additional-resources page anchor