BASS_CHANNELINFO structure


Used with BASS_ChannelGetInfo to retrieve information on a channel.

typedef struct {
    DWORD freq;
    DWORD chans;
    DWORD flags;
    DWORD ctype;
    DWORD origres;
    HPLUGIN plugin;
    HSAMPLE sample;
    char *filename;
} BASS_CHANNELINFO;

Members

freqDefault playback rate.
chansNumber of channels... 1=mono, 2=stereo, etc.
flagsA combination of these flags.
BASS_SAMPLE_8BITSThe channel's resolution is 8-bit. If neither this or the BASS_SAMPLE_FLOAT flags are present, then the channel's resolution is 16-bit.
BASS_SAMPLE_FLOATThe channel's resolution is 32-bit floating-point.
BASS_SAMPLE_LOOPThe channel is looped.
BASS_SAMPLE_3DThe channel has 3D functionality enabled.
BASS_SAMPLE_SOFTWAREThe channel is NOT using hardware mixing.
BASS_SAMPLE_VAMThe channel is using the DX7 voice allocation and management features. (HCHANNEL only)
BASS_SAMPLE_MUTEMAXThe channel is muted when at (or beyond) its max distance. (HCHANNEL)
BASS_SAMPLE_FXThe channel has the "with FX flag" DX8 effect implementation enabled. (HSTREAM/HMUSIC)
BASS_STREAM_RESTRATEThe internet file download rate is restricted. (HSTREAM)
BASS_STREAM_BLOCKThe internet file (or "buffered" user file) is streamed in small blocks. (HSTREAM)
BASS_STREAM_AUTOFREEThe channel will automatically be freed when it ends. (HSTREAM/HMUSIC)
BASS_STREAM_DECODEThe channel is a "decoding channel". (HSTREAM/HMUSIC/HRECORD)
BASS_MUSIC_RAMPThe MOD music is using "normal" ramping. (HMUSIC)
BASS_MUSIC_RAMPSThe MOD music is using "sensitive" ramping. (HMUSIC)
BASS_MUSIC_SURROUNDThe MOD music is using surround sound. (HMUSIC)
BASS_MUSIC_SURROUND2The MOD music is using surround sound mode 2. (HMUSIC)
BASS_MUSIC_NONINTERThe MOD music is using non-interpolated mixing. (HMUSIC)
BASS_MUSIC_FT2MODThe MOD music is using FastTracker 2 .MOD playback. (HMUSIC)
BASS_MUSIC_PT1MODThe MOD music is using ProTracker 1 .MOD playback. (HMUSIC)
BASS_MUSIC_STOPBACKThe MOD music will be stopped when a backward jump effect is played. (HMUSIC)
BASS_SPEAKER_xxxSpeaker assignment flags. (HSTREAM/HMUSIC)
BASS_UNICODEfilename is in UTF-16 form.
other flags may be supported by add-ons, see the documentation.
ctypeThe type of channel it is, which can be one of the following.
BASS_CTYPE_SAMPLESample channel. (HCHANNEL)
BASS_CTYPE_STREAMUser sample stream. This can also be used as a flag to test if the channel is any kind of HSTREAM.
BASS_CTYPE_STREAM_OGGOgg Vorbis format stream.
BASS_CTYPE_STREAM_MP1MPEG layer 1 format stream.
BASS_CTYPE_STREAM_MP2MPEG layer 2 format stream.
BASS_CTYPE_STREAM_MP3MPEG layer 3 format stream.
BASS_CTYPE_STREAM_AIFFAudio IFF format stream.
BASS_CTYPE_STREAM_CACoreAudio codec stream. Additional format information is avaliable from BASS_ChannelGetTags (BASS_TAG_CA_CODEC).
BASS_CTYPE_STREAM_MFMedia Foundation codec stream. Additional format information is avaliable from BASS_ChannelGetTags (BASS_TAG_WAVEFORMAT).
BASS_CTYPE_STREAM_WAV_PCMInteger PCM WAVE format stream.
BASS_CTYPE_STREAM_WAV_FLOATFloating-point PCM WAVE format stream.
BASS_CTYPE_STREAM_WAVWAVE format flag. This can be used to test if the channel is any kind of WAVE format. The codec (the file's "wFormatTag") is specified in the LOWORD. Additional information is also avaliable from BASS_ChannelGetTags (BASS_TAG_WAVEFORMAT).
BASS_CTYPE_MUSIC_MODGeneric MOD format music. This can also be used as a flag to test if the channel is any kind of HMUSIC.
BASS_CTYPE_MUSIC_MTMMultiTracker format music.
BASS_CTYPE_MUSIC_S3MScreamTracker 3 format music.
BASS_CTYPE_MUSIC_XMFastTracker 2 format music.
BASS_CTYPE_MUSIC_ITImpulse Tracker format music.
BASS_CTYPE_MUSIC_MO3MO3 format flag, used in combination with one of the BASS_CTYPE_MUSIC types.
BASS_CTYPE_RECORDRecording channel. (HRECORD)
other channel types may be supported by add-ons, see the documentation.
origresThe original resolution (bits per sample)... 0 = undefined.
pluginThe plugin that is handling the channel... 0 = not using a plugin. Note this is only available with streams created using the plugin system via the standard BASS stream creation functions, not those created by add-on functions. Information on the plugin can be retrieved via BASS_PluginGetInfo.
sampleThe sample that is playing on the channel. (HCHANNEL only)
filenameThe filename associated with the channel. (HSTREAM only)

Remarks

The BASS_SAMPLE_SOFTWARE flag indicates whether or not the channel's sample data is being mixed into the final output by the hardware. It does not indicate (in the case of a stream or MOD music) whether the processing required to generate the sample data is being done by the hardware; this processing is always done in software.

With a recording channel, the BASS_STREAM_DECODE flag indicates that it is not using a RECORDPROC callback function.

BASS supports 8/16/32-bit sample data, so if a WAV file, for example, uses another sample resolution, it will have to be converted by BASS. The origres member can be used to check what the resolution originally was.

Platform-specific

On Linux/OSX/iOS/Android, the BASS_UNICODE flag may not be present even if it was used in the stream's creation, as BASS will have translated the filename to the native UTF-8 form. On Windows CE, the opposite is true: the BASS_UNICODE flag may be present even if it was not used in the stream's creation, as BASS will have translated the filename to the native UTF-16 form.

Example

Check if a channel is an MP3 stream.
BASS_CHANNELINFO info;
BASS_ChannelGetInfo(channel, &info); // get info
if (info.ctype==BASS_CTYPE_STREAM_MP3) {
    // it's an MP3!
}

See also

BASS_ChannelGetInfo