[Gambas-user] is possible to "inglobe" data (audio, video, etc) into gambas code?

Bruce Steers bsteers4 at gmail.com
Sun Sep 17 14:00:02 CEST 2023


On Sun, 17 Sept 2023 at 00:48, <roberto.premoli at tiscali.it> wrote:

> hello,
> my need is ti advise the user with sound: i just discovered how to play a
> audio with
>
> music.load("/path/to/clip.mp3")
> music.play()
>
> and it run smooth.
>
> Anyway, it coud happen that clip.mp3 can be corrupted, deleted, etc.
>
> So the qeustion is:
>
> it is possible to "inglobe" int into the source code of gambas?
>
> it will allow me to avoid to manage the extenal clip.mp3 because it will
> be always inside the program.
>
> As alternative, is possible to generate some advise sound equivalent to
> "allert", "incamig call", "new mail", etc with primitive of gambas without
> use external audio sounds clip?
>
> Thanks,
> Roberto
>

do you just mean "include" your sound files with the executable?

that is fairly simple.
Just create a folder in your project directory, for example "sounds"  (you
must not use .hidden folder names unless it's name is .public)
Put your clip.mp3 file into the sounds folder then access it like this..

music.load("./sounds/clip.mp3")
or
music.load("sounds/clip.mp3")

BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230917/2b462957/attachment.htm>


More information about the User mailing list