BASS.NET API for the Un4seen BASS Audio LibraryBassEncBASS_Encode_GetACMFormat Method (Int32, ACMFORMAT, String, BASSACMFormat)BASS.NET API for the Un4seen BASS Audio Library
Presents the user with a list of available ACM (Audio Compression Manager) codec output formats to choose from.

This overload returns the generic codec format ACMFORMAT in the codec and handles all the rest already for you.

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

public static bool BASS_Encode_GetACMFormat(
	int handle,
	ref ACMFORMAT codec,
	string title,
	BASSACMFormat flags


Type: SystemInt32
The channel handle... a HSTREAM, HMUSIC, or HRECORD.
Type: Un4seen.Bass.AddOn.EncACMFORMAT
The ACMFORMAT to preselect. Will return the newly selected codec.
Type: SystemString
Window title for the selector... = "Choose the output format".
Type: Un4seen.Bass.AddOn.EncBASSACMFormat
A combination of these flags BASSACMFormat:
BASS_ACM_DEFAULTUse the format buffer (form) contents as the default choice in the codec selector.
BASS_ACM_RATEOnly include formats with the same sample rate as the source.
BASS_ACM_CHANSOnly include formats with the same number of channels (mono/stereo) as the source.
BASS_ACM_SUGGESTSuggest a format without letting the user choose. The wanted format tag (eg. WAVE_FORMAT_ADPCM) should be specified in the HIWORD.
The HighWord - use MakeLong(Int16, Int16)(flags,format) - can be used to restrict the choice to a particular format tag (eg. WAVE_FORMAT_ADPCM). This is required with BASS_ACM_SUGGEST, and is optional otherwise. See WAVEFormatTag for a list of typical formats being used.

Return Value

Type: Boolean
If successful, is returned and codec will contain the selected ACM format codec - else is returned. Use BASS_ErrorGetCode to get the error code.

This function presents the user with a list of available ACM codecs to choose from, given the sample format of the channel. The details of the chosen codec's output are returned as a generic codec format ACMFORMAT, which can then be used with BASS_Encode_StartACM(Int32, ACMFORMAT, BASSEncode, ENCODEPROC, IntPtr) or BASS_Encode_StartACMFile(Int32, IntPtr, BASSEncode, String) to begin encoding.

If writing the encoder output to a WAVE file, the codec format's WAVEFORMATEX contents would be the format chunk ("fmt") of the file.

To not let the user choose a codec, but automatically suggest a codec you might also use the BASS_Encode_GetACMFormatSuggest(Int32, BASSACMFormat, WAVEFormatTag) method.

ERROR CODEDescription
BASS_ERROR_HANDLEhandle is not valid.
BASS_ERROR_NOTAVAILThere are no codecs available that will accept the channel's format.
BASS_ERROR_ACM_CANCELThe user pressed the "cancel" button.
BASS_ERROR_UNKNOWNSome other mystery problem!

See Also