#include <iostream> #include <string> #include <map> #include "..\sdk\bass\include\bass.h" #pragma comment(lib,"..\\sdk\\bass\\lib\\bass.lib") typedef std::map < std::string, HSTREAM > MusicMap; int main() { int Volume = 100; :: std String Music_Name = " exclusive hard goods .mp3 " ; The Init HSTREAM = 0 ; // stream handler MusicMap Music; BASS_Init(-1,44100,0,0,0); BASS_SetConfig(BASS_CONFIG_GVOL_STREAM,Volume * 100); // Create a laminated belt MusicMap Iterator _findReturn :: = Music.find (Music_Name); Init = BASS_StreamCreateFile (FALSE, Music_Name.c_str (), 0 , 0 , BASS_SAMPLE_LOOP); // get the stream handler Music.insert (the make_pair (Music_Name, init)); // written list BASS_ChannelPlay (init, TRUE); / / playback System ( " PAUSE " ); for (I = Music.begin MusicMap :: Iterator ();! I = Music.end (); I ++ ) { BASS_StreamFree(i->second); } Music.clear(); BASS_Free(); system("pause"); return 0; }