ntt.sounds package#

Submodules#

ntt.sounds.sound_detection module#

ntt.sounds.sound_detection.detect_sound_ref(video_path, bip_ref_path='ref_bip_isolated.wav', references_path='ref_features_bip.npy')#
ntt.sounds.sound_detection.detect_sound_ref_librosa(samples_path, video_name, ref_sound_name, path_out, threshold=20)#
ntt.sounds.sound_detection.simple_peak_count_librosa(video_path, video_name)#

ntt.sounds.sound_gap_measure module#

ntt.sounds.sound_gap_measure.sound_gap_measure(video1: str, video2: str) float#
Parameters:
  • video1 (str) – Path of the reference video

  • video2 (str) – Path of the comparison video

Returns:

gap (ms) between video1 and video2

Return type:

float

ntt.sounds.sound_generation module#

ntt.sounds.sound_generation.dirac(duration: float, decalage: float, filename: str)#

prend un signal s1 [1 0 0 0 … 0] et un s2 [0 … 0] génère 2 vidéos noirs, - filename+”.mp4” : bande sonore s1 - filename+”decale.mp4” : bande sonore s2 puis s1

Parameters:
  • duration (float) – durée du signal s1

  • decalage (float) – durée du signal s2

  • filename (str) – nom du fichier en sortie

ntt.sounds.sound_generation.no_to_start(start_time: float, duration: float, frequency: int, filename: str)#

Generate black video whith no sound since start_time and constant frequency sound to the rest of the duration. return None if erreur

Parameters:
  • start_time (float) – start of constant sound

  • duration (float(>start_time)) – duration of the video

  • frequency (int) – frequence on constant sound

  • filename (str) – name of the video (without .mp4)

ntt.sounds.sound_generation.one_second_square_frequencies(p: float, f1: int, f2: int, filename: str)#

Generates a black video with a duration of 1 second, where p percent of the video has frequency f1, and the rest has frequency f2. The video is saved at the path: samples/filename.mp4

Parameters:
  • [0 (p (float) – 1]): Percentage of the video with frequency f1

  • [20 (f2 (int) – 20k]): Frequency in the first part of the video

  • [20 – 20k]): Frequency in the second part of the video

  • filename (str) – Name of the video (without the ‘.mp4’ extension)

ntt.sounds.sound_generation.random_to_start(start_time: float, duration: float, frequency: int, filename: str)#

Generate black video whith white sound since start_time and constant frequency sound to the rest of the duration. return None if erreur

Parameters:
  • start_time (float) – start of constant sound

  • duration (float(>start_time)) – duration of the video

  • frequency (int) – frequence on constant sound

  • filename (str) – name of the video (without .mp4)

ntt.sounds.sound_generation.vid2_decale(duration: float, decalage: float, filename: str)#

génères 2 signaux aléatoire s1 et s2. génére 2 vidéo noirs, la première a la bande sons s1 et la seconde s2 puis s1. La première video est nommée filename+”.mp4” et la seconde filename+”decale.mp4”

Parameters:
  • duration (float) – durée du signal s1

  • decalage (float) – durée du signal s2

  • filename (str) – nom du fichier en sortie