I am writing a game that has continuous background audio that needs to play regardless of what Window is open. I would prefer it if I didn’t have to have a separate hidden Window to handle this.
I thought about using a Global Property to store the MoviePlayer but I can’t get the audio to play or the program crashes when trying to debug.
you do not need a movieplayer,
make a property ‘mysound’
dim f as FolderItem = GetFolderItem("/path/to/your/soundfile/your sound.mp3", FolderItem.PathTypeNative)
if f <> nil and f.Exists then
mysound = f.OpenAsSound
mysound.play
end if
You could write it to temporary then load i as a file from there. The sound class does not have a FromData helper like the picture class unfortunately so you can’t create it directly from the data in your database.
I use the MBS Plugins and there is a function to convert Text to a Movie and that’s what I was using. Unfortunately there is no Text to Sound function.