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

Thread: Cracks instead of delay

  1. #1

    Cracks instead of delay

    I have a Teensy 3.6 with the Audio Shield and RAM (23LC1024T-I/SN 全新芯片SOIC8IC SRAM 1M SPI 20MHZ 8SOIC):

    Click image for larger version. 

Name:	setup.jpg 
Views:	4 
Size:	151.5 KB 
ID:	19326
    Click image for larger version. 

Name:	RAM.jpg 
Views:	2 
Size:	180.8 KB 
ID:	19327

    When I delay the microphone input, I hear cracks if the delay is greater than about 10. Is this is a hardware issue, or am I missing something?

    The sketch:

    Click image for larger version. 

Name:	delay.png 
Views:	0 
Size:	12.9 KB 
ID:	19325

    Code:
    #include <Audio.h>
    #include <Wire.h>
    #include <SPI.h>
    #include <SD.h>
    #include <SerialFlash.h>
    
    // GUItool: begin automatically generated code
    AudioInputI2S            i2s1;           //xy=194.00004196166992,333.00004959106445
    AudioEffectDelay         delay1;         //xy=454,324
    AudioOutputI2S           i2s2;           //xy=639.000020980835,284.00000953674316
    AudioConnection          patchCord1(i2s1, 0, delay1, 0);
    AudioConnection          patchCord2(delay1, 0, i2s2, 0);
    // GUItool: end automatically generated code
    
    AudioControlSGTL5000 audioShield;
    
    const int myInput = AUDIO_INPUT_MIC;
    
    void setup() {
      AudioMemory(10);
      audioShield.enable();
      audioShield.volume(0.7);
      delay(1000);
      audioShield.inputSelect(myInput);
      audioShield.micGain(24);
    }
    
    void loop() {
      delay1.delay(0, 100); // with delay up to ~10, the sound is clean
      delay(500);
    }

  2. #2
    Senior Member
    Join Date
    Feb 2015
    Posts
    213
    From the notes in the GUI tool:

    "Memory for the delayed signal is take from the memory pool allocated by AudioMemory(). Each block allows about 2.9 milliseconds of delay, so AudioMemory should be increased to allow for the longest delay tap."

    Also if you are wanting to use the SRAM for the delay, you need to use the delayExt object.

  3. #3
    Quote Originally Posted by wcalvert View Post
    From the notes in the GUI tool:

    "Memory for the delayed signal is take from the memory pool allocated by AudioMemory(). Each block allows about 2.9 milliseconds of delay, so AudioMemory should be increased to allow for the longest delay tap."
    Thanks, that's it! Sorry for not reading the documentation thoroughly. I was following Paul's video Teensy Audio Library, Delay Line Demo with (0:27):
    Code:
    AudioMemory(10);
    Also if you are wanting to use the SRAM for the delay, you need to use the delayExt object.
    What RAM is my sketch then using? Also, what is the advantage of using SRAM?

  4. #4
    Senior Member
    Join Date
    Feb 2015
    Posts
    213
    Each audio object by default uses the processor's internal RAM. The audio objects have to be specially hand-coded to take advantage of external SRAM. The large external SRAM would allow for longer delay times than the internal RAM could support.

  5. #5
    Thank you! Well I only need 500 ms of delay, and the sketch is small, so I guess getting the RAM was superfluous.

    Anyhow, I added a comment to the aforementioned YouTube video, which may be helpful for others.

Posting Permissions

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