Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 7 of 7

Thread: How to change AUDIO_BLOCK_SAMPLES?

  1. #1
    Junior Member
    Join Date
    Jan 2019
    Posts
    7

    How to change AUDIO_BLOCK_SAMPLES?

    Hi,

    I've seen some posts that changing AUDIO_BLOCK_SAMPLES in AudioStream is possible, but I'm not exactly sure on how to do it. It involves deleting and cloning cores in Teensyduino?

    I'm a bit of a newbie and any help would be much appreciated!

    (Also, I'm using a Mac with Arduino IDE 1.8.7 and Teensyduino 1.45)

  2. #2
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,146
    Quote Originally Posted by Tibbar View Post
    Hi,

    I've seen some posts that changing AUDIO_BLOCK_SAMPLES in AudioStream is possible, but I'm not exactly sure on how to do it. It involves deleting and cloning cores in Teensyduino?

    I'm a bit of a newbie and any help would be much appreciated!

    (Also, I'm using a Mac with Arduino IDE 1.8.7 and Teensyduino 1.45)
    you simply change the number in AudioStream, and force a complete recompile by changing any tools-menu item (e.g changing CPU speed ot Optimize option)

  3. #3
    Junior Member
    Join Date
    Jan 2019
    Posts
    7
    Yeah but where exactly is AudioStream.h? I can't find it in the libs and have read that its in the core, but can find that either.

  4. #4
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    8,321
    I found it here:

    Code:
    ...\hardware\teensy\avr\cores\teensy3\AudioStream.h:
       38  #endif
       39  
       40: // AUDIO_BLOCK_SAMPLES determines how many samples the audio library processes
       41  // per update.  It may be reduced to achieve lower latency response to events,
       42  // at the expense of higher interrupt and DMA setup overhead.
       ..
       50  #ifndef AUDIO_BLOCK_SAMPLES
       51  #if defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__)
       52: #define AUDIO_BLOCK_SAMPLES  128
       53  #elif defined(__MKL26Z64__)
       54: #define AUDIO_BLOCK_SAMPLES  64
       55  #endif
       56  #endif

  5. #5
    Junior Member
    Join Date
    Jan 2019
    Posts
    7
    Is that on a Mac? I can't actually seem to find AudioStream.h at all!

  6. #6
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,380
    Man... Open the applications folder on your Mac, right click on the Arduino app icon, select "show package contents". Then navigate through Contents -> Java. From there, follow the path which defragster indicated.

  7. #7
    Junior Member
    Join Date
    Jan 2019
    Posts
    7
    Ok, the Contents -> Java part. In Contents there should be a folder called Java?

    Sorry if I'm asking dumb questions. I am a total noob though.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •