SFPlayer plays sound files directly from disk. It also has a convenient -gui.
The most common use is: SFPlayer.new.gui
or SFPlayer.new("/path/to/soundfile").gui
. See examples below.
path |
The path to a soundfile. Can be |
outbus |
The bus to output to. Defaults to |
server |
The server to use. If |
skin |
Optionally an instance of |
autoShowOpenDialog |
If |
autoBootServer |
If |
autoSetSampleRate |
If |
autoSetOutputChannels |
If |
Show a GUI of the SFPlayer
. This creates an instance of SFPlayerView, stored under -view.
argBounds |
Bounds of the gui. If |
doneAction |
Action to be performed after opening the gui and loading the soundfile into the SoundFileView. |
onCloseAction |
Action to be performed after closing the gui. |
parent |
Optionally a parent view to embed this |
this SFPlayer
(not the SFPlayerView
)
Play the file from the current position;
Stop playing. startTime
is left at the original value;
updateStart |
If |
Stop playing. startTime
is updated to the current playback position.
pause
is called when the player is stopped, it will preload the playback buffer and wait for the start of playback. This allows starting playback without additional delay on slower storage or when multiple players are synchronized togetherUpdates the player to the initial state (resets playback position, amp, etc.)
If the gui was created, this returns an instance of the SFPlayerView
.
Get/Set the time of fade in / fade out when starting/stopping. Increase this value for seamless looping (see below).
attRelTime
and set the loopEnd
parameter to at least attRelTime
less than the soundfile's duration.Turn looping on/off by setting loop to true
or false
.
Get/Set loop beginning (in seconds).
Get/Set loop end (in seconds).
Set both beginning and end of the loop (used by the SFPlayerView
).
It is possible to link multiple players together and have them start playback at the same time.