@@ -75,18 +75,36 @@ def __init__(
7575 sample_rate if sample_rate is not None else self .metadata .sample_rate
7676 )
7777
78+ def get_all_samples (self ) -> AudioSamples :
79+ """Returns all the audio samples from the source.
80+
81+ To decode samples in a specific range, use
82+ :meth:`~torchcodec.decoders.AudioDecoder.get_samples_played_in_range`.
83+
84+ Returns:
85+ AudioSamples: The samples within the file.
86+ """
87+ return self .get_samples_played_in_range ()
88+
7889 def get_samples_played_in_range (
7990 self , start_seconds : float = 0.0 , stop_seconds : Optional [float ] = None
8091 ) -> AudioSamples :
8192 """Returns audio samples in the given range.
8293
8394 Samples are in the half open range [start_seconds, stop_seconds).
8495
96+ To decode all the samples from beginning to end, you can call this
97+ method while leaving ``start_seconds`` and ``stop_seconds`` to their
98+ default values, or use
99+ :meth:`~torchcodec.decoders.AudioDecoder.get_all_samples` as a more
100+ convenient alias.
101+
85102 Args:
86103 start_seconds (float): Time, in seconds, of the start of the
87104 range. Default: 0.
88- stop_seconds (float): Time, in seconds, of the end of the
89- range. As a half open range, the end is excluded.
105+ stop_seconds (float or None): Time, in seconds, of the end of the
106+ range. As a half open range, the end is excluded. Default: None,
107+ which decodes samples until the end.
90108
91109 Returns:
92110 AudioSamples: The samples within the specified range.
0 commit comments