clojure - 使用 Overtone 从磁盘读取声音文件?
问题描述
我想使用 Overtone 从磁盘播放更长的连续音频文件。
我知道 Overtone 有将样本加载到内存中的功能,但鉴于这些文件会很长而且很大(可能是几个小时),这不是我想要使用的方法。
SuperCollider - Overtone 用作其音频引擎 - 但是,也有另一种加载和流式传输文件的方法,即使用 DiskIn,Overtone 似乎也有,但我无法找到(文档,github)相应的Buffer.cueSoundFile()
功能。
Overtone有cueSoundFile
吗?我还有其他方法可以使用吗?
解决方案
cueSoundFile 是等效的 osc 消息 /b_read 的一个更高级的术语,您可以在 Overtone 中找到overtone.sc.buffer/buffer-cue
.
作为一个 5 秒的演示,它从磁盘播放一个 2 通道文件。
(demo (disk-in 2 (buffer-cue "~/Music/10mb.wav")))
还有磁盘输入文档(SC DiskIn)
user=> (doc disk-in)
-------------------------
overtone.live/disk-in
([numChannels bufnum loop])
stream audio in from disk file
[numChannels :none, bufnum :none, loop 0]
numChannels - Number of channels in the incoming
audio.
bufnum - Id of buffer
loop - Soundfile will loop if 1 otherwise
not.
Continuously play a longer soundfile from disk. This
requires a buffer to be preloaded with one buffer size of
sound. If loop is set to 1, the soundfile will loop.
Categories: InOut, Buffer
Rates: [ :ar ]
Default rate: :ar
推荐阅读
- c++ - 检测线程是否被操作系统中断
- html - 在 html 上使用 ddTextCollapse
- ldap - NiFi:LDAP 身份验证多个 DN 问题
- django - Django 如何在另一个页面上注册会员
- linux - tar --exlcude-from 仅文件
- reactjs - 如何在 React 中将数据从一个组件传递到另一个组件
- excel - 如何使用单元格内的十六进制颜色值突出显示单元格(但适用于最新版本的 Excel)
- sql - 将日期格式数字转换为日期并在 SQL 中取差
- digital-ocean - 将私钥添加到 FileZilla 时出现“无法从 fzputtygen 获得回复”错误
- c# - 使用 Angular 的 C# Lambda 表达式生成器