Forum

    • Register
    • Login
    • Search
    • Categories

    where to grab Engine.getSampleRate() ?

    General Questions
    3
    6
    35
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Dan Korneff
      Dan Korneff last edited by

      I'm working on a convolution project that loads audiofiles based on the host sample rate.
      Placing Engine.getSampleRate() on init retuns a value of -1 because it's initialized before the samplerate is queried.
      In the past, I've placed the getSampleRate function inside PrepareToPlay of a scriptFX, and this works fine.
      This project is using a compiled scriptnode dll and I'm throwing that into a HardcodedFX module so I'm thinking there's a better way to do this. What would you do?

      Dan Korneff - Producer / Mixer / Audio Nerd

      Christoph Hart 1 Reply Last reply Reply Quote 0
      • Christoph Hart
        Christoph Hart @Dan Korneff last edited by

        @Dan-Korneff the prepare callback of a script fx (without a network).

        Dan Korneff 1 Reply Last reply Reply Quote 1
        • Dan Korneff
          Dan Korneff @Christoph Hart last edited by

          @Christoph-Hart global variable , right?

          Dan Korneff - Producer / Mixer / Audio Nerd

          ustk 1 Reply Last reply Reply Quote 0
          • ustk
            ustk @Dan Korneff last edited by

            @Dan-Korneff yeah that's what I do

            I can't help pressing F5 in the forum...

            Christoph Hart 1 Reply Last reply Reply Quote 1
            • Christoph Hart
              Christoph Hart @ustk last edited by

              yup that's one of the good occasions of using global variables.

              I could add a broadcaster source that listens to audio spec changes, then you could just attach it inside the main script and wouldn't need to add a script FX only for this.

              Dan Korneff 1 Reply Last reply Reply Quote 3
              • Dan Korneff
                Dan Korneff @Christoph Hart last edited by

                @Christoph-Hart giphy.gif

                Dan Korneff - Producer / Mixer / Audio Nerd

                1 Reply Last reply Reply Quote 1
                • First post
                  Last post

                7
                Online

                1.1k
                Users

                6.8k
                Topics

                62.1k
                Posts