如何从命令行在 Windows 上播放音频文件? [英] How to play audio file on windows from command line?

查看:23
本文介绍了如何从命令行在 Windows 上播放音频文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Windows 中,是否有一种简单的方法(即您可以在单个命令行上输入的内容)来播放几个 .mp3 文件然后自行退出?

In Windows, is there a simple way (i.e. something you could type on a single command line) to just play a couple of .mp3 files and then exit on its own?

例如,wmplayer 完成后似乎不会退出,迫使忙碌的用户每次都将其追捕并单击关闭.(如果你传递一个列表,wmplayer 11 似乎也奇怪地重复了一些文件.)(较旧的(1990 年代)版本的mplayer"曾经支持/close"命令行选项,但它似乎在 wmplayer 11 中不起作用.)

wmplayer, for example, does not seem to exit when finished, forcing the harried user to hunt it down and click it closed every time. (wmplayer 11 also seems to strangely repeat some files if you pass it a list.) (The older (1990's) versions of 'mplayer' used to support a '/close' command line option, but it doesn't seem to work in wmplayer 11.)

我更喜欢使用每个人在他们的机器上都会有的东西(比如 wmplayer、quicktime...)

I'd prefer to use something that everyone will have on their machine (like wmplayer, quicktime...)

推荐答案

老问题,新答案 - 你可以使用 PowerShell:

Old question, new answer - you could use PowerShell:

powershell -c (New-Object Media.SoundPlayer 'c:PathToYourSound.wav').PlaySync();

这篇关于如何从命令行在 Windows 上播放音频文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆