diff --git a/getstream/video/rtc/audio_track.py b/getstream/video/rtc/audio_track.py index a74a4b0f..735355a7 100644 --- a/getstream/video/rtc/audio_track.py +++ b/getstream/video/rtc/audio_track.py @@ -91,7 +91,7 @@ async def write(self, pcm: PcmData): break logger.warning( - "Audio queue overflow, dropped items", + "Audio queue overflow, dropped items max is %d. pcm duration %s ms", self.max_queue_size, pcm.duration_ms, extra={ "dropped_items": dropped_items, "queue_size": self._queue.qsize(), diff --git a/getstream/video/rtc/track_util.py b/getstream/video/rtc/track_util.py index d70a014a..6fcd60d5 100644 --- a/getstream/video/rtc/track_util.py +++ b/getstream/video/rtc/track_util.py @@ -97,6 +97,7 @@ class PcmData: dts: The decode timestamp of the audio data. time_base: The time base for converting timestamps to seconds. channels: Number of audio channels (1=mono, 2=stereo) + participant: The participant context for this audio data. """ def __init__( @@ -108,6 +109,7 @@ def __init__( dts: Optional[int] = None, time_base: Optional[float] = None, channels: int = 1, + participant: Any = None, ): """ Initialize PcmData. @@ -120,6 +122,7 @@ def __init__( dts: The decode timestamp of the audio data time_base: The time base for converting timestamps to seconds channels: Number of audio channels (1=mono, 2=stereo) + participant: The participant context for this audio data Raises: TypeError: If samples dtype does not match the declared format @@ -167,6 +170,7 @@ def __init__( self.dts: Optional[int] = dts self.time_base: Optional[float] = time_base self.channels: int = channels + self.participant: Any = participant @property def stereo(self) -> bool: @@ -652,6 +656,7 @@ def to_float32(self) -> "PcmData": dts=self.dts, time_base=self.time_base, channels=self.channels, + participant=self.participant, ) def to_int16(self) -> "PcmData": @@ -715,6 +720,7 @@ def to_int16(self) -> "PcmData": dts=self.dts, time_base=self.time_base, channels=self.channels, + participant=self.participant, ) def append(self, other: "PcmData") -> "PcmData": @@ -875,6 +881,7 @@ def copy(self) -> "PcmData": dts=self.dts, time_base=self.time_base, channels=self.channels, + participant=self.participant, ) def clear(self) -> None: @@ -1289,6 +1296,7 @@ def tail( dts=self.dts, time_base=self.time_base, channels=self.channels, + participant=self.participant, ) def head( @@ -1397,6 +1405,7 @@ def head( dts=self.dts, time_base=self.time_base, channels=self.channels, + participant=self.participant, ) @@ -1482,7 +1491,7 @@ def resample(self, pcm: PcmData) -> PcmData: samples = self._adjust_format(samples, current_format, self.format) current_format = self.format - # Create new PcmData with resampled audio, preserving timestamps + # Create new PcmData with resampled audio, preserving timestamps and participant return PcmData( samples=samples, sample_rate=self.sample_rate, @@ -1491,6 +1500,7 @@ def resample(self, pcm: PcmData) -> PcmData: pts=pcm.pts, dts=pcm.dts, time_base=pcm.time_base, + participant=pcm.participant, ) def _resample_1d(