Exemplo n.º 1
0
int CSound::Startmusic(char *song)
{

	songname = song;
	CurrentSong = FSOUND_Stream_OpenFile(song,FSOUND_LOOP_NORMAL,0);

	
	//if (!CurrentSong)
	//{
		//printf("Error Loading!\n");
		//printf("%s\n", FMOD_ErrorString(FSOUND_GetError()));
	//	return 1;
	//}
	FSOUND_Stream_Play(0,CurrentSong);
	SetMusicVolume(MUSIC_VOLUME); // be adam: stream play seems to reset the music volume
//	ret = FMUSIC_PlaySong(CurrentSong);
	
//	if (!ret)
	{
		//printf("Error Playing!\n");
		//printf("%s\n", FMOD_ErrorString(FSOUND_GetError()));
//		return 2;
		//printf("Press Any Key.\n");
	}
//	getchar();
	return 0;
}
Exemplo n.º 2
0
/**	Loads a Sound stream
 *
 *	@param filename		The name of the stream file
 *
 *	@returns boolean true or false, depending on whether the stream loaded or not
 */
bool FMODStreamBuffer::Load(std::string filename)
{
	m_stream = FSOUND_Stream_OpenFile(filename.c_str(), FSOUND_NORMAL, 0);

	FSOUND_Stream_SetEndCallback(m_stream,StreamEndCallback,(int)this);

	if(m_stream != NULL) return true;

	return false;
}
Exemplo n.º 3
0
MusicStream::MusicStream(const std::string& filename) {
    // Don't load music in debug mode
    #ifdef _DEBUG
        music   = NULL;
    #else
        music   = FSOUND_Stream_OpenFile(filename.c_str(), FSOUND_LOOP_NORMAL, 0);
    #endif
    playing = false;
    channel = 0;
}
 bool Load( const char *file )
 {
     m = FSOUND_Stream_OpenFile( file, FSOUND_NORMAL|FSOUND_MPEGACCURATE, 0 );
     return true;
 }