1
0
Fork 0

audio AND video? no way!

sd2
radex 2024-05-25 12:06:50 +02:00
parent 43849b1a98
commit 1fc98118de
Signed by: radex
SSH Key Fingerprint: SHA256:hvqRXAGG1h89yqnS+cyFTLKQbzjWD4uXIqw7Y+0ws30
5 changed files with 19 additions and 17 deletions

View File

@ -16,7 +16,7 @@ if len(data_in.shape)>1:
print("resampling...")
converter = 'sinc_best' # or 'sinc_fastest', ...
desired_sample_rate = 44000.0
desired_sample_rate = 22000.0
ratio = desired_sample_rate/datasamplerate
data_out = samplerate.resample(data_in, ratio, converter)

View File

@ -5,8 +5,8 @@
#define AUDIO_PIN 2
#define AUDIO_RATE 44000.0f
#define BUFFER_LEN 512*32
#define AUDIO_RATE 22000.0f
#define BUFFER_LEN 512*2
#define BUFFER_LEN_MS (BUFFER_LEN / AUDIO_RATE) * 1000.0f
extern uint8_t wav_buffer_0[BUFFER_LEN];

View File

@ -16,6 +16,8 @@ inline void pulsePin(uint8_t pin) {
// there are glitches without this (maybe just due to breadboard...)
_NOP();
_NOP();
_NOP();
// busy_wait_us_32(50);
gpio_put(pin, LOW);
}
@ -199,7 +201,7 @@ void leds_initPusher() {
uint latchPin = COL_SRCLK;
pio_sm_config config = leds_px_pusher_program_get_default_config(offset);
sm_config_set_clkdiv_int_frac(&config, 1, 0);
sm_config_set_clkdiv_int_frac(&config, 2, 0);
// Shift OSR to the right, autopull
sm_config_set_out_shift(&config, true, true, 32);

View File

@ -44,18 +44,18 @@ void loop() {
sd_loadNextAudio();
}
if (Serial.available() > 0) {
char c = Serial.read();
if (c == 'p') {
Serial.println("Paused. Press any key to continue.");
leds_disable();
while (Serial.available() == 0) {
Serial.read();
delay(50);
}
Serial.println("Continuing...");
}
}
// if (Serial.available() > 0) {
// char c = Serial.read();
// if (c == 'p') {
// Serial.println("Paused. Press any key to continue.");
// leds_disable();
// while (Serial.available() == 0) {
// Serial.read();
// delay(50);
// }
// Serial.println("Continuing...");
// }
// }
if (!gfx_decoder_handleLoop()) {
Serial.println("Failed to load frame...");

View File

@ -44,7 +44,7 @@ void setupSD() {
// printSDConfig();
if (!SD.begin(5000000, PIN_SPI_SS)) {
if (!SD.begin(20000000, PIN_SPI_SS)) {
Serial.println("SD Initialization failed!");
// Serial.print("Error code: ");
// Serial.println(SD.card.errorCode(), HEX);