Hello,
I'm not sure if somethings gotten lost in translation
I'm not experiencing any issues with sound or Music in 2.0.14b,
But I can confirm that it does work with the If statement removed as well.
This code has not been optimised, I'm migrating it to a sound manager set of functions, that was a wrapper before I added an extra layer of checks.
MP3's no problem, WAV's no problem.
Sandman could add some additional checks before loading the mp3 file.
i.e.
// Check to see if File Exists
fileOk = GetFileExists("hgsdhgasdh.mp3")
// If FILE Can Not be located, display an error.
if(fileOK = 0)
Message("Unable to locate music")
exitfunction -1
endif
Or create a set of functions for handling and error handling music file loads (but that would be overkill)
type musicInfo
musicID as integer // AGK Music ID when created
musicName as string // Filename of the Music
musicLoop as integer // Should this music loop?
musicVolume as integer // initial volume of this sound.
endtype
...
...
...
//
// Check file exists and then load into memory
// Report error if File Not Found.
//
function loadMusicFromFile(musicName as string, musicLoop as integer, volume as integer)
// Check to see if File Exists
fileOk = GetFileExists(musicName)
// If FILE Can Not be located, display an error.
if (fileOK = 0)
Message("Unable to locate File : " + musicName)
exitfunction -1
endif
// Check the music has not already been assigned/loaded
result = checkMusicInLinkedList(musicName)
// result will contain either 0 or the MusicID if already assigned
if(result) then exitfunction result
// Define the Sound Type
music as Musicinfo
// Define the Type
music.musicID = LoadMusic(musicName)
music.musicName = musicName
music.musicLoop = musicLoop
music.musicVolume = volume
// Add the type to the Linked List
g_iMusicArray.insert(music)
endfunction music.musicID
[href]https://www.facebook.com/WonkyPix
http://www.wonkypix.com
http://www.appstore.com/jsecconsultancyltd[/href]