Sets the value of an attribute of a sample, stream or MOD music.
Namespace: Un4seen.Bass
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.17.5
Syntax
[DllImportAttribute("bass")] public static bool BASS_ChannelSetAttribute( int handle, BASSAttribute attrib, float value )
Parameters
- handle
- Type: SystemInt32
The channel handle... a HCHANNEL, HMUSIC, HSTREAM or HRECORD. - attrib
- Type: Un4seen.BassBASSAttribute
The attribute to set the value of (one of the following, see BASSAttribute):Other attributes may be supported by add-ons, e.g. BASS_FX:BASS_ATTRIB_BUFFER Playback buffering length. (HMUSIC/HSTREAM only). BASS_ATTRIB_FREQ The sample rate, 100 (min) to 100000 (max), 0 = original rate (when the channel was created). BASS_ATTRIB_GRANULE Processing granularity. (HMUSIC/HSTREAM/HRECORD). BASS_ATTRIB_MUSIC_AMPLIFY The amplification level, 0 (min) to 100 (max) rounded down to a whole number. (HMUSIC) BASS_ATTRIB_MUSIC_BPM The BPM, 1 (min) to 255 (max) rounded down to a whole number. (HMUSIC) BASS_ATTRIB_MUSIC_PANSEP The Pan separation level, 0 (min) to 100 (max), 50 = linear rounded down to a whole number. (HMUSIC) BASS_ATTRIB_MUSIC_PSCALER The Position scaler, 1 (min) to 256 (max) rounded down to a whole number. (HMUSIC) BASS_ATTRIB_MUSIC_SPEED The Speed, 0 (min) to 255 (max) rounded down to a whole number. (HMUSIC) BASS_ATTRIB_MUSIC_VOL_CHAN A channel volume level, 0 (silent) to 1 (full). (HMUSIC) BASS_ATTRIB_MUSIC_VOL_GLOBAL Global volume level. (HMUSIC) BASS_ATTRIB_MUSIC_VOL_INST An instrument/sample volume level, 0 (min) to 64 (max, 128 for IT format) rounded down to a whole number. (HMUSIC) BASS_ATTRIB_NET_RESUME The volume level, 0 (silent) to 1 (full) or above. BASS_ATTRIB_NOBUFFER Buffer level to resume stalled playback. (HSTREAM). BASS_ATTRIB_NORAMP Playback ramping switch. BASS_ATTRIB_PAN The panning/balance position, -1 (full left) to +1 (full right), 0 = centre. BASS_ATTRIB_PUSH_LIMIT Push stream buffer limit. BASS_ATTRIB_SRC Sample rate conversion quality. BASS_ATTRIB_TAIL Length extension. (HMUSIC/HSTREAM). BASS_ATTRIB_VOL The volume level, 0 (silent) to 1 (full) or above. BASS_ATTRIB_TEMPO The tempo of a channel, [-95%...0...+5000%] percents. BASS_ATTRIB_TEMPO_PITCH The pitch of a channel, [-60...0...+60] semitones. BASS_ATTRIB_TEMPO_FREQ The sample rate of a channel in Hz, but calculates by the same % as BASS_ATTRIB_TEMPO. BASS_ATTRIB_TEMPO_OPTION_USE_AA_FILTER Use the AA Filter for a tempo channel (=1, =0). BASS_ATTRIB_TEMPO_OPTION_AA_FILTER_LENGTH Sets the AA Filter length in taps (between 8 and 128). BASS_ATTRIB_TEMPO_OPTION_USE_QUICKALGO Use the tempo quick algorithm for a tempo channel (=1, =0). BASS_ATTRIB_TEMPO_OPTION_SEQUENCE_MS Sets the tempo sequence in ms. of a tempo channel (default = 82). BASS_ATTRIB_TEMPO_OPTION_SEEKWINDOW_MS Sets the tempo seek window in ms. of a tempo channel (default = 82). BASS_ATTRIB_TEMPO_OPTION_OVERLAP_MS Sets the tempo overlap in ms. of a tempo channel (default = 12). BASS_ATTRIB_REVERSE_DIR Sets the playback direction of a reverse channel (-1=reverse, 1=forward, or use one of the BASSFXReverse flags). - value
- Type: SystemSingle
The new attribute value. See the attribute's documentation for details on the possible values.
Return Value
Type: BooleanIf successful, is returned, else is returned. Use BASS_ErrorGetCode to get the error code.
Remarks
ERROR CODE | Description |
---|---|
BASS_ERROR_HANDLE | handle is not a valid channel. |
BASS_ERROR_ILLTYPE | attrib is not valid. |
BASS_ERROR_ILLPARAM | value is not valid. See the attribute's documentation for the valid range of values. |
Examples
int stream = Bass.BASS_StreamCreateFile("afile.mp3", 0, 0, BASSFlag.BASS_DEFAULT); Bass.BASS_ChannelPlay(stream, false); ... Bass.BASS_ChannelSetAttribute(stream, BASSAttribute.BASS_ATTRIB_VOL, 0.5f);
See Also