Pad the audio samples so that it starts at time 0. Returns ------- int Number of samples padded
(self)
| 142 | return self._num_padding |
| 143 | |
| 144 | def add_padding(self): |
| 145 | """Pad the audio samples so that it starts at time 0. |
| 146 | |
| 147 | Returns |
| 148 | ------- |
| 149 | int |
| 150 | Number of samples padded |
| 151 | |
| 152 | """ |
| 153 | self._array = np.pad(self._array, ((0, 0), (self.__get_num_padding(), 0)), 'constant', constant_values=0) |
| 154 | self._duration += self.__get_num_padding() * self.sample_rate |
| 155 | return self.__get_num_padding() |
| 156 | |
| 157 | def get_info(self): |
| 158 | """Log out the basic info about the audio stream.""" |