{"id":18965535,"url":"https://github.com/celliesprojects/wm8978-esp32","last_synced_at":"2025-04-19T12:55:07.307Z","repository":{"id":47439782,"uuid":"258829167","full_name":"CelliesProjects/wm8978-esp32","owner":"CelliesProjects","description":"Arduino IDE library for wm8978 dac on ESP32.","archived":false,"fork":false,"pushed_at":"2023-01-13T12:04:43.000Z","size":40,"stargazers_count":22,"open_issues_count":1,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T08:04:49.533Z","etag":null,"topics":["esp32","esp32-arduino","m5stack-node","wm8978"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CelliesProjects.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-25T17:03:21.000Z","updated_at":"2025-02-23T16:45:24.000Z","dependencies_parsed_at":"2023-02-09T15:30:28.742Z","dependency_job_id":null,"html_url":"https://github.com/CelliesProjects/wm8978-esp32","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CelliesProjects%2Fwm8978-esp32","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CelliesProjects%2Fwm8978-esp32/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CelliesProjects%2Fwm8978-esp32/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CelliesProjects%2Fwm8978-esp32/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CelliesProjects","download_url":"https://codeload.github.com/CelliesProjects/wm8978-esp32/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249207514,"owners_count":21230076,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["esp32","esp32-arduino","m5stack-node","wm8978"],"created_at":"2024-11-08T14:29:52.547Z","updated_at":"2025-04-19T12:55:07.250Z","avatar_url":"https://github.com/CelliesProjects.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wm8978-esp32\n\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/7bef2c7f6e0f4103ac73b2fea5449295)](https://www.codacy.com/gh/CelliesProjects/wm8978-esp32/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=CelliesProjects/wm8978-esp32\u0026amp;utm_campaign=Badge_Grade)\n\nArduino IDE library for wm8978 dac on ESP32 mcu. Tested/works with a M5Stack Node.\n\n### Example code:\n\n#### Setup i2c and wm8978 in one call\n\n```c++\n#include \u003cWM8978.h\u003e /* https://github.com/CelliesProjects/wm8978-esp32 */\n#include \u003cAudio.h\u003e  /* https://github.com/schreibfaul1/ESP32-audioI2S */\n\n/* M5Stack Node WM8978 I2C pins */\n#define I2C_SDA     21\n#define I2C_SCL     22\n\n/* M5Stack Node I2S pins */\n#define I2S_BCK      5\n#define I2S_WS      13\n#define I2S_DOUT     2\n#define I2S_DIN     34\n#define I2S_MCLK     0\n\nAudio audio;\nWM8978 dac;\n\nvoid setup() {\n  /* Setup wm8978 I2C interface */\n  if (!dac.begin(I2C_SDA, I2C_SCL)) {\n    log_e(\"Error setting up dac. System halted\");\n    while (1) delay(100);\n  }\n  dac.setSPKvol(40); /* max 63 */\n  dac.setHPvol(32, 32);\n\n  WiFi.begin(\"xxx\", \"xxx\");\n  while (!WiFi.isConnected()) {\n    delay(10);\n  }\n\n  /* set i2s pins */\n  audio.setPinout(I2S_BCK, I2S_WS, I2S_DOUT, I2S_DIN, I2S_MCLK);\n\n  log_i(\"Connected. Starting MP3...\");\n  audio.connecttohost(\"http://icecast.omroep.nl/3fm-bb-mp3\");\n}\n\nvoid loop() {\n  audio.loop();\n}\n\n```\n\n#### Setup i2c and wm8978 separately\n\n```c++\n#include \u003cWire.h\u003e\n#include \u003cWM8978.h\u003e /* https://github.com/CelliesProjects/wm8978-esp32 */\n#include \u003cAudio.h\u003e  /* https://github.com/schreibfaul1/ESP32-audioI2S */\n\n/* M5Stack Node WM8978 I2C pins */\n#define I2C_SDA     21\n#define I2C_SCL     22\n\n/* M5Stack Node I2S pins */\n#define I2S_BCK      5\n#define I2S_WS      13\n#define I2S_DOUT     2\n#define I2S_DIN     34\n#define I2S_MCLK     0\n\nWM8978 dac;\nAudio audio;\n\nvoid setup() {\n\n  if (!Wire.begin(I2C_SDA, I2C_SCL, 400000))\n    log_e(\"i2c setup error!\");\n\n  if (!dac.begin())\n    log_e(\"WM8978 setup error!\");\n\n  dac.setSPKvol(40); /* max 63 */\n  dac.setHPvol(32, 32);\n\n  WiFi.begin(\"xxx\", \"xxx\");\n  while (!WiFi.isConnected()) {\n    delay(10);\n  }\n\n  /* set i2s pins */\n  audio.setPinout(I2S_BCK, I2S_WS, I2S_DOUT, I2S_DIN, I2S_MCLK);\n\n  log_i(\"Connected. Starting MP3...\");\n  audio.connecttohost(\"http://icecast.omroep.nl/3fm-bb-mp3\");\n}\n\nvoid loop() {\n  audio.loop();\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcelliesprojects%2Fwm8978-esp32","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcelliesprojects%2Fwm8978-esp32","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcelliesprojects%2Fwm8978-esp32/lists"}