如何在八度播放声音? [英] How do I play a sound in Octave?

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

问题描述

八度似乎假设一个特定的声音播放工具将提供一个系统上,但似乎并没有提供指定替代的能力。在下面的错误,八度正在寻找 ofsndplay ,这是不是在所有系统上可用的工具。

Octave appears to assume that a specific sound playing utility will be available on a system but doesn't seem to provide the ability to specify an alternate. In the error below, Octave is looking for ofsndplay, which is not a utility available on all systems.

八度:38>声音(beamformed_20)

octave:38> sound(beamformed_20)

上海:ofsndplay:找不到命令

sh: ofsndplay: command not found

有一个八度的配置设置或code片段,我可以用它来指定一个系统相应的应用程​​序?

Is there an Octave configuration setting or code fragment that I can use to specify an system-appropriate utility?

推荐答案

在我的Linux机器之一,我创建了以下ofsndplay脚本来解决硬连接依赖性:

On one of my Linux machines, I created the following ofsndplay script to work around the hard-wired dependency:

$ cat /usr/bin/ofsndplay

#!/bin/sh
## Coping with stupid dependency on ofsndplay in octave
play -t au -

本特殊的脚本使用红袜播放工具。

This particular script uses the SoX play utility.

不可否认,注释是不必要的功能,但它确实让我感觉好多了......

这篇关于如何在八度播放声音?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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