You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my application i have two ESP32 WROVER. One in Sink mode and the other is the Source. The Source is able to startup, connect and stream the music. It's OK. But at the end of the current file i need to go to the next track. I looked for examples and tryed them out but can't get this to work. And further i need to do STOP / PLAY / PAUSE / NEXT / PREV.
My attemt is as below:
// Advance to the next song when previous finishesif (msg.source== (void*) fatfs_stream_reader&&msg.cmd==AEL_MSG_CMD_REPORT_STATUS) {
audio_element_state_tel_state=audio_element_get_state(fatfs_stream_reader);
if (el_state==AEL_STATE_FINISHED) {
ESP_LOGI(TAG, "[ * ] Finished, advancing to the next song");
periph_bt_stop(bt_periph);
// audio_pipeline_pause(pipeline);// audio_pipeline_stop(pipeline);// audio_pipeline_wait_for_stop(pipeline);// audio_element_set_ringbuf_done(bt_stream_writer);// audio_element_finish_state(bt_stream_writer);// audio_element_stop(bt_stream_writer);// periph_bt_pause(bt_periph);// audio_element_reset_state(mp3_decoder);audio_pipeline_reset_ringbuffer(pipeline);
audio_pipeline_reset_elements(pipeline);
audio_pipeline_change_state(pipeline, AEL_STATE_INIT);
if (sys_state.sd.music.track_current<sys_state.sd.music.track_count) {
sys_state.sd.music.track_current++;
audio_element_set_uri(fatfs_stream_reader, tracks_list[sys_state.sd.music.track_current]);
audio_pipeline_run(pipeline);
periph_bt_play(bt_periph);
}
else {
sys_state.sd.music.track_current=0;
audio_element_set_uri(fatfs_stream_reader, tracks_list[sys_state.sd.music.track_current]);
if (sys_state.sd.music.loop== true) {
audio_pipeline_run(pipeline);
periph_bt_play(bt_periph);
}
}
ESP_LOGI(TAG, "TRACK CRR: %d/%d %s", sys_state.sd.music.track_current, sys_state.sd.music.track_count,
// tracks_list[sys_state.sd.music.track_current]);audio_element_get_uri(fatfs_stream_reader));
}
continue;
}
According to the above log, the music stream starts after 90115 and ends at 199391. In my code, I set the new URI and attempt to play, but nothing happened after the last log line. I am unsure if I am checking the correct FLAG for end of play detection or resetting the pipeline operation correctly.
Thanks in advance!
The text was updated successfully, but these errors were encountered:
github-actionsbot
changed the title
How do i control playback on pipeline_a2dp_source_stream example?
How do i control playback on pipeline_a2dp_source_stream example? (AUD-5951)
Dec 26, 2024
Hi everyone!
In my application i have two ESP32 WROVER. One in Sink mode and the other is the Source. The Source is able to startup, connect and stream the music. It's OK. But at the end of the current file i need to go to the next track. I looked for examples and tryed them out but can't get this to work. And further i need to do STOP / PLAY / PAUSE / NEXT / PREV.
My attemt is as below:
The ADF version is at: v2.7-4-g1bc914b7
According to the above log, the music stream starts after 90115 and ends at 199391. In my code, I set the new URI and attempt to play, but nothing happened after the last log line. I am unsure if I am checking the correct FLAG for end of play detection or resetting the pipeline operation correctly.
Thanks in advance!
The text was updated successfully, but these errors were encountered: