maharshioza
New member
I am working on some voice recognition based projects and my machine learning model only accepting 16khz sample rate data(Model limitations).
This code is to send audio from analog pin to USB and it is working perfectly.
Now the query is, whenever I change Sample rate frequency from 44100 to 16000 according to this thread
streaming of sound stopped working.
So can someone help to find a solution for transmitting sound from analog pin to USB at the 16khz sample rate?
Thank you for your support.
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioInputAnalog adc1; //xy=133,142
AudioEffectBitcrusher bitcrusher1; //xy=354,165
AudioOutputUSB usb1; //xy=605,218
AudioConnection patchCord1(adc1, bitcrusher1);
AudioConnection patchCord2(bitcrusher1, 0, usb1, 1);
AudioConnection patchCord3(bitcrusher1, 0, usb1, 0);
// GUItool: end automatically generated code
int current_CrushBits = 16; //this defaults to passthrough.
int current_SampleRate = 16000; // this defaults to passthrough.
void setup() {
delay(1000);
Serial.begin(9600);
AudioMemory(8);
bitcrusher1.bits(current_SampleRate);
bitcrusher1.sampleRate(current_SampleRate);
}
void loop() {
}
This code is to send audio from analog pin to USB and it is working perfectly.
Now the query is, whenever I change Sample rate frequency from 44100 to 16000 according to this thread
streaming of sound stopped working.
So can someone help to find a solution for transmitting sound from analog pin to USB at the 16khz sample rate?
Thank you for your support.