This function matches the metadata of audio and the metadata of the photo-identification to output audio clips containing photo-identified individuals

getAudioClip(
  selected_metadata,
  output_extension = ".wav",
  timezone = NULL,
  trim_interval = NULL,
  export_audio_folder = NULL,
  export_data_folder = NULL,
  export_data_filename = NULL,
  show_ffmpeg_on_console = FALSE
)

Arguments

selected_metadata

data frame with metadata of the audio included in the data frame containing the metadata of the photographs produced by the function selectAudios().

output_extension

c('.mp3', '.wav')

timezone

string. Add the correct timezone where the audio were recorded, as per the R base notation (for additional information, see help(timezomes)). Should this argument be left empty, the time zone will be assumed to be the same as the computer system.

trim_interval

Integer. If the chosen output media is a audio clip, output_media='clip', this parameter gives the total number of seconds before and after the photo-identification event. The trimmed audio duration will be 2*trim_interval, i.e. duration [-trim_interval, +trim_interval]. A suggested default is 180 secs (00:03:00) thus exporting a 6-min audio clip.

export_audio_folder

full path of the destination folder where the audio clips should be saved at

export_data_folder

full folder path to where the data frame with the matched data should be exported to

export_data_filename

csv name for the export file (e.g. export_data_filename = 'trimmed_audioclip_database.csv')

show_ffmpeg_on_console

logical. If TRUE, it prints the FFmpeg output on console.

Note

Requires FFmpeg. Please install it from [http://ffmpeg.org]

Author

Alexandre Machado, Mauricio Cantor

Examples

if (FALSE) { getAudioClip(selected_metadata = df_selected_audios, output_extension = '.wav', timezone = "America/Sao_Paulo", trim_interval = 60, export_audio_folder = '/Volumes/HDD/export/sync', export_data_folder = '/Volumes/HDD/export/sync', export_data_filename = "audio_clips.csv", show_ffmpeg_on_console = TRUE) }