AssumeSampleRate

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
m (added category)
(formatting, links, phrasing)
Line 1: Line 1:
{{Template:FuncDef|AssumeSampleRate(clip ''clip'', samplerate ''int'')}}
+
{{Template:FuncDef|AssumeSampleRate(clip ''clip'', int ''samplerate'')}}
  
AssumeSampleRate (exists starting from v2.07) changes the sample rate (playback speed) of the current sample. If used alone, it will cause desync with the video.  
+
Changes the sample rate of the current clip without changing the number of samples.  
 +
:This changes the pitch, playback speed and running time of the audio.
 +
:It will also affect synchronization with the video.  
  
'''Examples:'''
+
==== Examples ====
 
+
<div {{BoxWidthIndent|38|1}} >
  # Let's say that this video is 25fps, 44100hz video clip.
+
  # Let's say that this video is 25fps, audio 44100hz.
  AviSource("video_audio.avi")
+
  [[AviSource]]("video_audio.avi")
 +
 +
# Play video at half speed:
 +
[[AssumeFPS]]([[Clip_properties|FrameRate]]/2)
 
   
 
   
 
  # Play audio at half speed:
 
  # Play audio at half speed:
  AssumeSampleRate(22050)  
+
  AssumeSampleRate([[Clip_properties|AudioRate]]/2)   
   
+
# Play video at half speed:
+
AssumeFPS(12.5)
+
 
   
 
   
  # Video and audio is now in sync, and plays in slow-motion.
+
  # Video and audio are now in sync.
 +
</div>
  
 +
==== See Also ====
 +
* [[AssumeFPS]]: {{FuncArg|''sync_audio''}}
 +
:If ''true'', the audio sample rate is changed by the same amount; the pitch of the resulting audio is shifted.
 +
:If ''false'' (the default), the audio is unchanged; this means the audio will lose synchronization over time.
  
 
[[Category:Internal filters]]
 
[[Category:Internal filters]]
 
[[Category:Audio_filters]]
 
[[Category:Audio_filters]]
 +
[[Category:Timeline_editing_filters]]

Revision as of 13:31, 14 January 2016

AssumeSampleRate(clip clip, int samplerate)

Changes the sample rate of the current clip without changing the number of samples.

This changes the pitch, playback speed and running time of the audio.
It will also affect synchronization with the video.

Examples

# Let's say that this video is 25fps, audio 44100hz.
AviSource("video_audio.avi")

# Play video at half speed:
AssumeFPS(FrameRate/2)

# Play audio at half speed:
AssumeSampleRate(AudioRate/2)  

# Video and audio are now in sync.

See Also

If true, the audio sample rate is changed by the same amount; the pitch of the resulting audio is shifted.
If false (the default), the audio is unchanged; this means the audio will lose synchronization over time.
Personal tools