如何在 Octave 中播放声音?

编程入门 行业动态 更新时间:2024-10-21 16:32:04
本文介绍了如何在 Octave 中播放声音?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

Octave 似乎假设特定的声音播放实用程序将在系统上可用,但似乎没有提供指定替代的能力.在下面的错误中,Octave 正在寻找 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)

sh: ofsndplay: 命令未找到

sh: ofsndplay: command not found

是否有 Octave 配置设置或代码片段可用于指定适用于系统的实用程序?

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 -

此特定脚本使用 SoX play 实用程序.

This particular script uses the SoX play utility.

诚然,评论对于功能来说是不必要的,但它确实让我感觉更好......

更多推荐

如何在 Octave 中播放声音?

本文发布于:2023-11-14 15:13:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1587740.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:声音   如何在   Octave

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!