mirror of https://github.com/radex/radmatrix.git
audio AND video? no way!
parent
43849b1a98
commit
1fc98118de
|
@ -16,7 +16,7 @@ if len(data_in.shape)>1:
|
||||||
print("resampling...")
|
print("resampling...")
|
||||||
|
|
||||||
converter = 'sinc_best' # or 'sinc_fastest', ...
|
converter = 'sinc_best' # or 'sinc_fastest', ...
|
||||||
desired_sample_rate = 44000.0
|
desired_sample_rate = 22000.0
|
||||||
ratio = desired_sample_rate/datasamplerate
|
ratio = desired_sample_rate/datasamplerate
|
||||||
data_out = samplerate.resample(data_in, ratio, converter)
|
data_out = samplerate.resample(data_in, ratio, converter)
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
|
|
||||||
#define AUDIO_PIN 2
|
#define AUDIO_PIN 2
|
||||||
|
|
||||||
#define AUDIO_RATE 44000.0f
|
#define AUDIO_RATE 22000.0f
|
||||||
#define BUFFER_LEN 512*32
|
#define BUFFER_LEN 512*2
|
||||||
#define BUFFER_LEN_MS (BUFFER_LEN / AUDIO_RATE) * 1000.0f
|
#define BUFFER_LEN_MS (BUFFER_LEN / AUDIO_RATE) * 1000.0f
|
||||||
|
|
||||||
extern uint8_t wav_buffer_0[BUFFER_LEN];
|
extern uint8_t wav_buffer_0[BUFFER_LEN];
|
||||||
|
|
|
@ -16,6 +16,8 @@ inline void pulsePin(uint8_t pin) {
|
||||||
// there are glitches without this (maybe just due to breadboard...)
|
// there are glitches without this (maybe just due to breadboard...)
|
||||||
_NOP();
|
_NOP();
|
||||||
_NOP();
|
_NOP();
|
||||||
|
_NOP();
|
||||||
|
// busy_wait_us_32(50);
|
||||||
gpio_put(pin, LOW);
|
gpio_put(pin, LOW);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -199,7 +201,7 @@ void leds_initPusher() {
|
||||||
uint latchPin = COL_SRCLK;
|
uint latchPin = COL_SRCLK;
|
||||||
|
|
||||||
pio_sm_config config = leds_px_pusher_program_get_default_config(offset);
|
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
|
// Shift OSR to the right, autopull
|
||||||
sm_config_set_out_shift(&config, true, true, 32);
|
sm_config_set_out_shift(&config, true, true, 32);
|
||||||
|
|
|
@ -44,18 +44,18 @@ void loop() {
|
||||||
sd_loadNextAudio();
|
sd_loadNextAudio();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Serial.available() > 0) {
|
// if (Serial.available() > 0) {
|
||||||
char c = Serial.read();
|
// char c = Serial.read();
|
||||||
if (c == 'p') {
|
// if (c == 'p') {
|
||||||
Serial.println("Paused. Press any key to continue.");
|
// Serial.println("Paused. Press any key to continue.");
|
||||||
leds_disable();
|
// leds_disable();
|
||||||
while (Serial.available() == 0) {
|
// while (Serial.available() == 0) {
|
||||||
Serial.read();
|
// Serial.read();
|
||||||
delay(50);
|
// delay(50);
|
||||||
}
|
// }
|
||||||
Serial.println("Continuing...");
|
// Serial.println("Continuing...");
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (!gfx_decoder_handleLoop()) {
|
if (!gfx_decoder_handleLoop()) {
|
||||||
Serial.println("Failed to load frame...");
|
Serial.println("Failed to load frame...");
|
||||||
|
|
|
@ -44,7 +44,7 @@ void setupSD() {
|
||||||
|
|
||||||
// printSDConfig();
|
// printSDConfig();
|
||||||
|
|
||||||
if (!SD.begin(5000000, PIN_SPI_SS)) {
|
if (!SD.begin(20000000, PIN_SPI_SS)) {
|
||||||
Serial.println("SD Initialization failed!");
|
Serial.println("SD Initialization failed!");
|
||||||
// Serial.print("Error code: ");
|
// Serial.print("Error code: ");
|
||||||
// Serial.println(SD.card.errorCode(), HEX);
|
// Serial.println(SD.card.errorCode(), HEX);
|
||||||
|
|
Loading…
Reference in New Issue