Command line program for playing sections of audio specified in milliseconds

徘徊边缘 提交于 2019-12-04 12:31:43

sox

You can use sox play with the trim effect:

play audio.wav trim START =END

Which in your case would become:

play audio.wav trim 0.1234 =5.6789

Note that the end can also be specified as a length:

play audio.wav trim 0.1234 2

Which starts playing at 0.1234 and plays 2 seconds of the file.

Also note that the offsets can be specified as number of samples by appending an s to the number.

mplayer

mplayer also supports this:

mplayer -ss START -endpos END audio.wav

ffplay from ffmpeg

ffplay uses similar input parameters but doesn't support absolute end times, so some minor arithmetic is needed:

ffplay -ss START -t $(( END - START )) audio.wav
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!