Class: Awaaz::Decoders::Mp3Decoder
- Inherits:
-
BaseDecoder
- Object
- BaseDecoder
- Awaaz::Decoders::Mp3Decoder
- Includes:
- Utils::ViaShell
- Defined in:
- lib/awaaz/decoders/mp3_decoder.rb
Overview
The Mp3Decoder class provides decoding functionality for .mp3 files within the Awaaz gem.
It inherits from BaseDecoder and uses the Utils::ViaShell mixin to perform decoding via shell commands (e.g., Sox).
Instance Method Summary collapse
-
#load ⇒ Object
Loads and processes an MP3 file.
Methods inherited from BaseDecoder
#available_options, default_available_options, #initialize, load, set_available_options
Constructor Details
This class inherits a constructor from Awaaz::Decoders::BaseDecoder
Instance Method Details
#load ⇒ Object
Loads and processes an MP3 file.
This method:
-
Validates that the file has a
.mp3extension. -
Uses Utils::ViaShell#shell_load to load raw audio data.
-
Passes the loaded data to BaseDecoder#process for further handling.
39 40 41 |
# File 'lib/awaaz/decoders/mp3_decoder.rb', line 39 def load process(*shell_load(sox_options: { raw: true })) end |