BASS.NET API for the Un4seen BASS Audio LibraryEncoderFHGAACplus ClassBASS.NET API for the Un4seen BASS Audio Library
Encoder class implementation for FHG Winamp AACplus encoding using "fhgaacenc.exe" (the command-line encoder using the following Winamp DLLs: "enc_fhgaac.dll", "nsutil.dll", "libsndfile-1.dll" and "libmp4v2.dll").
Inheritance Hierarchy


Namespace: Un4seen.Bass.Misc
Assembly: Bass.Net (in Bass.Net.dll) Version:

public sealed class EncoderFHGAACplus : BaseEncoder

The EncoderFHGAACplus type exposes the following members.


Public methodEncoderFHGAACplus
Creates an instance of a FHG Winamp AACplus encoder implementation.

Public propertyChannelBitwidth
This property returns the actual bitwidth of the sample data of the channel (e.g. 8, 16, 32).
(Inherited from BaseEncoder.)
Public propertyChannelHandle
Gets or Sets the channel handle which is used to create the broadcast encoder class.
(Inherited from BaseEncoder.)
Public propertyChannelInfo
Returns the general channel info.
(Inherited from BaseEncoder.)
Public propertyChannelNumChans
This property returns the actual number of channles of the sample data BASS is using with the channel (e.g. 1=mono, 2=stereo, etc.).
(Inherited from BaseEncoder.)
Public propertyChannelSampleRate
This property returns the actual sample rate in Hz of the sample data BASS is using with the channel (e.g. 44100).
(Inherited from BaseEncoder.)
Public propertyDefaultOutputExtension
This return the default extension of an output file for this encoder (either ".aac" or ".m4a").
(Overrides BaseEncoderDefaultOutputExtension.)
Public propertyEffectiveBitrate
Returns the CBR encoder bitrate (in kbps) of the output.
(Overrides BaseEncoderEffectiveBitrate.)
Public propertyEncoderCommandLine
Gets the actual encoder command-line string (using all AACPlus_xxx properties).
(Overrides BaseEncoderEncoderCommandLine.)
Public propertyEncoderDirectory
Gets or Sets the encoder's base directory.
(Inherited from BaseEncoder.)
Public propertyEncoderExists
This property return , if the files "fhgaacenc.exe", "enc_fhgaac.dll", "libsndfile-1.dll" and "nsutil.dll" exists in the EncoderDirectory - else is returned.
(Overrides BaseEncoderEncoderExists.)
Public propertyEncoderHandle
Gets or sets the current HENCODE encoder handle.
(Inherited from BaseEncoder.)
Public propertyEncoderType
Gets a value indicating the type of content. Here BASS_CTYPE_STREAM_AAC is always returned.
(Overrides BaseEncoderEncoderType.)
Public propertyForce16Bit
Gets or Sets if a encoding in 16-bit sample data should be forced (default is ).
(Inherited from BaseEncoder.)
Public propertyInputFile
Gets or Sets the input file name to be processed by the encoder (null = STDIN, default).
(Inherited from BaseEncoder.)
Public propertyIsActive
Gets a value indicating if the encoder has been started (see Start(ENCODEPROC, IntPtr, Boolean)) and is active - else will be returned.
(Inherited from BaseEncoder.)
Public propertyIsPaused
Gets a value indicating if the encoder has been paused (see Pause(Boolean)) - else must be returned.
(Inherited from BaseEncoder.)
Public propertyNoLimit
Gets or Sets if encoding should use the CAST_NOLIMIT flag (which is only needed, if the encoder is used for streaming).
(Inherited from BaseEncoder.)
Public propertyOutputFile
Gets or Sets the output file name to be processed by the encoder (null = STDOUT, default).
(Inherited from BaseEncoder.)
Public propertySupportsSTDOUT
The "fhgaacenc.exe" implements STDOUT, so is always returned.
(Overrides BaseEncoderSupportsSTDOUT.)
Public propertyTAGs
Gets or Sets the TAG_INFO structure associated with the encoder.
(Inherited from BaseEncoder.)
Public propertyUseAsyncQueue
Gets or Sets if encoding should use an async queue (i.e. the BASS_ENCODE_QUEUE flag).
(Inherited from BaseEncoder.)

Public methodDispose
Implement IDisposable.
(Inherited from BaseEncoder.)
Protected methodFinalize
Finalization code.
(Inherited from BaseEncoder.)
Public methodStatic memberIsWinampInstalled
Determines, if Winamp is installed on your machine.
Public methodPause
Pauses or resumes an encoder.
(Inherited from BaseEncoder.)
Public methodSettingsString
Returns the string representation of the current encoder settings.
(Overrides BaseEncoderSettingsString.)
Public methodStart
This method starts the actual FHG AACplus encoder.
(Overrides BaseEncoderStart(ENCODEPROC, IntPtr, Boolean).)
Public methodStop
Stops the encoder (if started).
(Inherited from BaseEncoder.)
Public methodStop(Boolean)
Stops the encoder (if started).
(Inherited from BaseEncoder.)
Public methodToString
Returns the name of the Encoder.
(Overrides ObjectToString.)

Public fieldAACPlus_ConstantBitrate
--cbr: encode in CBR mode; bitrate in kbps (8..576), default 128 kbps.
Public fieldAACPlus_Profile
--profile: choose the AAC profile (only for CBR mode); default is Auto.
Public fieldAACPlus_UseADTS
Use ADTS container instead of MPEG-4.
Public fieldAACPlus_VariableBitrate
--vbr: encode in VBR mode; preset 1..5, default is 0 (disabled).

This class uses the BASS_CTYPE_STREAM_AAC encoder type.

fhgaacenc (fhgaacenc.exe) must be downloaded separately (e.g. from

Since "fhgaacenc.exe" also needs the mentioned Winamp DLLs ("enc_fhgaac.dll", "nsutil.dll" and "libmp4v2.dll" as of version 5.62 or above) you also need to install Winamp and copy the Winamp DLLs from the Winamp resp. Winamp/PlugIns folder into the same folder which contains fhgaacenc.exe (or you might also copy "fhgaacenc.exe" and "libsndfile-1.dll" into the Winamp/PlugIns folder).

The FHG Winamp AACPlus library does not support 32-bit floating point sample data as input, so the BASS_ENCODE_FP_32BIT flag will automatically be used.

Make sure to set the AACPlus_xxx flags before retrieving the EncoderCommandLine or calling Start(ENCODEPROC, IntPtr, Boolean).

This implementation uses the automatic DSP system for encoding. Meaning the sending of sample data to the encoder is done automatically when you play the channel (BASS_ChannelPlay(Int32, Boolean)) or call BASS_ChannelGetData(Int32, IntPtr, Int32) (if it's a decoding channel). So there is no need to call BASS_Encode_Write(Int32, IntPtr, Int32) manually!

The extension of the OutputFile can be either .acc to write an aac bitstream output file or .m4a/.mp4 to box the output to a MP4 container (note, that using m4a/mp4 requires "libmp4v2.dll" to be present).

If you simply want to encode a physical file please also take a look to the EncodeFile(String, String, BaseEncoder, BaseEncoderENCODEFILEPROC, Boolean, Boolean).

See Also