asrtoolkit/data_structures/audio_file.py
def cut_utterance(source_audio_file, target_audio_file, start_time, end_time, sample_rate=16000):
  """
    source_audio_file: str, path to file
    target_audio_file: str, path to file
    start_time: float or str
    end_time: float or str
    sample_rate: int, default 16000; audio sample rate in Hz

    uses sox segment source_audio_file to create target_audio_file that contains audio from start_time to end_time
        with audio sample rate set to sample_rate
    """
  subprocess.call(
    [
      "sox {} -r {} -b 16 -c 1 {} trim {} ={}"
      .format(source_audio_file, str(sample_rate), target_audio_file, str(start_time), str(end_time))
    ],
    shell=True
  )

    source_audio_file: str, path to file
    target_audio_file: str, path to file
    start_time: float or str
    end_time: float or str
    sample_rate: int, default 16000; audio sample rate in Hz

    uses sox segment source_audio_file to create target_audio_file that contains audio from start_time to end_time
        with audio sample rate set to sample_rate
    
str, path to file
target_audio_file: str, path to file
start_time: float or str
end_time: float or str
sample_rate: int, default 16000; audio sample rate in Hz

uses sox segment source_audio_file to create target_audio_file that contains audio from start_time to end_time
with audio sample rate set to sample_rate
str path to file target_audio_file : str path to file start_time : float or str end_time : float or str sample_rate : int default 16000 ; audio sample rate in Hz uses sox segment source_audio_file to create target_audio_file that contains audio from start_time to end_time with audio sample rate set to sample_rate
def cut_utterance(source_audio_file, target_audio_file, start_time, end_time, sample_rate=16000):
  subprocess.call(
    [
      "sox {} -r {} -b 16 -c 1 {} trim {} ={}"
      .format(source_audio_file, str(sample_rate), target_audio_file, str(start_time), str(end_time))
    ],
    shell=True
  )
def cut_utterance ( source_audio_file , target_audio_file , start_time , end_time , sample_rate = 16000 ) : subprocess . call ( [ "sox {} -r {} -b 16 -c 1 {} trim {} ={}" . format ( source_audio_file , str ( sample_rate ) , target_audio_file , str ( start_time ) , str ( end_time ) ) ] , shell = True )
source_audio_file: str, path to file
target_audio_file: str, path to file
start_time: float or str
end_time: float or str
sample_rate: int, default 16000; audio sample rate in Hz
source_audio_file : str path to file target_audio_file : str path to file start_time : float or str end_time : float or str sample_rate : int default 16000 ; audio sample rate in Hz
"""
    source_audio_file: str, path to file
    target_audio_file: str, path to file
    start_time: float or str
    end_time: float or str
    sample_rate: int, default 16000; audio sample rate in Hz

    uses sox segment source_audio_file to create target_audio_file that contains audio from start_time to end_time
        with audio sample rate set to sample_rate
    """
source_audio_file
target_audio_file
start_time
end_time
sample_rate