可以使用wave模块实现audioread.audio_open()吗?

时间:2018-11-20 17:15:42

标签: python audio wave audio-processing

由于某些限制,我只能使用 wave scipy numpy 。因此,我决定自行实现以下代码段:

    with audioread.audio_open(os.path.realpath(path)) as input_file:
        sr_native = input_file.samplerate
        n_channels = input_file.channels

        s_start = int(np.round(sr_native * offset)) * n_channels

        if duration is None:
            s_end = np.inf
        else:
            s_end = s_start + (int(np.round(sr_native * duration)) * n_channels)

可以使用python wave模块完成此操作吗?通过使用wave.open()打开文件并使用scipy进行一些操作?

0 个答案:

没有答案