Mercurial > hg > auditok
changeset 408:60a7fb533fba
Add a .numpy() method for AudioRegion
author | Amine Sehili <amine.sehili@gmail.com> |
---|---|
date | Wed, 19 Jun 2024 23:12:01 +0200 |
parents | 6c33626d0bff |
children | 183696f0111e |
files | auditok/core.py |
diffstat | 1 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/auditok/core.py Wed Jun 19 23:06:32 2024 +0200 +++ b/auditok/core.py Wed Jun 19 23:12:01 2024 +0200 @@ -896,9 +896,6 @@ ) return regions - def __array__(self): - return self.samples - @property def samples(self): """Audio region as arrays of samples, one array per channel.""" @@ -908,6 +905,12 @@ ) return self._samples + def __array__(self): + return self.samples + + def numpy(self): + return self.samples + def __len__(self): """ Return region length in number of samples.