Skip to content

Commit 13be729

Browse files
committed
Update to the latest version of ModPlayer library
1 parent 8985370 commit 13be729

File tree

5 files changed

+17
-11
lines changed

5 files changed

+17
-11
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
.idea/
22

33
build/
4-
cmake-build-*/
4+
cmake-build*/
5+
dist/
56

67
managed_components/
78
dependencies.lock

examples/mod-player/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The example leverages the `esp32-mod-player` component, which integrates the [Mo
2323
2. **Flash the example** to your ESP32 device:
2424

2525
```bash
26-
idf.py -p /dev/ttyUSB0 flash monitor
26+
idf.py -p /dev/ttyUSB0 -b 921600 flash monitor
2727
```
2828

2929
> Replace `/dev/ttyUSB0` with the port your ESP32 is connected to.

examples/mod-player/main/main.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ void i2s_fill_buffer(void* audioBuffer, size_t len)
3030
auto volumeFactor = 0.06f;
3131

3232
for (size_t i = 0; i < samples; ++i) {
33-
buffer[i] = static_cast<int16_t>(module.getFrame() * volumeFactor);
33+
buffer[i] = static_cast<int16_t>(module.getSample() * volumeFactor);
3434
}
3535
}
3636

@@ -67,7 +67,7 @@ extern "C" void app_main()
6767

6868
i2s_chan_handle_t channel;
6969
i2s_chan_config_t channelConfig = I2S_CHANNEL_DEFAULT_CONFIG(I2S_NUM_AUTO, I2S_ROLE_MASTER);
70-
channelConfig.dma_frame_num = 2048;
70+
channelConfig.dma_frame_num = 1024;
7171
ESP_ERROR_CHECK(i2s_new_channel(&channelConfig, &channel, nullptr));
7272

7373
i2s_std_config_t stdConfig = {
@@ -88,10 +88,10 @@ extern "C" void app_main()
8888
.msb_right = false
8989
},
9090
.gpio_cfg = {
91-
.mclk = GPIO_NUM_0,
92-
.bclk = GPIO_NUM_26,
93-
.ws = GPIO_NUM_25,
94-
.dout = GPIO_NUM_22,
91+
.mclk = GPIO_NUM_NC,
92+
.bclk = GPIO_NUM_14,
93+
.ws = GPIO_NUM_15,
94+
.dout = GPIO_NUM_13,
9595
.din = I2S_GPIO_UNUSED,
9696
.invert_flags = {
9797
.mclk_inv = 0,

idf_component.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
version: "0.0.1"
1+
version: "0.0.2"
22
description: "ESP32 MOD Player"
33
url: "https://github.com/realsba/esp32-mod-player"
44
license: "MIT"
55
dependencies:
66
idf:
7-
version: "^5.4.0"
7+
version: "^5.4.0"
8+
files:
9+
exclude:
10+
- "**/build/**/*"
11+
- "**/cmake-build*/**/*"
12+
- "examples/**/spiffs.bin"

0 commit comments

Comments
 (0)