pipeline怎么循环播放音频?
Posted: Mon Apr 26, 2021 12:20 pm
用sdcard_MP3例子修改为循环播放出错?
/* Stop when the last pipeline element (i2s_stream_writer in this case) receives stop event */
if (msg.source_type == AUDIO_ELEMENT_TYPE_ELEMENT && msg.source == (void *) i2s_stream_writer
&& msg.cmd == AEL_MSG_CMD_REPORT_STATUS
&& (((int)msg.data == AEL_STATUS_STATE_STOPPED) || ((int)msg.data == AEL_STATUS_STATE_FINISHED))) {
ESP_LOGW(TAG, "[ * ] Stop event received");
//break;
audio_pipeline_terminate(pipeline);
audio_element_set_uri(fatfs_stream_reader, "/sdcard/zsh.mp3");
audio_pipeline_run(pipeline);
}
提示pipeline已在运行,请问怎么循环播放或播放其它音频?
/* Stop when the last pipeline element (i2s_stream_writer in this case) receives stop event */
if (msg.source_type == AUDIO_ELEMENT_TYPE_ELEMENT && msg.source == (void *) i2s_stream_writer
&& msg.cmd == AEL_MSG_CMD_REPORT_STATUS
&& (((int)msg.data == AEL_STATUS_STATE_STOPPED) || ((int)msg.data == AEL_STATUS_STATE_FINISHED))) {
ESP_LOGW(TAG, "[ * ] Stop event received");
//break;
audio_pipeline_terminate(pipeline);
audio_element_set_uri(fatfs_stream_reader, "/sdcard/zsh.mp3");
audio_pipeline_run(pipeline);
}
提示pipeline已在运行,请问怎么循环播放或播放其它音频?