使用 Overtone 从磁盘读取声音文件?

Reading a sound file from the disk with Overtone?

我想使用 Overtone 从磁盘播放更长的连续音频文件。

我知道 Overtone 有 facilities for loading in samples into memory,但鉴于这些文件又长又大(可能以小时为单位),这不是我想要使用的方法。

SuperCollider - Overtone 用作其音频引擎 - 但是,还有另一种加载和流式传输文件的方法,即 using DiskIn, which Overtone also seems to have, but I wasn't able to find (docs, 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