设置默认声音播放器

发布于 2024-12-08 07:54:20 字数 433 浏览 0 评论 0原文

通过使用像tuneR和seewave这样的R包,我生成了我想用一些不是Windows Media Player的软件来播放的声音,但我不知道如何设置它。该命令

setWavPlayer("mplay32")

是唯一有效的命令(及其 WMP)。当我尝试这样的事情时,

setWavPlayer("C:/Program Files/foobar2000/foobar2000.exe")

当我尝试播放声音时,合成器或播放命令只会给出此错误

'C:/Program' is not recognized as an internal or external command, operable program or batch file.

有任何提示吗?

By using R packages like tuneR and seewave I generated sounds that I want to play with some software that is not Windows Media Player but I don't know how to set this up. This command

setWavPlayer("mplay32")

Is the only thing that works (and its WMP). When I try something like this

setWavPlayer("C:/Program Files/foobar2000/foobar2000.exe")

The synth or play command just gives this error when I try to playback my sound

'C:/Program' is not recognized as an internal or external command, operable program or batch file.

Any hints?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

我ぃ本無心為│何有愛 2024-12-15 07:54:21

这是在 OSX 下对我有用的方法:假设我安装了一个名为 'play.app' 的应用程序,

setWavPlayer('/applications/play')

在您的情况下,您的路径字符串的空间(在“Program[space]Files”中)的某处会导致要分割的字符串。该错误消息很明显来自 CommandPrompt 或类似的 shell。您需要使用 shQuote 引用字符串,以便正确处理空格:

setWavPlayer(shQuote("C:/Program Files/foobar2000/foobar2000.exe"))

Here's what works for me under OSX: assuming I've installed an app called 'play.app' ,

setWavPlayer('/applications/play')

In your case it would appear that somewhere along the line your path string's space (in "Program[space]Files" ) is causing the string to be split up. That error message is pretty clearly coming from a CommandPrompt or similar shell. You need to quote the string using shQuote so that the space is handled properly:

setWavPlayer(shQuote("C:/Program Files/foobar2000/foobar2000.exe"))
人间不值得 2024-12-15 07:54:21

如果你想在 Windows 中这样做,这就是我所做的。不幸的是 wmplayer 不能完美工作。尽管如此,您可以用它播放声音。

  setWavPlayer('"C:/Program Files/Windows Media Player/wmplayer.exe"')

If you want to do it in windows this is what I did. Unfortunately wmplayer does not work perfectly. Nonetheless you can play sounds with it.

  setWavPlayer('"C:/Program Files/Windows Media Player/wmplayer.exe"')
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文