Package com.vivoka.vsdk.audio.consumers
Class File
java.lang.Object
com.vivoka.vsdk.audio.consumers.File
- All Implemented Interfaces:
IConsumerModule
Represents a module that consumes audio buffers and writes them to a file
in raw format. This module can be used to save audio data to a specified file path.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
File
Constructs a File consumer module that writes audio data to the specified file path. The file will be created if it does not exist, and it can be truncated or appended to. Each time the user restarts the pipeline, the file will be reopened for writing in append mode.- Parameters:
path- The path to the file where audio data will be written.truncate- If true, the file will be truncated before writing; if false, data will be appended.- Throws:
Exception- If there is an error opening the file for writing.
-
-
Method Details
-
process
Description copied from interface:IConsumerModuleProcesses the given audio buffer.- Specified by:
processin interfaceIConsumerModule- Parameters:
buffer- The audio buffer to process.last- Indicates if this is the last buffer in the stream.- Throws:
Exception- If an error occurs during processing.
-