HISE Logo Forum
    • Categories
    • Register
    • Login

    Settings.getCurrentSampeRate() seems to be crashing the DAW...on load

    Scheduled Pinned Locked Moved General Questions
    4 Posts 2 Posters 70 Views
    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.
    • LindonL
      Lindon
      last edited by

      So I'm trying to get the current sample rate for my plugin , so:

      const var SampleRateLabel = Content.getComponent("SampleRateLabel");
      
      inline function onSampleRateBtnControl(component, value)
      {
      	SampleRateLabel.set("text","Sample rate: " + Settings.getCurrentSampleRate());
      };
      Content.getComponent("SampleRateBtn").setControlCallback(onSampleRateBtnControl);
      

      Adding this code crashes the DAW on start up....

      Perhaps this is because "Settings" isnt initialised yet??

      How is everyone else getting the Sample rate?

      HISE Development for hire.
      www.channelrobot.com

      d.healeyD 1 Reply Last reply Reply Quote 0
      • d.healeyD
        d.healey @Lindon
        last edited by d.healey

        @Lindon What about Engine.getSampleRate()?

        If it's in a plugin then you should get -1 as the audio is handled by the host:

        96c6e368-5a05-4647-a72f-24d5079220b6-image.png

        Libre Wave - Freedom respecting instruments and effects
        My Patreon - HISE tutorials
        YouTube Channel - Public HISE tutorials

        LindonL 1 Reply Last reply Reply Quote 0
        • LindonL
          Lindon @d.healey
          last edited by Lindon

          @d-healey so its an FX plugin with IRs used extensively to model the hardware - and the level output is very dependent upon the current sample rate being used by the DAW, so I need to know the currentSample rate - as used by the DAW - So I will try Engine.getSampleRate() and see if that works...

          HISE Development for hire.
          www.channelrobot.com

          LindonL 1 Reply Last reply Reply Quote 1
          • LindonL
            Lindon @Lindon
            last edited by

            @d-healey

            -- thanks Dave, that works fine...

            HISE Development for hire.
            www.channelrobot.com

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

            47

            Online

            1.7k

            Users

            11.7k

            Topics

            101.8k

            Posts