Hallo liebes Mikrocontroller Team! Ich bin Student an einer Uni und ich will als Übung für zuhause mithilfe eines SMT32 Programmes von einer Hardware eine Stimmaufnahme von mir verlangsamen und schneller machen! Die Frage ist , wie bzw wo muss ich die Sample Rate erhöhen bzw verringern um das zu erreichen? ich habe schon überall rumgespielt aber es is noch nix gutes rausgekommen. A Villeicht habt ihr eine idee! Ich danke schön einmal im vorhinein! hier ist noch der code:
1 | #include "stm32_init.h" |
2 | |
3 | void SPI2_IRQHandler() |
4 | {
|
5 | int16_t left_out_sample = 0; |
6 | int16_t right_out_sample = 0; |
7 | int16_t left_in_sample = 0; |
8 | int16_t right_in_sample = 0; |
9 | |
10 | GPIO_ToggleBits(GPIOD, GPIO_Pin_15); |
11 | |
12 | if (SPI_I2S_GetFlagStatus(I2Sx, I2S_FLAG_CHSIDE) == SET) |
13 | {
|
14 | left_in_sample = SPI_I2S_ReceiveData(I2Sx); |
15 | left_out_sample = left_in_sample; |
16 | while (SPI_I2S_GetFlagStatus(I2Sxext, SPI_I2S_FLAG_TXE ) != SET){} |
17 | SPI_I2S_SendData(I2Sxext, left_out_sample); |
18 | |
19 | }
|
20 | else
|
21 | {
|
22 | right_in_sample = SPI_I2S_ReceiveData(I2Sx); |
23 | right_out_sample = right_in_sample; |
24 | while (SPI_I2S_GetFlagStatus(I2Sxext, SPI_I2S_FLAG_TXE ) != SET){} |
25 | SPI_I2S_SendData(I2Sxext, right_out_sample); |
26 | }
|
27 | }
|
28 | |
29 | int main(void) |
30 | {
|
31 | stm32_wm_init(FS_48000_HZ, WM_DMIC_IN, IO_METHOD_INTR); |
32 | while(1){} |
33 | }
|
PS: ich programmiere mit Keil uvision 5 Liebe grüße!
