Comments (3)
try add:
BluetoothA2DPSink.h:
public:
virtual void set_AVRC_metadata(void (*callBack)(uint8_t, const uint8_t*));
protected:
void (*AVRC_metadata)(uint8_t, const uint8_t*) = NULL;
BluetoothA2DPSink.cpp
void BluetoothA2DPSink::set_AVRC_metadata(void (*callBack)(uint8_t, const uint8_t*)){
this->AVRC_metadata = callBack;
}
and replace:
ESP32-A2DP/src/BluetoothA2DPSink.cpp
Lines 458 to 462 in 1da3995
case ESP_AVRC_CT_METADATA_RSP_EVT: {
if (AVRC_metadata!=NULL){
AVRC_metadata(rc->meta_rsp.attr_id, rc->meta_rsp.attr_text);
}
ESP_LOGI(BT_AV_TAG, "AVRC metadata rsp: attribute id 0x%x, %s", rc->meta_rsp.attr_id, rc->meta_rsp.attr_text);
free(rc->meta_rsp.attr_text);
break;
}
and in project:
void avrc_metadata_callback(uint8_t data1, const uint8_t *data2)
{
Serial.printf("AVRC metadata rsp: attribute id 0x%x, %s\n", data1, data2);
}
a2dp_sink.set_AVRC_metadata(avrc_metadata_callback);
a2dp_sink.start("BT");
from esp32-a2dp.
@lukasilestam
thanks a lot !
I got it and successed
ESP_LOGD(BT_AV_TAG, "%s", func);
//Register notifications and request metadata
esp_avrc_ct_send_metadata_cmd(0, ESP_AVRC_MD_ATTR_TITLE | ESP_AVRC_MD_ATTR_ARTIST | ESP_AVRC_MD_ATTR_ALBUM | ESP_AVRC_MD_ATTR_GENRE | ESP_AVRC_MD_ATTR_PLAYING_TIME);//
esp_avrc_ct_send_register_notification_cmd(1, ESP_AVRC_RN_TRACK_CHANGE, 0);
and I added "ESP_AVRC_MD_ATTR_PLAYING_TIME"
from esp32-a2dp.
I have add this logic to the basic code.
Please note that the method to register the callback is called:
a2dp_sink.set_avrc_metadata_callback
from esp32-a2dp.
Related Issues (20)
- 'I2S' was not declared in this scope HOT 1
- ESP32-A1S github examples HOT 1
- default AVRCP raises volume instead of lowering if volume is below ~128 HOT 12
- PCM5102A Lots of different types of noise (clicking, high frequency, low frequency) HOT 18
- Sending music from Atom Echo (ESP32) to Ubuntu VM. HOT 2
- insufficient storage space HOT 1
- Reboot/Crash after Pause command HOT 15
- Double metadata notifications response on provoked track change HOT 1
- Audio state starts with 'playing', but no Bluetooth Connection exist HOT 2
- Freezes on init_bluetooth(): [BT_AV] init_bluetooth HOT 6
- Cant upload sketch to esp32 HOT 2
- Arduino print not writw data and stuck in a loop HOT 2
- Example keeps resetting HOT 5
- Compilation error: text section exceeds available space in board HOT 1
- Example triggering a Sketch too big Error HOT 2
- Compilation Error HOT 9
- crash after end() HOT 1
- ESP crash after connection HOT 2
- SoundData class declaration/implementation causes linker error HOT 2
- Can you connect to bluetooth speaker via mac address HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esp32-a2dp.