[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to embedded file/sound into executable?


As well your executable might get deleted/damaged..? I think the proper
solution is not to install everything on the users home where this kind of
accidents are more prone to happen.

Jussi



On Sat, Mar 23, 2024 at 9:45 PM <roberto.premoli@xxxxxxxxxx> wrote:

> Hello,
>
> In an program of mine, I wish to play a sound to advise the user, someting like a bell, "din din!".
> Actually i have a file din-din.wav and i play as follow:
>
>
> if condition = true then
>   if Exist("/home/user/din-din.wav") then
>     exec["aplay", "/home/user/din-din.wav"]
>   endif
> endif
>
> now my worry is that for some reason din-din.wav file get damaged, deleted, ecc,
> so it means that my application will became silent and enduser will be no more advised by sound
> when condition became true.
>
> QUESTION: Is possible to "embedded" the din-din.wav file inside the executable when i compile
> the project and play it when needed? this will make the wav file part of the executable, so it will be always available.
>
>
> Thanks,
> Roberto
>
>

References:
How to embedded file/sound into executable?roberto.premoli@xxxxxxxxxx