@@ -97,6 +97,7 @@ class PcmData:
9797 dts: The decode timestamp of the audio data.
9898 time_base: The time base for converting timestamps to seconds.
9999 channels: Number of audio channels (1=mono, 2=stereo)
100+ participant: The participant context for this audio data.
100101 """
101102
102103 def __init__ (
@@ -108,6 +109,7 @@ def __init__(
108109 dts : Optional [int ] = None ,
109110 time_base : Optional [float ] = None ,
110111 channels : int = 1 ,
112+ participant : Any = None ,
111113 ):
112114 """
113115 Initialize PcmData.
@@ -120,6 +122,7 @@ def __init__(
120122 dts: The decode timestamp of the audio data
121123 time_base: The time base for converting timestamps to seconds
122124 channels: Number of audio channels (1=mono, 2=stereo)
125+ participant: The participant context for this audio data
123126
124127 Raises:
125128 TypeError: If samples dtype does not match the declared format
@@ -167,6 +170,7 @@ def __init__(
167170 self .dts : Optional [int ] = dts
168171 self .time_base : Optional [float ] = time_base
169172 self .channels : int = channels
173+ self .participant : Any = participant
170174
171175 @property
172176 def stereo (self ) -> bool :
@@ -652,6 +656,7 @@ def to_float32(self) -> "PcmData":
652656 dts = self .dts ,
653657 time_base = self .time_base ,
654658 channels = self .channels ,
659+ participant = self .participant ,
655660 )
656661
657662 def to_int16 (self ) -> "PcmData" :
@@ -715,6 +720,7 @@ def to_int16(self) -> "PcmData":
715720 dts = self .dts ,
716721 time_base = self .time_base ,
717722 channels = self .channels ,
723+ participant = self .participant ,
718724 )
719725
720726 def append (self , other : "PcmData" ) -> "PcmData" :
@@ -875,6 +881,7 @@ def copy(self) -> "PcmData":
875881 dts = self .dts ,
876882 time_base = self .time_base ,
877883 channels = self .channels ,
884+ participant = self .participant ,
878885 )
879886
880887 def clear (self ) -> None :
@@ -1289,6 +1296,7 @@ def tail(
12891296 dts = self .dts ,
12901297 time_base = self .time_base ,
12911298 channels = self .channels ,
1299+ participant = self .participant ,
12921300 )
12931301
12941302 def head (
@@ -1397,6 +1405,7 @@ def head(
13971405 dts = self .dts ,
13981406 time_base = self .time_base ,
13991407 channels = self .channels ,
1408+ participant = self .participant ,
14001409 )
14011410
14021411
@@ -1482,7 +1491,7 @@ def resample(self, pcm: PcmData) -> PcmData:
14821491 samples = self ._adjust_format (samples , current_format , self .format )
14831492 current_format = self .format
14841493
1485- # Create new PcmData with resampled audio, preserving timestamps
1494+ # Create new PcmData with resampled audio, preserving timestamps and participant
14861495 return PcmData (
14871496 samples = samples ,
14881497 sample_rate = self .sample_rate ,
@@ -1491,6 +1500,7 @@ def resample(self, pcm: PcmData) -> PcmData:
14911500 pts = pcm .pts ,
14921501 dts = pcm .dts ,
14931502 time_base = pcm .time_base ,
1503+ participant = pcm .participant ,
14941504 )
14951505
14961506 def _resample_1d (
0 commit comments