600字范文,内容丰富有趣,生活中的好帮手!
600字范文 > 【exp-linux】用aplay直接播放音频文件(mp3 wav)

【exp-linux】用aplay直接播放音频文件(mp3 wav)

时间:2021-08-07 11:56:30

相关推荐

【exp-linux】用aplay直接播放音频文件(mp3 wav)

aplay -l //查看有哪些播放设备

aplay xxx.wav //用系统配置的设备播放

aplay -D plughw:1,0 xxx.wav // 用指定的设备播放

Q1: aplay直接播放MP3文件是杂音

可以用audacity 将mp3转换(导出)成wav格式文件,再用aplay播放。

Q2:播放失败,提示:aplay: main:852: 音乐打开错误: 设备或资源忙

是因为系统配置的音频输出是这个,在设置里面将其配置为其他的,之后再用aplay播放。

Q3:播放如果有杂音

可能是某个程序导致的,可以关闭这个程序,比如firefox~

参考:

aplay(1) - Linux man page

alsa-utils/aplay at master · alsa-project/alsa-utils · GitHub

使用aplay实现音频播放 - kay880 - 博客园

aplay_零一之间的M的博客-CSDN博客_aplay

aplay 帮助文档:

$ aplay --helpUsage: aplay [OPTION]... [FILE]...-h, --help help--version print current version-l, --list-deviceslist all soundcards and digital audio devices-L, --list-pcms list device names-D, --device=NAME select PCM by name-q, --quiet quiet mode-t, --file-type TYPE file type (voc, wav, raw or au)-c, --channels=# channels-f, --format=FORMATsample format (case insensitive)-r, --rate=# sample rate-d, --duration=# interrupt after # seconds-s, --samples=# interrupt after # samples per channel-M, --mmap mmap stream-N, --nonblocknonblocking mode-F, --period-time=#distance between interrupts is # microseconds-B, --buffer-time=#buffer duration is # microseconds--period-size=#distance between interrupts is # frames--buffer-size=#buffer duration is # frames-A, --avail-min=# min available space for wakeup is # microseconds-R, --start-delay=#delay for automatic PCM start is # microseconds (relative to buffer size if <= 0)-T, --stop-delay=#delay for automatic PCM stop is # microseconds from xrun-v, --verbose show PCM structure and setup (accumulative)-V, --vumeter=TYPEenable VU meter (TYPE: mono or stereo)-I, --separate-channels one file for each channel-i, --interactive allow interactive operation from stdin-m, --chmap=ch1,ch2,.. Give the channel map to override or follow--disable-resample disable automatic rate resample--disable-channels disable automatic channel conversions--disable-format disable automatic format conversions--disable-softvol disable software volume control (softvol)--test-positiontest ring buffer position--test-coef=# test coefficient for ring buffer position (default 8)expression for validation is: coef * (buffer_size / 2)--test-nowait do not wait for ring buffer - eats whole CPU--max-file-time=# start another output file when the old file has recordedfor this many seconds--process-id-file write the process ID here--use-strftimeapply the strftime facility to the output file name--dump-hw-params dump hw_params of the device--fatal-errorstreat all errors as fatal認可的取樣格式是︰ S8 U8 S16_LE S16_BE U16_LE U16_BE S24_LE S24_BE U24_LE U24_BE S32_LE S32_BE U32_LE U32_BE FLOAT_LE FLOAT_BE FLOAT64_LE FLOAT64_BE IEC958_SUBFRAME_LE IEC958_SUBFRAME_BE MU_LAW A_LAW IMA_ADPCM MPEG GSM S20_LE S20_BE U20_LE U20_BE SPECIAL S24_3LE S24_3BE U24_3LE U24_3BE S20_3LE S20_3BE U20_3LE U20_3BE S18_3LE S18_3BE U18_3LE U18_3BE G723_24 G723_24_1B G723_40 G723_40_1B DSD_U8 DSD_U16_LE DSD_U32_LE DSD_U16_BE DSD_U32_BE有部份可能選取的硬體不提供The available format shortcuts are:-f cd (16 bit little endian, 44100, stereo)-f cdr (16 bit big endian, 44100, stereo)-f dat (16 bit little endian, 48000, stereo)

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。