- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我在一个嵌入式项目上使用 ALSA dmix 插件,并通过使用 mpg321-alsa 播放它们来混合 mp3 文件。在我的 asound.conf 中,我将我的 dmix 采样率设置为 44100Hz。
如果我尝试播放以 44100Hz(或平均分为 44100Hz 的速率)以外的速率采样的任何 mp3 文件,那么要么音频质量下降,要么更糟的是文件的开头被忽略。这有一个随机方面:如果我创建一个长度为 300 毫秒的音频文件并通过 mpg321-alsa 播放它,那么有时它播放正常,有时根本没有声音。
这是 dmix 的已知问题吗?除了重新采样 mp3 文件之外,是否有任何解决方法?
最佳答案
参见 ALSA plugin documentation .
Note that the dmix plugin itself supports only a single configuration. That is, it supports only the fixed rate (default 48000), format (
S16
), channels (2), and period_time (125000). For using other configuration, you have to set the value explicitly in the slave PCM definition. The rate, format and channels can be covered by an additional plug plugin, but there is only one base configuration, anyway.
作为示例(修改以满足您的需要),
pcm.dsp0 {
type plug
slave.pcm "asym0"
slave.rate 44100
}
pcm.asym0 {
type asym
playback.pcm "dmix0"
capture.pcm "dsnoop0"
}
pcm.dmix0 {
type dmix
ipc_key 1024
ipc_perm 0666
slave {
pcm {
type hw
card 0
device 0
}
period_time 0
period_size 1024
buffer_size 65536
format "S16_LE"
periods 128
rate 44100
}
}
pcm.dsnoop0 {
type dsnoop
ipc_key 1025
ipc_perm 0666
slave.pcm {
type hw
card 0
device 0
}
}
关于linux - ALSA dmix 插件和采样率问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1715770/
我使用 QBFC v13 和 Delphi XE6。 目标是从我的应用程序创建 Estimate 并将其参数设置到 QuickBooks 中。 我从 QBFC13 导入类型库并将其添加到我的项目中。
我有一个数据库,其中有很多格式不正确的地址。在这个地址中,我只有一个街道地址或带有城市名称的街道。在我的应用程序中,用户选择一些类别,然后我想在 map 上显示例如 50,100,300 等地址。(不
在大多数软件项目中,缺陷源自需求、设计、编码和缺陷更正。根据我的经验,大多数缺陷都源于编码阶段。 我有兴趣了解软件开发人员使用哪些实用方法来降低缺陷注入(inject)率。 我已经看到以下方法的使用取
我正在使用实时 API 中的标签订阅构建一个应用程序,并且有一个与容量规划相关的问题。我们可能有大量用户同时发布到订阅的主题标签,因此问题是 API 实际发布到我们的订阅处理端点的频率是多少?例如,如
尝试使用 NULLIF 或 IFNULL 函数,但仍收到被零除的消息。 SELECT client_id ,COUNT(distinct CASE WHEN status = 'failed' THE
我目前正在开发一个使用 Django-rest-framework 制作的 API。我必须根据每个用户组设置限制率。 我们目前使用默认配置的 memcached 作为缓存后端,即按站点缓存。 在使用
我认为有时在神经网络(特别是一般对抗网络)训练期间改变丢失率可能是一个好主意,从高丢失率开始,然后线性地将丢失率降低到零。您认为这有意义吗?如果是的话,是否有可能在 tensorflow 中实现这一点
我有一个 Windows Server 2008,Plesk 运行着两个网站。有时服务器运行缓慢,并且有一个 named.exe 进程使 CPU 峰值达到 100%。它持续很短的时间,过一会儿它又来了
我正在使用 scikit-learn 随机森林分类器,我想通过将成功投票所需的树数量从大于 50% 增加到 75% 来降低 FP 率,在阅读文档后我不这样做确定如何做到这一点。有没有人有什么建议。 (
当我连续按下按键事件(字母 k)时,为什么以下按键事件不会减慢 3000 密耳?如果我按住手指,计数会迅速增加,因为 mcount 上没有 setTimeout。这是为什么?每次计数之间应该有延迟,但
我是一名优秀的程序员,十分优秀!