Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#493 Audio slowdown/speedup encoding options

2
closed
nobody
None
5
2013-08-13
2012-10-23
Marshall
No

MeGUI has options to speed-up or slow-down sound. Unfortunately it doesn't fix the pitch.
When MeGUI creates a temporary AVS script for the sound encoding, I wish it would also
add the TimeStretch(pitch=xyz) command, so the sound doesn't become deeper or higher
when stretching the length.

Discussion

  • Marshall
    Marshall
    2012-10-24

    Something like this might help:

    # Speed-up (23.976 to 25)
    ARsource = AudioRate()
    ARnew = (ARsource*1001+480)/960
    AssumeSampleRate(ARnew).SSRC(ARsource)
    TimeStretch(pitch=Float(ARnew)*100.0/Float(ARsource))

    # Slow-down (25 to 23.976)
    ARsource = AudioRate()
    ARnew = (ARsource*1001+480)/960
    SSRC(ARnew).AssumeSampleRate(ARsource)
    TimeStretch(pitch=Float(ARnew)*100.0/Float(ARsource))

    # Speed-up (24 to 25)
    ARsource = AudioRate()
    ARnew = (AudioRate()*25)/24
    AssumeSampleRate(ARnew).SSRC(ARsource)
    TimeStretch(pitch=Float(ARnew)*100.0/Float(ARsource))

    # Slow-down (25 to 24)
    ARsource = AudioRate()
    ARnew = (AudioRate()*25)/24
    SSRC(ARnew).AssumeSampleRate(ARsource)
    TimeStretch(pitch=Float(ARnew)*100.0/Float(ARsource))

     
  • Marshall
    Marshall
    2012-11-24

    The above in a single function:

    function myFunction(clip c, string "mode") {
    ARsource = AudioRate(c)
    ARnew = mode=="25->23.976" || mode=="23.976->25" ? (ARsource*1001+480)/960 : \ mode=="25->24" || mode=="24->25" ? (ARsource*25)/24 : NOP
    c = mode=="24->25" || mode=="23.976->25" ? c.AssumeSampleRate(ARnew).SSRC(ARsource) : \ mode=="25->24" || mode=="25->23.976" ? c.SSRC(ARnew).AssumeSampleRate(ARsource) : NOP
    return c.TimeStretch(pitch=Float(ARnew)*100.0/Float(ARsource))
    }

     
  • Kurtnoise
    Kurtnoise
    2013-08-13

    • status: open --> closed
    • Group: --> 2
     
  • Kurtnoise
    Kurtnoise
    2013-08-13

    Done in revision 2983