能否在一个pipeline中添加多个音频输入流

panrunxin
Posts: 1
Joined: Tue Oct 13, 2020 1:13 am

能否在一个pipeline中添加多个音频输入流

Postby panrunxin » Tue Oct 13, 2020 1:19 am

能否在一个pipeline中添加多个音频输入流[,例如httpstream flash_tone_stream,因为音频的输入方向有两个。或者能否进行pipeline的时间复用,觉得设置两个播放的pipeline造成了浪费。

ESP_HengYC
Posts: 184
Joined: Fri Dec 15, 2017 2:45 am

Re: 能否在一个pipeline中添加多个音频输入流

Postby ESP_HengYC » Tue Dec 15, 2020 9:33 am

panrunxin wrote:
Tue Oct 13, 2020 1:19 am
能否在一个pipeline中添加多个音频输入流[,例如httpstream flash_tone_stream,因为音频的输入方向有两个。或者能否进行pipeline的时间复用,觉得设置两个播放的pipeline造成了浪费。

这当然是可以的, 可以参考 /examples/advanced_examples/esp_dispatcher_dueros/ 这个例程 。https://github.com/espressif/esp-adf/bl ... etup.c#L95

Code: Select all

    esp_audio_input_stream_add(handle, fatfs_stream_init(&fs_reader));
    http_stream_cfg_t http_cfg = HTTP_STREAM_CFG_DEFAULT();
    http_cfg.event_handle = _http_stream_event_handle;
    http_cfg.type = AUDIO_STREAM_READER;
    http_cfg.enable_playlist_parser = true;
    audio_element_handle_t http_stream_reader = http_stream_init(&http_cfg);
    esp_audio_input_stream_add(handle, http_stream_reader);
    http_stream_reader = http_stream_init(&http_cfg);
    esp_audio_input_stream_add(handle, http_stream_reader);
这里可以看到 pipeline 有两个输入,分别为 :fatfs_stream , http_stream 用来处理来自 sdcard 文件操作系统中的 fatfs stream 和来自网络的 http stream。

Who is online

Users browsing this forum: No registered users and 26 guests