Package samer.audio
Class FileSink
- java.lang.Object
-
- Viewable
-
- samer.audio.FileSink
-
- All Implemented Interfaces:
- AudioSink
public class FileSink extends Viewable implements AudioSink
An AudioSink that writes to a wav file. Viewable name: "wavewriter"
Properties read from current environment:- filesink.current
- Current file (String)
- filesink.scale
- scale factor for converting floats/doubles (Double)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface samer.audio.AudioSink
AudioSink.Util
-
-
Constructor Summary
Constructors Constructor and Description FileSink(java.lang.String filename, javax.sound.sampled.AudioFormat fmt)
FileSink(javax.sound.sampled.AudioFormat fmt)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
close()
void
dispose()
void
execute(java.lang.String cmd, Environment env)
void
getCommands(Agent.Registry r)
VDouble
getScale()
Viewer
getViewer()
boolean
isOpen()
void
open()
void
open(java.io.File file)
void
setFormat(javax.sound.sampled.AudioFormat f)
Task
writer(double[] dbuf, int off, int len)
Return a task which takes samples from the given buffer The idea is that the audio sink can choose the right kind of writer depending on the format of the audio stream, and then handle any conversions automatically.Task
writer(float[] dbuf, int off, int len)
-
-
-
Constructor Detail
-
FileSink
public FileSink(java.lang.String filename, javax.sound.sampled.AudioFormat fmt) throws java.lang.Exception
- Throws:
java.lang.Exception
-
FileSink
public FileSink(javax.sound.sampled.AudioFormat fmt)
-
-
Method Detail
-
getScale
public VDouble getScale()
-
setFormat
public void setFormat(javax.sound.sampled.AudioFormat f)
-
open
public void open() throws java.lang.Exception
-
open
public void open(java.io.File file) throws java.lang.Exception
- Throws:
java.lang.Exception
-
writer
public Task writer(double[] dbuf, int off, int len)
Description copied from interface:AudioSink
Return a task which takes samples from the given buffer The idea is that the audio sink can choose the right kind of writer depending on the format of the audio stream, and then handle any conversions automatically.
-
writer
public Task writer(float[] dbuf, int off, int len)
-
getCommands
public void getCommands(Agent.Registry r)
-
execute
public void execute(java.lang.String cmd, Environment env) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getViewer
public Viewer getViewer()
-
-