Mercurial > hg > auditok
changeset 412:5a6685f1e42d
Remove unused code and update documentation for AudioRegion
author | Amine Sehili <amine.sehili@gmail.com> |
---|---|
date | Thu, 20 Jun 2024 21:51:11 +0200 |
parents | 0e938065a2db |
children | 0a6bc66562d3 |
files | auditok/core.py |
diffstat | 1 files changed, 3 insertions(+), 29 deletions(-) [+] |
line wrap: on
line diff
--- a/auditok/core.py Thu Jun 20 21:45:08 2024 +0200 +++ b/auditok/core.py Thu Jun 20 21:51:11 2024 +0200 @@ -578,14 +578,9 @@ number of bytes of one audio sample channels : int number of channels of audio data - meta : dict, default: None - any collection of <key:value> elements used to build metadata for - this `AudioRegion`. Meta data can be accessed via `region.meta.key` - if `key` is a valid python attribute name, or via `region.meta[key]` - if not. Note that the :func:`split` function (or the - :meth:`AudioRegion.split` method) returns `AudioRegions` with a ``start`` - and a ``stop`` meta values that indicate the location in seconds of the - region in original audio data. + start : float, default: None + optional start time of the region. This is typically provided by the + `split` function. See also -------- @@ -598,27 +593,6 @@ channels: int start: float = field(default=None, repr=None) - def init__(self, data, sampling_rate, sample_width, channels, meta=None): - check_audio_data(data, sample_width, channels) - self.data = data - self.sampling_rate = sampling_rate - self.sample_width = sample_width - self.channels = channels - self._samples = None - self.splitp = self.split_and_plot - - if meta is not None: - self._meta = _AudioRegionMetadata(meta) - else: - self._meta = None - - self._seconds_view = _SecondsView(self) - self.sec = self.seconds - self.s = self.seconds - - self._millis_view = _MillisView(self) - self.ms = self.millis - def __post_init__(self): check_audio_data(self.data, self.sample_width, self.channels)