Audio Cutter is a reusable OutSystems component for trimming audio files directly in the user's browser. It allows applications to select a specific portion of an audio file by providing start and end positions and export the selected segment in MP3 or WAV format.
The component uses browser-based audio processing capabilities to decode, trim, and encode audio without requiring server-side audio processing. This makes it suitable for scenarios where audio files need to be trimmed within an OutSystems application while keeping the processing on the client side.
The component exposes a CutAudio Client Action. Provide the source audio as Binary Data along with the desired start and end positions, output format, and optional MP3 bitrate. The action processes the selected portion of the audio and returns the resulting audio as Binary Data.
CutAudio
For MP3 output, the component uses the included LameJS library for client-side MP3 encoding. WAV output is generated using client-side PCM/WAV encoding.
The component validates the supplied audio and trimming parameters before processing. Start and end positions must represent a valid audio segment, and the requested output format must be supported. If processing fails, the action returns an error message through its output parameters.
The accompanying Audio Cutter Demo application demonstrates how to integrate the component into an OutSystems application. It provides a simple interface for selecting an audio file, configuring the trimming range and output format, and generating the resulting audio file.