首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Alsa重采样

Alsa重采样
EN

Unix & Linux用户
提问于 2014-11-01 09:23:44
回答 1查看 4.1K关注 0票数 4

我的设置是Vortexbox2.3,一个基于Fedora的Linux音乐发行版。我有一个多声道的声卡,来自miniDSP的miniDSP。我已经在asound.conf中设置了独立的立体声设备,这样我就可以有多个压缩播放实例来分离输出通道。因为他们只是一个时钟对所有的播放器,音频需要所有的样本率相同。我的大部分音乐是44.1千赫,但有些48千赫,所以我需要一些重采样时,48千赫的文件被播放。我已经通过asound.conf实现了这一点。然而,看起来ALSA正在将每件事重新调整到44.1千赫,即使这是最初的抽样率,而不仅仅是我所期望的输出48千赫的球员。我希望本地的44.1文件可以在不重采样的情况下播放。我想要处理的样本率在ALSA,而不是球员,所以我可以添加其他球员也。

是否有办法使ALSA在利率不匹配时才能重采样?

代码语言:javascript
复制
#
# Place your global alsa-lib configuration here...
#

#defaults.pcm.rate_converter "speexrate"

pcm_slave.miniDSP {
# pcm "hw:0,0"
pcm "hw:USBStreamer"
rate 44100        # fixed, because all dshare devices must use the same samplerate. Could use rate unchanged but not for here.
format S32_LE
channels 10
}

pcm.stereo_1_raw {
type plug
slave.pcm {
    type dshare
    ipc_key 662662
ipc_key_add_uid true
    slave miniDSP
    bindings [ 0 1 ]
}
}

pcm.stereo_2_raw {
type plug
slave.pcm {
    type dshare
    ipc_key 662662
ipc_key_add_uid true
    slave miniDSP
    bindings [ 2 3 ]
}
}

pcm.stereo_3_raw {
type plug
slave.pcm {
    type dshare
    ipc_key 662662
ipc_key_add_uid true
    slave miniDSP
    bindings [ 4 5 ]
}
}

pcm.stereo_4_raw {
type plug
slave.pcm {
    type dshare
    ipc_key 662662
ipc_key_add_uid true
    slave miniDSP
    bindings [ 6 7 ]
}
}

pcm.stereo_1_output {
    type rate
    slave {
            pcm stereo_1_raw
            rate 44100
    }
    #converter "speexrate_medium" This doesn't work for 4 channels.
converter "samplerate"
}

pcm.stereo_2_output {
    type rate
    slave {
            pcm stereo_2_raw
            rate 44100
    }
    converter "speexrate_medium"
}

pcm.stereo_3_output {
    type rate
    slave {
            pcm stereo_3_raw
            rate 44100
    }
#converter "speexrate_medium"
converter "samplerate"
}

pcm.stereo_4_output {
    type rate
    slave {
            pcm stereo_4_raw
            rate 44100
    }
    #converter "speexrate_medium"
converter "samplerate"
}
EN

回答 1

Unix & Linux用户

发布于 2014-11-01 12:01:41

plug插件只在需要时插入rate插件,但是当您手动插入rate插件时,这就是您所得到的。

只需删除rate插件即可;您可以直接使用stereo_x_raw设备。(对于重采样算法,可以依赖于默认设置。)

票数 2
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/165394

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档