Free alternatives for MaxMod?

BlitzMax Forums/BlitzMax Programming/Free alternatives for MaxMod?

christian223(Posted 2009) [#1]
I have a casual game that does not work on some machines because im using maxmod, when i disable maxmod on the game it runs fine, so im looking for free alternatives to it. I have been told a couple of times that BASS works fine on all machines, but it costs money, are there any other free alternatives?. By the way, i use MaxMod just becuase of its ogg streaming capabilities, that's the only thing im interested about.

Thankyou.


xlsior(Posted 2009) [#2]
MaxMod has gotten a few major rewrites over the years, including different audio drivers -- perhaps one of the older revisions works OK for you?

Also, what do you mean by 'does not work'? does the application crash, or does the sound not play at all, or do things sound really weird?


christian223(Posted 2009) [#3]
The application crashes (the application starts and immediately closes itself), if i disable the sound it runs fine. The thing is, it works in many computers including 3 of my computers, but in some others it doesn't.

Should i try using MaxMod2?.


REDi(Posted 2009) [#4]
Hi christian223

Apologies that your having problems with maxmod, I'd be interested in knowing more about the machine that's having problems with it, system spec, what audio driver causes the crash, what maxmods doing when the crash happens etc.

re MaxMod2, it's awaiting its initial release (the currently available beta version is quite old and I've sorted out a lot of possible issues since then), and will probably need a lot of testing prior to being used in anything commercial.

FMOD and Bass are both brilliant, but not free and I don't know any free libs as of yet.


christian223(Posted 2009) [#5]
Thanks a lot for replying REDi.

The driver used is OpenAL, wich i included on the game installer.

The problem arises in Vista-64 and XP, im not really sure if it happens in others because i could not get so many testers.

At the time of the crash maxmod is doing nothig, the audiodrivers has been set but nothing else.

I can't get more info, i wish i could but i don't posess a machine where i can test it with more details.


REDi(Posted 2009) [#6]
are you shipping the openal32.dll with your app by any chance?

Because there is actually two versions openal32.dll, one for 32bit and one for 64bit computers, but they are both called openal32.dll, yeah strange but true. :/

I would suggest shipping the openal installer with your product and then you know the correct driver is available. You could even have the installer launch silently from your own game installer.


GaryV(Posted 2009) [#7]
Free alternatives for MaxMod?


AUDIERE

http://audiere.sourceforge.net/

It works great. I am not sure why people are afraid to use it.


christian223(Posted 2009) [#8]
Yes, i did include the OpenAL installer in the game installer, i made sure the users installed it but the problem remains.


REDi(Posted 2009) [#9]
hmmm interesting, can I ask which version of oalinst your using?

newest version is here (version 2.0.3)... http://connect.creativelabs.com/openal/Downloads/Forms/AllItems.aspx

BTW if you want the oal installer to launch silently you just put -s as the args, it will only install if it's needed and your user neednt know anything about it ;)

@GaryV, nice find, looks pretty cool.


christian223(Posted 2009) [#10]
Im using the one called "oalinst" Updated Summer 2007 : Version 2.0.3

Audiere has no mods for Bmax?, it is not multi-platform either?, i plan to release my game on mac so i guess thats not an option. Thanks anyway. I guess I'll have to borrow some money to buy Bass...


GaryV(Posted 2009) [#11]
Audiere has no mods for Bmax?,
It is a DLL. You use it just as you would any DLL with BMax.

it is not multi-platform either?
I am not sure where you got that idea:

Audiere is portable. It is tested on Windows, Linux-i386, Cygwin, and IRIX with at least three major compilers. Most of Audiere is endian-independent, so I expect it would work with few modifications on other architectures.

Mac support? Who knows or cares, but it does answer the question asked in the original post. It is a free alternative.


SebHoll(Posted 2009) [#12]
REDi, you may want to look at christian223's original thread if that's of any help.


REDi(Posted 2009) [#13]
At the time of the crash maxmod is doing nothig, the audiodrivers has been set but nothing else.


Calling SetAudioDriver doesn't make maxmod do anything at all, it's only when you actually call CreateAudioStream that maxmod detects which driver to use, so this does seem to be a problem with openal itself.

Have you tried the directsound driver?

*EDIT* Thanks Seb, I hadn't seen that!


REDi(Posted 2009) [#14]
hmm that demo even crashs on my machine :/ investigating...

which sound file is played first?

*EDIT* I've tried all the accompanying audio files with maxmod and the openal driver with no problems, but the actual demo doesn't run on my machine.

If you fancy sending me the source (maybe a cut down version or just the menu or something if you prefer) I can figure out whats going on for you.


christian223(Posted 2009) [#15]
That would be great REDi, I'll send you a short version of the code so you can run it later. Thx.


christian223(Posted 2009) [#16]
Here is the code, it should run as it is, comment the REMs to make it not work, Thanks a lot!:

'T_Sound
'T_MusicaStream

rem 'Uncomment to make it not work
Import MaxMod.AudioStream
Import MaxMod.OGG
endrem


Strict



rem 'Uncomment to make it not work
If EnableOpenALAudio()
	SetAudioDriver("openal")
	print "OpenAL driver"

Else
	SetAudioDriver("DirectSound")
	print "Directound Driver"

EndIf

Local SoDrivers:String[] = AudioDrivers()


For Local sd:Int = 0 To 9
	Print "Sound driver " + sd + ": " + SoDrivers[sd]

Next

endrem

'----------------------------------------------------------------------------------------------------------------------------------------
'	Objeto pra manejar la musica del juego usando un metodo de streaming de MaxMod
'------------------------------------------------------------------------------------------------


Type T_MusicaStream
	Global Me:T_MusicaStream
	Field Channel:TChannel
	Field File:String = "MenuPrincipal.ogg"'indica el nombre del ARCHIVO de la cancion
	Field SongIndex:Byte = 0'el index de la cancion, el id, el numero,usado para ir cambiando de cancion
	Field LoopSong:Byte = False
	
	Field Active = True
	
	Function Createme:T_MusicaStream()
		Local inst:T_MusicaStream = New T_MusicaStream
		
		T_MusicaStream.Me = inst
		inst.LoadSong()
		rem 'Uncomment to make it not work
		inst.UpdateVolume()
		ResumeChannel(inst.Channel)
		endrem
		
		Return inst
	End Function
	
	Method LoadSong()
		If Not Active Then Return
		rem 'Uncomment to make it not work
		Channel = CreateAudioStream(file, LoopSong, True)
		if channel=null then runtimeerror "Unable to play Music."
		UpdateVolume()
		ResumeChannel(Channel)
		endrem
	EndMethod
	
	Method ShuffleSong()
		songindex = Rand(3, 6)
		
		
		SetFile()
		rem 'Uncomment to make it not work
		If channel Then StopChannel(Channel)
		LoadSong()
		endrem
	End Method
	
	Method ChangeSong(index0:Int)
		If Channel Then StopChannel(Channel)
		SongIndex = index0
		SetFile()
		LoadSong()
	End Method
	
	Method SetFile()
		Select SongIndex
			Case 0
				File = "MenuPrincipal.ogg"
			Case 1
				File = "HighScores.ogg"
			Case 2
				File = "EndLevel.ogg"
			Case 3
				File = "Juego.ogg"
			Case 4
				File = "CanonD.ogg"
			Case 5
				File = "NocturneF.ogg" 
			Case 6
				File = "ToccataF.ogg"
				
		End Select		
	End Method
	
	Method Update_Me()
		CheckSongEnd()
	End Method
		
	Method UpdateVolume()
		rem 'Uncomment to make it not work
		'Channel.SetVolume(T_profile.Me.byte_Volume_Music * (1.0 / 255))
		'Channel.SetVolume(1.0)
		endrem
	End Method
	
	Method CheckSongEnd()
		If Not (Channel.Playing())
			If Not SongIndex < 2
				LoopSong = False'para que no repita la cancion y shufflee cuando termine una
		 		ShuffleSong()
		 	Else
				LoopSong = True	'para que repita las canciones que no pertenezcan al gameplay
			EndIf
		EndIf
	End Method
	 
End Type


'----------------------------------------------------------------------------------------------------------------------------------------
'	Objeto de sonido usado por el manager de sonidos Type T_Sound_Player
'------------------------------------------------------------------------------------------------


Type T_Sound
	Field File:String = ""'indica el nombre del ARCHIVO de la cancion
	Field SoundObj:TSound
	Field SoundID:String
	Field SoundNumber:Int
	Field Channel:TChannel
	
	Function Createme:T_Sound(SfxFile:String, SfxId:String, Player_List:T_Sound[], iDnumber:Int)'url, id para usarlo, array del objeto playerlist,numero de id para localizarlo en array
		Local inst:T_Sound = New T_Sound
		
		inst.File = SfxFile
		inst.SoundID = SfxId
		
		inst.SoundObj = LoadSound(SfxFile)
		If inst.SoundObj = Null RuntimeError "Couldn't load the sound sample!"
		
		Player_List[iDnumber] = inst

		
		Return inst
	End Function
	
    	
	Method Update_Me()
		rem 'Uncomment to make it not work
		CheckSfxEnd()
		endrem
	End Method	
		
	Method CheckSfxEnd()
		If Not(Channel = Null)
		 If Not (Channel.Playing()) Then StopChannel(Channel) ;Channel = Null ';Print "sonido borrado"
		EndIf
	End Method
	
End Type

'----------------------------------------------------------------------------------------------------------------------------------------
'	Objeto que maneja todos los sonidos del juego, se cargan con LoadSFX() overraideandolo y
'	luego cada uno se debe cargar usando el metodo 	PlaySfx(id del sonido)
'------------------------------------------------------------------------------------------------

Type T_Sound_Player
	Global Me:T_Sound_Player
	Field Channel:TChannel
	Field SoundsArray:T_Sound[20]
	
	Field Active = true
	
	Function Createme:T_Sound_Player()
		Local inst:T_Sound_Player = New T_Sound_Player
		
		T_Sound_Player.me = inst
		inst.LoadSFX()
		
		
		Return inst
	End Function
	
	Method LoadSFX()'carga todos los sonidos del juego

		T_Sound.Createme("Boton.ogg", "Boton", Self.SoundsArray, 0)
		T_Sound.Createme("Comprar.ogg", "Comprar", Self.SoundsArray, 1)
		T_Sound.Createme("ExitoCarita.ogg", "Exito Carita", Self.SoundsArray, 2)
		T_Sound.Createme("Simbolos.ogg", "Simbolos", Self.SoundsArray, 3)
		T_Sound.Createme("Coinc-Niv1.ogg", "Coinc-Niv1", Self.SoundsArray, 4)
		T_Sound.Createme("Coinc-Niv2.ogg", "Coinc-Niv2", Self.SoundsArray, 5)
		T_Sound.Createme("Coinc-Niv3.ogg", "Coinc-Niv3", Self.SoundsArray, 6)
		T_Sound.Createme("Coinc-Niv4.ogg", "Coinc-Niv4", Self.SoundsArray, 7)
		T_Sound.Createme("Coinc-Niv5.ogg", "Coinc-Niv5", Self.SoundsArray, 8)
		T_Sound.Createme("Coinc-Niv6.ogg", "Coinc-Niv6", Self.SoundsArray, 9)
		T_Sound.Createme("Coinc-Niv7.ogg", "Coinc-Niv7", Self.SoundsArray, 10)
		T_Sound.Createme("Contador.ogg", "Contador", Self.SoundsArray, 11)
		T_Sound.Createme("Deshacer.ogg", "Deshacer", Self.SoundsArray, 12)
		T_Sound.Createme("Enojo.ogg", "Enojo", Self.SoundsArray, 13)
		T_Sound.Createme("Operacion.ogg", "Operacion", Self.SoundsArray, 14)
		T_Sound.Createme("SumaValor.ogg", "SumaValor", Self.SoundsArray, 15)
		T_Sound.Createme("Vender.ogg", "Vender", Self.SoundsArray, 16)
		T_Sound.Createme("RestaValor.ogg", "RestaFel", Self.SoundsArray, 17)
		T_Sound.Createme("Calculo-Cortina.ogg", "CalculoCortina", Self.SoundsArray, 18)
				
	EndMethod
	
	Method CueSoundObj(IdNumber)
		rem 'Uncomment to make it not work
		Local ActualSound:TSound = T_Sound(SoundsArray[IdNumber]).SoundObj
		
		Channel = CueSound(ActualSound)
		T_Sound(SoundsArray[IdNumber]).Channel = Channel
		
		endrem
	End Method
		
	Method PlaySfx(sfxId:String = "")
	
		Select sfxId
			Case "Boton"
				CueSoundObj(0)
				
			Case "Comprar"
				CueSoundObj(1)
				
			Case "Exito Carita"
				CueSoundObj(2)
				
			Case "Simbolos"
				CueSoundObj(3)
				
			Case "Coinc-Niv1"
				CueSoundObj(4)
				
			Case "Coinc-Niv2"
				CueSoundObj(5)
				
			Case "Coinc-Niv3"
				CueSoundObj(6)
				
			Case "Coinc-Niv4"
				CueSoundObj(7)
				
			Case "Coinc-Niv5"
				CueSoundObj(8)
				
			Case "Coinc-Niv6"
				CueSoundObj(9)
				
			Case "Coinc-Niv7"
				CueSoundObj(10)
				
			Case "Contador"
				CueSoundObj(11)
				
			Case "Deshacer"
				CueSoundObj(12)
											
			Case "Enojo"
				CueSoundObj(13)

			Case "Operacion"
				CueSoundObj(14)
				
			Case "SumaValor"
				CueSoundObj(15)
				
			Case "Vender"
				CueSoundObj(16)
				
			Case "RestaFel"
				CueSoundObj(17)
			
			Case "CalculoCortina"
				CueSoundObj(18)
				
			Default
				Return
		EndSelect
		
		If Not Active Then Return
		rem 'Uncomment to make it not work
		UpdateVolume()
		ResumeChannel(Channel)
		endrem
	End Method
	
			
	Method UpdateVolume()
		rem 'Uncomment to make it not work
		Channel.SetVolume(T_profile.Me.byte_Volume_sound * (1.0 / 255))
		endrem
	End Method

End Type


Graphics 800, 600, 0

While Not (KeyDown(KEY_ESCAPE)) And Not(AppTerminate())

Wend



REDi(Posted 2009) [#17]
Error = Attempt to index array element beyond array length (@line 30)

So just change this...
For Local sd:Int = 0 To 9
	Print "Sound driver " + sd + ": " + SoDrivers[sd]
Next

To this...
For Local sd:Int = 0 Until SoDrivers.length
	Print "Sound driver " + sd + ": " + SoDrivers[sd]
Next

;)


christian223(Posted 2009) [#18]
I see... a million thanks!! :)

Thanks everyone for trying to help, very appreciated :)


REDi(Posted 2009) [#19]
No problem, any time mate.

Just downloaded your new demo and it's working fine now (for me at least)


christian223(Posted 2009) [#20]
Great to hear that!, im going to keep asking others just in case. Thanks again, it's great to be in a forum where people help you :´)


popcade(Posted 2009) [#21]
Hi, REDi,

BTW, how the MaxMod2 progresses?


REDi(Posted 2009) [#22]
Hi yoko, hopefully I'll put something up within the next week or so mate, stay tuned ;)