Hi,
I had reduced AUDIO_BLOCK_SAMPLES to 32 previously to reduce latency in an audio project and it worked perfectly (and significantly reduced the latency). That was using a Teensy 4.0 with audio shield using the latest version of Teensyduino available in September 2019. There were no problems. I've now done the same thing using version 1.52 (Arduino with a Teensy 4.1 with USB audio output and it is not working. This shows what is happening to a 220 Hz sine wave - the frequency is correct.
I don't have access to the other hardware to test it. The problem is happening with all audio source types. You can test it with the simplest code:
I had reduced AUDIO_BLOCK_SAMPLES to 32 previously to reduce latency in an audio project and it worked perfectly (and significantly reduced the latency). That was using a Teensy 4.0 with audio shield using the latest version of Teensyduino available in September 2019. There were no problems. I've now done the same thing using version 1.52 (Arduino with a Teensy 4.1 with USB audio output and it is not working. This shows what is happening to a 220 Hz sine wave - the frequency is correct.
I don't have access to the other hardware to test it. The problem is happening with all audio source types. You can test it with the simplest code:
Code:
[FONT=Verdana]#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>[/FONT][FONT=Verdana]
[/FONT]
[FONT=Verdana]AudioSynthWaveformSine sine1; //xy=235,197
AudioOutputI2S i2s1; //xy=405,161
AudioOutputUSB usb1; //xy=427,231
AudioConnection patchCord1(sine1, 0, i2s1, 1);
AudioConnection patchCord2(sine1, 0, i2s1, 0);
AudioConnection patchCord3(sine1, 0, usb1, 0);
AudioConnection patchCord4(sine1, 0, usb1, 1);
[/FONT]
[FONT=Verdana]void setup() {
AudioMemory(20);
sine1.frequency(220);
}
[/FONT]
[FONT=Verdana]void loop() {
[/FONT]
[FONT=Verdana]}[/FONT]