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
freq | Default playback rate.
|
chans | Number of channels... 1=mono, 2=stereo, etc.
|
flags | A combination of these flags.
BASS_SAMPLE_8BITS | The 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_FLOAT | The channel's resolution is 32-bit floating-point.
| BASS_SAMPLE_LOOP | The channel is looped.
| BASS_SAMPLE_3D | The channel has 3D functionality enabled.
| BASS_SAMPLE_SOFTWARE | The channel is NOT using hardware mixing.
| BASS_SAMPLE_VAM | The channel is using the DX7 voice allocation and management features. (HCHANNEL only)
| BASS_SAMPLE_MUTEMAX | The channel is muted when at (or beyond) its max distance. (HCHANNEL)
| BASS_SAMPLE_FX | The channel has the "with FX flag" DX8 effect implementation enabled. (HSTREAM/HMUSIC)
| BASS_STREAM_RESTRATE | The internet file download rate is restricted. (HSTREAM)
| BASS_STREAM_BLOCK | The internet file (or "buffered" user file) is streamed in small blocks. (HSTREAM)
| BASS_STREAM_AUTOFREE | The channel will automatically be freed when it ends. (HSTREAM/HMUSIC)
| BASS_STREAM_DECODE | The channel is a "decoding channel". (HSTREAM/HMUSIC/HRECORD)
| BASS_MUSIC_RAMP | The MOD music is using "normal" ramping. (HMUSIC)
| BASS_MUSIC_RAMPS | The MOD music is using "sensitive" ramping. (HMUSIC)
| BASS_MUSIC_SURROUND | The MOD music is using surround sound. (HMUSIC)
| BASS_MUSIC_SURROUND2 | The MOD music is using surround sound mode 2. (HMUSIC)
| BASS_MUSIC_NONINTER | The MOD music is using non-interpolated mixing. (HMUSIC)
| BASS_MUSIC_FT2MOD | The MOD music is using FastTracker 2 .MOD playback. (HMUSIC)
| BASS_MUSIC_PT1MOD | The MOD music is using ProTracker 1 .MOD playback. (HMUSIC)
| BASS_MUSIC_STOPBACK | The MOD music will be stopped when a backward jump effect is played. (HMUSIC)
| BASS_SPEAKER_xxx | Speaker assignment flags. (HSTREAM/HMUSIC)
| BASS_UNICODE | filename is in UTF-16 form.
|
other flags may be supported by add-ons, see the documentation.
|
ctype | The type of channel it is, which can be one of the following.
BASS_CTYPE_SAMPLE | Sample channel. (HCHANNEL)
| BASS_CTYPE_STREAM | User sample stream. This can also be used as a flag to test if the channel is any kind of HSTREAM.
| BASS_CTYPE_STREAM_OGG | Ogg Vorbis format stream.
| BASS_CTYPE_STREAM_MP1 | MPEG layer 1 format stream.
| BASS_CTYPE_STREAM_MP2 | MPEG layer 2 format stream.
| BASS_CTYPE_STREAM_MP3 | MPEG layer 3 format stream.
| BASS_CTYPE_STREAM_AIFF | Audio IFF format stream.
| BASS_CTYPE_STREAM_CA | CoreAudio codec stream. Additional format information is avaliable from BASS_ChannelGetTags (BASS_TAG_CA_CODEC).
| BASS_CTYPE_STREAM_MF | Media Foundation codec stream. Additional format information is avaliable from BASS_ChannelGetTags (BASS_TAG_WAVEFORMAT).
| BASS_CTYPE_STREAM_WAV_PCM | Integer PCM WAVE format stream.
| BASS_CTYPE_STREAM_WAV_FLOAT | Floating-point PCM WAVE format stream.
| BASS_CTYPE_STREAM_WAV | WAVE 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_MOD | Generic MOD format music. This can also be used as a flag to test if the channel is any kind of HMUSIC.
| BASS_CTYPE_MUSIC_MTM | MultiTracker format music.
| BASS_CTYPE_MUSIC_S3M | ScreamTracker 3 format music.
| BASS_CTYPE_MUSIC_XM | FastTracker 2 format music.
| BASS_CTYPE_MUSIC_IT | Impulse Tracker format music.
| BASS_CTYPE_MUSIC_MO3 | MO3 format flag, used in combination with one of the BASS_CTYPE_MUSIC types.
| BASS_CTYPE_RECORD | Recording channel. (HRECORD)
|
other channel types may be supported by add-ons, see the documentation.
|
origres | The original resolution (bits per sample)... 0 = undefined.
|
plugin | The 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.
|
sample | The sample that is playing on the channel. (HCHANNEL only)
|
filename | The 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