# HG changeset patch # User Amine Sehili # Date 1557342751 -3600 # Node ID f6ac8dbea102c7026426225f7d9900d8629f0d3d # Parent 6e574fa1b573bd1a4689f25b6170610428c1f6db Implement play in AudioRegion diff -r 6e574fa1b573 -r f6ac8dbea102 auditok/core.py --- a/auditok/core.py Mon May 06 18:43:34 2019 +0100 +++ b/auditok/core.py Wed May 08 20:12:31 2019 +0100 @@ -10,7 +10,7 @@ """ import os from auditok.util import AudioDataSource, DataValidator, AudioEnergyValidator -from auditok.io import check_audio_data, to_file +from auditok.io import check_audio_data, to_file, player_for __all__ = ["split", "AudioRegion", "StreamTokenizer"] @@ -271,6 +271,11 @@ def ch(self): return self._channels + def play(self, player=None, progress_bar=False): + if player is None: + player = player_for(self) + player.play(self, progress_bar=progress_bar) + def save(self, file, format=None, exists_ok=True, **audio_parameters): """Save audio region to file.