Audio Cutter is a reusable OutSystems component for trimming audio files directly in the browser.
The component allows applications to select a portion of an audio file by specifying the start and end positions and export the selected segment as MP3 or WAV.
Audio processing is performed on the client side using browser audio capabilities, without requiring server-side audio processing.
Install Audio Cutter from Forge into your OutSystems environment.
The component exposes the following public Client Action:
CutAudio
Use this action from your application whenever you need to trim an audio file.
The CutAudio action expects the source audio file as Binary Data.
For example, the binary data can come from:
Pass the binary data to:
AudioBinary
The CutAudio Client Action trims the supplied audio file between the specified start and end positions and returns the resulting audio segment.
StartSeconds
EndSeconds
OutputFormat
mp3
wav
AudioBitrate
Success
ErrorMessage
CutAudioBinary
Duration
The component currently supports two output formats.
Use:
MP3 output is encoded using the included LameJS library.
WAV output is generated as 16-bit PCM audio.
The component provides the AudioFormat Static Entity containing the supported formats.
AudioFormat
When building a UI, you can use this Static Entity to populate an Output Format dropdown rather than manually creating the values.
When exporting to MP3, the following bitrates are supported:
The AudioBitrate Static Entity provides these supported values.
If no bitrate is supplied, the component uses 128 kbps.
Note: Bitrate is applicable only to MP3 output. It does not affect WAV output.
The trimming range is defined using:
StartSeconds EndSeconds
For example:
StartSeconds = 10 EndSeconds = 30
produces a 20-second audio segment starting at the 10-second position.
The component validates the requested range before processing.
If validation or processing fails:
Success = False
and the reason is returned through:
A typical implementation can follow this flow:
User selects audio file ↓ Convert/Get Binary Data ↓ Set StartSeconds ↓ Set EndSeconds ↓ Select OutputFormat ↓ Select AudioBitrate ↓ Call CutAudio ↓ Check Success ↓ Use CutAudioBinary
AudioBinary = UploadedAudio StartSeconds = 15 EndSeconds = 45 OutputFormat = "mp3" AudioBitrate = 128
The action returns the selected 30-second segment as Binary Data.
Always check the Success output after calling CutAudio.
Success = True
The resulting audio is available in:
The duration is available in:
The reason for the failure is available in:
A typical implementation can display the error message to the user or use it for application logging.
CutAudioBinary can be used like any other Binary Data in OutSystems.
For example, the application can:
The Audio Cutter component itself does not impose a storage strategy on the consuming application.
The component includes an Audio Cutter Demo application demonstrating the recommended usage pattern.
The demo allows users to:
The Demo App is intended as a reference implementation for developers integrating the Audio Cutter component into their own applications.
Audio processing is performed in the user's browser.
The component uses browser audio capabilities to:
Because processing occurs on the client side, the source audio does not need to be uploaded to a server specifically for the trimming operation.
Note: Processing time and memory consumption can vary depending on the source audio size, duration, format, browser, and device capabilities.
MP3 encoding is performed using LameJS, which is included as a component resource and loaded when MP3 output is requested.
WAV output does not require the MP3 encoder.
Therefore:
OutputFormat = MP3 ↓ LameJS encoder ↓ MP3 Binary Data
and:
OutputFormat = WAV ↓ WAV PCM encoding ↓ WAV Binary Data
For applications exposing the component through a user interface, the following controls are recommended:
For the output format and bitrate dropdowns, the provided Static Entities can be used to populate the available options.
The component does not throw user-facing errors as a substitute for the output parameters.
Instead, processing results can be handled through:
Success ErrorMessage
Recommended pattern:
Call CutAudio ↓ Success? ┌──┴──┐ Yes No ↓ ↓ Use Display/ result handle ErrorMessage
The current version is intentionally focused on core audio trimming functionality.
The initial version provides core client-side audio trimming functionality with MP3 and WAV export.
Future versions may introduce additional capabilities while maintaining compatibility with the existing CutAudio API where possible.
For issues, questions, feature requests, or improvements, use the Support section of the Audio Cutter Forge component.