{"id":16239817,"url":"https://github.com/nopnop2002/esp-idf-a2dp-source","last_synced_at":"2025-03-19T16:31:41.818Z","repository":{"id":108987695,"uuid":"339051245","full_name":"nopnop2002/esp-idf-a2dp-source","owner":"nopnop2002","description":"ESP32 Bluetooth A2DP-SOURCE for esp-idf","archived":false,"fork":false,"pushed_at":"2024-11-02T08:19:24.000Z","size":10552,"stargazers_count":18,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-28T19:53:26.167Z","etag":null,"topics":["a2dp-source","bluetooth","esp-idf","esp32","speaker","wav-files"],"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/nopnop2002.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-15T11:09:43.000Z","updated_at":"2025-01-20T13:06:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"6e7ff416-62f4-4d04-a33e-35c357e4e1da","html_url":"https://github.com/nopnop2002/esp-idf-a2dp-source","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2Fesp-idf-a2dp-source","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2Fesp-idf-a2dp-source/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2Fesp-idf-a2dp-source/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2Fesp-idf-a2dp-source/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nopnop2002","download_url":"https://codeload.github.com/nopnop2002/esp-idf-a2dp-source/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244006277,"owners_count":20382444,"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":["a2dp-source","bluetooth","esp-idf","esp32","speaker","wav-files"],"created_at":"2024-10-10T13:45:14.792Z","updated_at":"2025-03-19T16:31:41.813Z","avatar_url":"https://github.com/nopnop2002.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# esp-idf-a2dp-source\nESP32 Bluetooth A2DP-SOURCE for esp-idf.   \nPlay wav to speaker via bluetooth.   \n\n# Background   \nESP-IDF contains A2DP-SOURCE demo code.   \nhttps://github.com/espressif/esp-idf/tree/master/examples/bluetooth/bluedroid/classic_bt/a2dp_source\n\nHowever, this example sends random noise data, not music.   \nThis project sends WAV(RIFF waveform Audio Format) data using A2DP.   \nYou can listen WAV data using your bluetooth speaker.   \n\n# Changes from the referenced code   \nI used [this](https://github.com/admiralmaggie/esp32_bt_source) as a reference.   \n- You can specify your speaker name using menuconfig.   \n- WAV data is defined as hexadecimal data.   \n This reduces the size of the header file.   \n- A header file generator is attached.   \n\n# Software requirement    \nESP-IDF V5.0 or later.   \nESP-IDF V4.4 release branch reached EOL in July 2024.   \n\n# Hardware requirement    \nBluetooth speaker\n\n# Installation\n```\ngit clone https://github.com/nopnop2002/esp-idf-a2dp-source\ncd esp-idf-a2dp-source\nidf.py set-target esp32\nidf.py menuconfig\nidf.py flash monitor\n```\n\n# Configure\nYou have to set this config value with menuconfig.   \n- CONFIG_SPEAKER_NAME   \nYour bluetooth speaker name.   \n![config-main](https://user-images.githubusercontent.com/6020549/107940288-5c267300-6fcb-11eb-9323-dd8a6cf77c9a.jpg)\n![config-app](https://user-images.githubusercontent.com/6020549/107940298-5e88cd00-6fcb-11eb-8c4a-28639db1df96.jpg)   \n\nYou can use [this](https://github.com/espressif/esp-idf/tree/master/examples/bluetooth/bluedroid/classic_bt/bt_discovery) to find the name of your Bluetooth speaker.   \n```\nI (0) cpu_start: Starting scheduler on APP CPU.\nI (547) BTDM_INIT: BT controller compile version [7972edf]\nI (547) system_api: Base MAC address is not set\nI (547) system_api: read default base MAC address from EFUSE\nI (557) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07\nI (1247) GAP: Discovery started.\nI (3847) GAP: Device found: 54:14:8e:38:a8:28\nI (3847) GAP: --Class of Device: 0x340404\nI (3847) GAP: --RSSI: -57\nI (3847) GAP: Found a target device, address 54:14:8e:38:a8:28, name TG-117 --\u003e This is your speaker\nI (3857) GAP: Cancel device discovery ...\nI (3867) GAP: Device found: 54:14:8e:38:a8:28\nI (3867) GAP: --Class of Device: 0x340404\nI (3877) GAP: --RSSI: -56\nI (3877) GAP: Device discovery stopped.\nI (3877) GAP: Discover services ...\nI (5337) GAP: Services for device 54:14:8e:38:a8:28 found\nI (5337) GAP: --1101\nI (5337) GAP: --111e\nI (5337) GAP: --110b\nI (5337) GAP: --110e\n```\n\n# Convert WAV file to C header format   \nIt is necessary to read the WAV file at high speed.   \nIf you put the WAV file in SPIFFS and read it, it will not be in time.   \nIt can be read at high speed by converting it to the C language header format.   \nI made this program with reference to [this](https://blog.goo.ne.jp/lm324/e/ca93257fc9861a07bb6b8f27caa7d382) site.   \n\n```\ncd wav2code\nmake\n./wav2code futta-prayer3t.wav music.h\ncp music.h ../main/\ncd ..\nidf.py flash monitor\n```\n\n# Free WAV file   \nI downloaded the WAV file from [here](https://music.futta.net/mp3.html).   \nThere is many WAV format data in the Internet.   \n\n# Limitations   \nThe WAV file header has an average number of bytes per second.   \nThis determines the speed at which it plays.   \nThis project ignores this.   \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnopnop2002%2Fesp-idf-a2dp-source","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnopnop2002%2Fesp-idf-a2dp-source","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnopnop2002%2Fesp-idf-a2dp-source/lists"}