Leif160519的blog Leif160519的blog

——————

目录
ubuntu用命令播放音频文件
/  

ubuntu用命令播放音频文件

1.使用自带的命令

paplay music.mp3

注意:
1.此命令每次只能执行一句,多个终端不可同时执行,若同时执行,会依次等待
2.该命不能以root身份执行,保险起见,指定用户执行,如

sudo -u $USER paplay music.mp3

2.使用第三方软件sox

安装

sudo apt-get install sox

播放

play music.mp3

注意:此命令支持同时执行,也不需要指定用户执行,并且可以显示音频文件的基本信息,如

play WARN alsa: can't encode 0-bit Unknown or not applicable

HighAlarm.wav:

 File Size: 737k      Bit Rate: 1.41M
  Encoding: Signed PCM
  Channels: 2 @ 16-bit
Samplerate: 44100Hz
Replaygain: off
  Duration: 00:00:04.18

In:100%  00:00:04.18 [00:00:00.00] Out:184k  [      |      ] Hd:4.3 Clip:0
Done.

“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” – Tom Cargill

标  题ubuntu用命令播放音频文件
作  者Leif160519
出  处https://github.icu/articles/2019/09/06/1567759228138.html
关于博主:坐标南京,运维工程师,如有问题探讨可以直接下方留言。
声援博主:如果您觉得文章对您有帮助,可以评论、订阅、收藏。您的鼓励是博主的最大动力!