Created
June 14, 2012 21:54
-
-
Save finnp/2933216 to your computer and use it in GitHub Desktop.
Praat script for Synchronizing audios
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
video = selected ("Sound", 1) | |
audio = selected ("Sound", 2) | |
select video | |
maxvideo = Get time of maximum... 0 0 none | |
select audio | |
maxaudio = Get time of maximum... 0 0 none | |
audioend = Get end time | |
sf = Get sampling frequency | |
printline | |
printline Video-Clap: 'maxvideo' Sekunden | |
printline Audio-Clap: 'maxaudio' Sekunden | |
if maxaudio > maxvideo | |
diff = maxaudio - maxvideo | |
printline Audio-Clap kommt später | |
printline => Schneide am Audio etwas weg | |
Extract part... 'diff' 'audioend' Rectangular 1.0 no | |
Rename... SynchronisiertesAudio | |
plus video | |
Combine to stereo | |
Rename... KontrollAudioStereo | |
else | |
diff = maxvideo - maxaudio | |
printline Video-Clap kommt später | |
printline => Füge Silent vorne ans Audio an | |
Create Sound... silent 0 'diff' 'sf' 0 | |
select audio | |
Copy... temp | |
plus Sound silent | |
Concatenate | |
Rename... SynchronisiertesAudio | |
plus video | |
Combine to stereo | |
Rename... KontrollAudioStereo | |
select Sound temp | |
plus Sound silent | |
Remove | |
endif | |
printline Differenz: 'diff' Sekunden | |
plus video |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I wrote this Praat script for automatically synchronize the audio of a video and the audio of a microphone. It is essential that you can hear a clap (for example with a movie clapper) in both of the audios. Both audios also need to be mono.