commit 1ee2fa51d96645ac277e2fa41a776a4d8ae437c9 parent c4b42627db2e474a3561855724bedcaa711d3264 Author: rbckman <robinbackman@gmail.com> Date: Sat, 25 Nov 2017 06:28:36 +0000 fade sound 10ms in beginning and end Diffstat:
M | tarina.py | | | 6 | +++++- |
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tarina.py b/tarina.py @@ -909,8 +909,12 @@ def audiodelay(foldername, filename): if int(audiolenght) > int(videolenght): #calculate difference audiosync = int(audiolenght) - int(videolenght) + newaudiolenght = int(audiolenght) - audiosync print('Audiofile is: ' + str(audiosync) + 'ms longer') - os.system('sox /dev/shm/' + filename + '.wav ' + foldername + filename + '.wav trim 0 -0.' + str(audiosync).zfill(3)) + #trim from end and put a 0.005 in- and outfade + os.system('sox /dev/shm/' + filename + '.wav ' + foldername + filename + '_temp.wav trim 0 -0.' + str(audiosync).zfill(3)) + os.system('sox -G ' + foldername + filename + '_temp.wav ' + foldername + filename + '.wav fade 0.01 0 0.01') + os.system('rm ' + foldername + filename + '_temp.wav ') else: #calculate difference audiosyncs = videos - audios