1 (edited by gabrielschuck.tecladista 2017-01-03 11:33:28)

Topic: Trying to play mp3 file in bgt using the playSoundA () function

Hello everyone!
First, I would like to wish a happy and blessed new year of great health and peace. May 2017 be a year of great achievements!
I'm enjoying my vacations and, as I could not fail to be, venturing into the bgt language.
After you have learned about arrays and dictionaries and how to reference an object, I am trying to play mp3 file using the windows native library (Winmm.dll) through
the playSounda () function. It is not giving any runtime error, so calling the call function of the library object seems to be all ok, but when I run, nothing happens.
I used the get_keys function of the dictionary object to verify what is being returned, which seem to be only the parameters passed in the call of the playSoundA () function.
Will this work? And what am I doing wrong?
Here is the code:
library dll;
dictionary@ results;
void main(){
dll.load ("Winmm.dll");
@results=dll.call ("BOOL PlaySoundA(char*,int*);","test.wav","SND_FILENAME");
string test;
string[] t;
t=results.get_keys(); //To find out the keys
results.get(key,test); // Placing the value of any key in the variable test
}

And here's the link with more info on the playSound () function:
Https://msdn.microsoft.com/en-us/library/windows/desktop/dd743680(v=vs.85).aspx
Greetings,
Gabriel