2016-11-13, 02:17 AM
This simple Avisynth script converts an audio track from PAL to NTSC (or NTSC to PAL).
Required: nicaudio, to load audio files other than WAV
Optional: other audio import filters
I'd like to see it as a function, with a call like soundconvert(audioclip,"p2n"yes) or something, where "p2n" is PAL to NTSC, and yes is for pitch conversion. Any good programmer here?
Required: nicaudio, to load audio files other than WAV
Optional: other audio import filters
Code:
################################################################################
# Avysinth script
#
# Converting audio tempo and/or pitch from PAL to NTSC and from NTSC to PAL
# note: NTSC works for both NTSC (29.97) and FILM (23.976) framerates
################################################################################
# choose ONLY one line and decomment it
# there are more audio loaders for avisynth,
# but these should cover 99% of restoration needs
################################################################################
# AC3 file load
#temp=nicac3source("filename.ac3")
# DTS file load
#temp=nicdtssource("filename.dts")
# WAV file load
#temp=wavsource("filename.wav")
################################################################################
# choose ONLY one line and decomment it
################################################################################
# change NTSC to PAL tempo, NOT pitch
#aud=temp.TimeStretch(tempo=100.0*25.0/(24000.0/1001.0))
# change NTSC to PAL tempo AND pitch too
#aud=temp.TimeStretch(tempo=100.0*25.0/(24000.0/1001.0),pitch=100.0*25.0/(24000.0/1001.0))
# changes PAL to NTSC tempo, NOT pitch
#aud=temp.TimeStretch(tempo=(100.0*24000.0/1001.0)/25.000)
# change PAL to NTSC tempo AND pitch too
#aud=temp.TimeStretch(tempo=(100.0*24000.0/1001.0)/25.000,pitch=(100.0*24000.0/1001.0)/25.000)
################################################################################
# create an empty video
vid=blankclip.loop
# mux video and audio together
audiodub(vid,aud)
# trim video to be long as audio
AudioTrim(0,last.AudioDuration)
# output is a WAV fileI'd like to see it as a function, with a call like soundconvert(audioclip,"p2n"yes) or something, where "p2n" is PAL to NTSC, and yes is for pitch conversion. Any good programmer here?




![[Image: i5hq.jpg]](https://malzo.com/i/2020/04/11/i5hq.jpg)
