How to play a ogg

BlitzMax Forums/BlitzMax Beginners Area/How to play a ogg

Josepho(Posted 2006) [#1]
Hi, anybody can tell me a code example of how to play an ogg in bmax using the bmax functions?

I have been trying but it returns me a memory error :(


GfK(Posted 2006) [#2]
mySound:TSound = LoadSound("mysound.ogg")
PlaySound mySound



Josepho(Posted 2006) [#3]
Graphics 800,600

Local music:TSound = LoadSound ("charlotte1.ogg",True)
Local canal1:TChannel = AllocChannel()

Repeat

Cls

PlaySound (musica_level1, canal1)

Flip

Until KeyHit(KEY_ESCAPE)

This returnsme an "Unhandled Memory Exception Error"

Why?


tonyg(Posted 2006) [#4]
What is 'musica_level1'? Try setting debug mode as well.


Josepho(Posted 2006) [#5]
i dont know why but it seems to work now O_oU


tonyg(Posted 2006) [#6]
What? That code you posted, you never changed it at all and it now WORKS? That's absolutely amazing.


H&K(Posted 2006) [#7]
i dont know why but it seems to work now

You didnt by any chance make "musica_level1" and "music" the same label did you?


Josepho(Posted 2006) [#8]
nah that wasnt the problem i change the name of the variables to paste it here and i forget changing the second one


tonyg(Posted 2006) [#9]
What? So you're saying everything was correct but you still got an "Unhandled Memory Exception Error". Then, without changing anything it suddenly began to work? Why that's just crazy!


H&K(Posted 2006) [#10]
Not Crazy, just very very very wierd.

Mind you, Ive had something give an error, then without changeing anything recompiled, and it worked.


Panno(Posted 2006) [#11]
Graphics 800,600

Local music:TSound = LoadSound ("o:\frohe ostern.ogg",True)
Global canal1:TChannel = AllocChannel()

Cls

PlaySound (music, canal1)

Flip
Repeat
Until KeyHit(KEY_ESCAPE)


Brucey(Posted 2006) [#12]
Using SuperStrict should help uncover bugs too, me thinks.

:-)


Grey Alien(Posted 2006) [#13]
It's really important to use Stop Channel or the ogg will stay in memory = big fat memory leak.