Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion getstream/video/rtc/audio_track.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
12 changes: 11 additions & 1 deletion getstream/video/rtc/track_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__(
Expand All @@ -108,6 +109,7 @@ def __init__(
dts: Optional[int] = None,
time_base: Optional[float] = None,
channels: int = 1,
participant: Any = None,
):
"""
Initialize PcmData.
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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":
Expand Down Expand Up @@ -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":
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -1289,6 +1296,7 @@ def tail(
dts=self.dts,
time_base=self.time_base,
channels=self.channels,
participant=self.participant,
)

def head(
Expand Down Expand Up @@ -1397,6 +1405,7 @@ def head(
dts=self.dts,
time_base=self.time_base,
channels=self.channels,
participant=self.participant,
)


Expand Down Expand Up @@ -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,
Expand All @@ -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(
Expand Down