1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
01-read-from-disk.py - Soundfile playback from disk.
============================================================================================================================================
SfPlayer and friends read samples from a file on disk with control
over playback speed and looping mode.
Player family:
- **SfPlayer** : Reads many soundfile formats from disk.
- **SfMarkerLooper** : AIFF with markers soundfile looper.
- **SfMarkerShuffler** : AIFF with markers soundfile shuffler.
Reading sound file from disk can save a lot of RAM, especially if
the soundfile is big, but it is more CPU expensive than loading
the sound file in memory in a first pass.
.. code-block:: python
from pyo import *
s = Server().boot()
path = SNDS_PATH + "/transparent.aif"
# stereo playback with a slight shift between the two channels.
sf = SfPlayer(path, speed=[1, 0.995], loop=True, mul=0.4).out()
s.gui(locals())
|