![为什么我听不到 CentOS 6.5 Vagrant 盒子中播放的音频?](https://linux22.com/image/58074/%E4%B8%BA%E4%BB%80%E4%B9%88%E6%88%91%E5%90%AC%E4%B8%8D%E5%88%B0%20CentOS%206.5%20Vagrant%20%E7%9B%92%E5%AD%90%E4%B8%AD%E6%92%AD%E6%94%BE%E7%9A%84%E9%9F%B3%E9%A2%91%EF%BC%9F.png)
我想使用 aplay 从我的 CentOS 6.5 Vagrant 盒子中播放波形文件,当然我想听到声音。
这就是我所做的:
> aplay sine.wav
Playing WAVE 'sine.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
看起来 aplay 确实播放了该文件。但我听不到正弦音。
使用扬声器测试也会发生同样的情况。它似乎有效,但我什么也没听到。
> speaker-test
speaker-test 1.0.23
Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 2048 to 16384
Period size range from 1024 to 1024
Using max buffer size 16384
Periods = 4
was set period_size = 1024
was set buffer_size = 16384
0 - Front Left
Time per period = 2.618271
0 - Front Left
这是我的 Vagrantfile:
Vagrant.configure("2") do |config|
config.vm.box = "centos-6.5"
config.vm.provider "virtualbox" do |v|
v.memory = 2048
v.cpus = 2
v.customize [
"modifyvm", :id,
"--ioapic", "on",
"--audio", "coreaudio",
"--audiocontroller", "ac97"
]
end
end
缺什么?我需要做什么才能真正听到音频输出?