Hi, how can I use a windows sound file ( ......wav ) as resource file in fnxbasic? I will make my project as one exe-file, without the many extra wav-files.
Thx
PaPi
use wav file as resource file
use wav file as resource file
Hi,
I am afraid it is not possible to play the wav file as a resource file.
Simply because windows playsound api (playwav for fnx) support only to play wav files. However you can extract the resourc wav file if your application start with the following code:
resource wav1 as "test1.wav"
dim f as filestream
if fileexists("test.wav")=false then
f.open("test.wav")
f.loadresource(wav1)
f.Close
end if
I hope you are satisfied with this solution
Best regards marco
I am afraid it is not possible to play the wav file as a resource file.
Simply because windows playsound api (playwav for fnx) support only to play wav files. However you can extract the resourc wav file if your application start with the following code:
resource wav1 as "test1.wav"
dim f as filestream
if fileexists("test.wav")=false then
f.open("test.wav")
f.loadresource(wav1)
f.Close
end if
I hope you are satisfied with this solution
Best regards marco
use wav file as resource file
I don`t quite get the idea, bat it work freely. Thanks :)
PaPi
PaPi
use wav file as resource file
Hi,
with this code you load the resource wav1 into the file test1, in other words you create a real file from a resource file.
best regards
with this code you load the resource wav1 into the file test1, in other words you create a real file from a resource file.
best regards
use wav file as resource file
Yes, I see. But not: "into the file test1", rather: "into the file test" , I think.
PaPi
PaPi
use wav file as resource file
You are right about it it is loaded into the file test, after use you can erase the file with the command kill, if you wish to do that.