@@ -65,7 +65,6 @@ def __init__(
6565 num_channels : int = 1 ,
6666 frame_size_ms : int | None = None ,
6767 noise_cancellation : Optional [NoiseCancellationOptions | FrameProcessor [AudioFrame ]] = None ,
68- * ,
6968 noise_cancellation_leave_open : bool = False ,
7069 ** kwargs : Any ,
7170 ) -> None :
@@ -206,6 +205,7 @@ def from_track(
206205 num_channels : int = 1 ,
207206 frame_size_ms : int | None = None ,
208207 noise_cancellation : Optional [NoiseCancellationOptions | FrameProcessor [AudioFrame ]] = None ,
208+ noise_cancellation_leave_open : bool = False ,
209209 ) -> AudioStream :
210210 """Create an `AudioStream` from an existing audio track.
211211
@@ -215,9 +215,12 @@ def from_track(
215215 capacity (int, optional): The capacity of the internal frame queue. Defaults to 0 (unbounded).
216216 sample_rate (int, optional): The sample rate for the audio stream in Hz. Defaults to 48000.
217217 num_channels (int, optional): The number of audio channels. Defaults to 1.
218- noise_cancellation (Optional[NoiseCancellationOptions], optional):
219- If noise cancellation is used, pass a `NoiseCancellationOptions` instance
218+ noise_cancellation (Optional[NoiseCancellationOptions | FrameProcessor[AudioFrame] ], optional):
219+ If noise cancellation is used, pass a `NoiseCancellationOptions` or `FrameProcessor[AudioFrame]` instance
220220 created by the noise cancellation module.
221+ noise_cancellation_leave_open (bool):
222+ When the audio stream closes, leaves the FrameProcessor in an unclosed state so it
223+ can be used with another AudioStream.
221224
222225 Returns:
223226 AudioStream: An instance of `AudioStream` that can be used to receive audio frames.
@@ -237,8 +240,9 @@ def from_track(
237240 capacity = capacity ,
238241 sample_rate = sample_rate ,
239242 num_channels = num_channels ,
240- noise_cancellation = noise_cancellation ,
241243 frame_size_ms = frame_size_ms ,
244+ noise_cancellation = noise_cancellation ,
245+ noise_cancellation_leave_open = noise_cancellation_leave_open ,
242246 )
243247
244248 def _on_processor_stream_info_updated (
0 commit comments