HISE Logo Forum
    • Categories
    • Register
    • Login

    Register audio buffer

    Scheduled Pinned Locked Moved General Questions
    3 Posts 2 Posters 228 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.
    • ustkU
      ustk
      last edited by ustk

      @Christoph-Hart Is there a way to create an audio buffer, not using an audio file or sample?

      What I want to do is:

      • Record audio in scriptnode in some way (I don't know how yet)
      • And then analyze this buffer, either in HiseScript or SNEX (but since analyzing it can't be real-time, I wonder if SNEX can be a candidate)

      So I'd like a way to use this buffer in the main script.
      I've seen the core.recorder node, but it seems that it needs an audio file first, and anyway I can't seem to record anything 🙄

      Can't help pressing F5 in the forum...

      1 Reply Last reply Reply Quote 0
      • Christoph HartC
        Christoph Hart
        last edited by

        You can process a DSP network manually using these API calls:

        // Create a network for offline processing 
        // (make sure that the script FX is bypassed)
        const var dsp = Engine.createDspNetwork("dsp") ;
        
        // manually call the initialisation
        dsp.prepareToPlay(44100.0, 512);
        
        // create a buffer array
        const var channels = [Buffer.create(512), Buffer.create(512)];
        
        // process the DSP network offline
        dsp.processBlock(channels);
        
        // Analyse the buffer
        for(s in channels[0])
              Console.print(s);
        
        ustkU 1 Reply Last reply Reply Quote 1
        • ustkU
          ustk @Christoph Hart
          last edited by

          @Christoph-Hart Simple and clever!
          But how could I trigger a recording from the interface (via scriptFX or scriptnode) and pass the result to these buffers to then trigger an analysis?

          Can't help pressing F5 in the forum...

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

          27

          Online

          1.8k

          Users

          12.0k

          Topics

          104.2k

          Posts