Basically (After you set your IDE up):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
#include <bass.h>
int main()
{
HSTREAM your_audio_stream = BASS_StreamCreateFile(0,
"path\\to\\your\\sound\\file",0,0,0); // load it
if(your_audio_stream)
{
BASS_ChannelPlay(your_audio_stream,1); // play it
while(BASS_ChannelIsActive(your_audio_stream) == BASS_ACTIVE_PLAYING)
// is it still playing?
{
Sleep(0); // while the sound is playing, wait a bit.
}
}
BASS_StreamFree(your_audio_stream); // we don't need you anymore
BASS_Free();
return 0;
}
|
Besides, if you go into the "c" folder, you have the examples.
The compiled examples are in the "c\bin" folder.
You also have a .chm guide file.
It also works with MP3 and OGGs.
If you plan on using plugins, you're able to play a wider variety of files (FLAC and WMA mainly).
I posted an example recently in another topic, but it was for layered windows.
This example features the Bass library.
/!\ This is an EXECUTABLE file! Please SCAN IT WITH AN ANTIVIRUS BEFORE RUNNING IT!
/!\
https://dl.dropboxusercontent.com/u/83943521/Apps/layered.rar
The Bass features used in this examples are the loading and playing of a sound file (obviously) and also it gets me the spectrum of the currently playing sound at the currently playing place.
Cold circles = Basses playing
Hot circles = Highs playing
Another example featuring plugins is here:
/!\ This is an EXECUTABLE file! Please SCAN IT WITH AN ANTIVIRUS BEFORE RUNNING IT!
/!\
https://dl.dropboxusercontent.com/u/83943521/Apps/CSP.rar