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 and handles all the rest already for you.
Namespace: Un4seen.Bass.AddOn.Enc
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.17.5
Syntax
public static ACMFORMAT BASS_Encode_GetACMFormat( int handle, string title, BASSACMFormat flags, WAVEFormatTag format )
Parameters
- handle
- Type: SystemInt32
The channel handle... a HSTREAM, HMUSIC, or HRECORD. - title
- Type: SystemString
Window title for the selector... = "Choose the output format". - flags
- Type: Un4seen.Bass.AddOn.EncBASSACMFormat
A combination of these flags BASSACMFormat: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.BASS_ACM_DEFAULT Use the format buffer (form) contents as the default choice in the codec selector. BASS_ACM_RATE Only include formats with the same sample rate as the source. BASS_ACM_CHANS Only include formats with the same number of channels (mono/stereo) as the source. BASS_ACM_SUGGEST Suggest a format without letting the user choose. The wanted format tag (eg. WAVE_FORMAT_ADPCM) should be specified in the HIWORD. - format
- Type: Un4seen.BassWAVEFormatTag
The wanted codec format (use one of the WAVEFormatTag flags, or see the MMREG.H file for more).
Return Value
Type: ACMFORMATIf successful, an instance of the generic codec format ACMFORMAT is returned, else is returned. Use BASS_ErrorGetCode to get the error code.
Remarks
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 CODE | Description |
---|---|
BASS_ERROR_HANDLE | handle is not valid. |
BASS_ERROR_NOTAVAIL | There are no codecs available that will accept the channel's format. |
BASS_ERROR_ACM_CANCEL | The user pressed the "cancel" button. |
BASS_ERROR_UNKNOWN | Some other mystery problem! |
Examples
ACMFORMAT codec = BassEnc.BASS_Encode_GetACMFormat(channel, "Select your encoder", BASSACMFormat.BASS_ACM_DEFAULT, WAVEFormatTag.UNKNOWN); if ( codec != null ) { // begin encoding using the codec BassEnc.BASS_Encode_StartACMFile( channel, codec, BASSEncode.BASS_ENCODE_DEFAULT, "acm.wav"); }
See Also