GNURadio/GRC,如何在不手动启停的情况下,依次使用不同的音源作为输入?

In GNURadio/GRC, how to sequentially use different audio sources as input without having to manually start and stop?

我的流程图中有 3-4 个不同的音频源。我想背靠背播放每个源(而不是相互叠加),而不必手动启动和停止每个源。本质上,就像一个计时器。例如,播放源 1 然后停止,等待 15 秒,播放源 2,等待 30 秒,依此类推...流程图中是否有块可以执行此操作或是否有人有 python阻止已经这样做或类似的事情?

我自己想出来的……基本上我做了我自己的嵌入式 python 块,它延迟了我想要的输入这么多秒。这是我想出的:

import time 
import numpy as np
from gnuradio import gr


class blk(gr.sync_block):  
    """Embedded Python Block that time delays the input file"""

    # initializes the GRC Block input, output, block title, and parameters
    def __init__(self, delay = 0):  
        gr.sync_block.__init__(
            self,
            name='Time Delayed Input',
            in_sig=[np.float32],
            out_sig=[np.float32]
        )
 
        # sets a callback for time delay in seconds specified in the GRC block
        self.delay = time.sleep(delay)

    def work(self,  input_items,  output_items):
        
        # sets output equal to the input to just pass through the block 
        output_items[0][:] = input_items[0]
        
        # calls a time delay in seconds 
        sleep.delay

        # returns the input as the output after the specified delay 
        return len(output_items[0])