Module rfcx-utils.audio

Functions

def csv_download(destination_path, csv_file_name, audio_extension='opus')

Read csv file for downloading audio from RFCx in user format supported: wav, opus, png, etc.

Args

destination_path
Path to the save directory.
csv_file_name
Name of the csv file using for download audio.
audio_extension
(optional, default= '.opus') Extension for saving audio files.

Returns

None.

Raises

TypeError
if missing required arguments.
def csv_slice_audio(csv_file_name, output_path, input_path_prefix=None, slice_second=2)

Read csv file for cutting audio.

Args

csv_file_name
Name of the csv file using for cut audio.

Returns

None.

Raises

TypeError
if missing required arguments.
FileNotFoundError
if missing required audio file.
def praat_slice_audio(praat_file_name, output_path, input_path_prefix=None, slice_second=2)

Read praat file for cutting audio.

Args

praat_file_name
Name of the praat file using for cut audio.

Returns

None.

Raises

TypeError
if missing required arguments.
FileNotFoundError
if missing required audio file.
def save_audio_file(destination_path, audio_id, source_audio_extension='opus')

Prepare url and local_path and save it using function __save_file

Args

destination_path
Path to the save directory.
audio_id
RFCx audio id.
source_audio_extension
(optional, default= '.opus') Extension for saving audio files.

Returns

None.

Raises

TypeError
if missing required arguments.