2016-09-21 20:04:24

Hello.
Tell me please.
Here is my code:
sound so;
void main ()
{
so.load ( "sounds / so.wav");
so.play_wait ();
}
how to make sounds.dat? how to play? please give an example.

2016-09-22 00:44:40

Firstly, you will need to find out how the pack_file object works. Instructions are in the read me. The basic steps are this:

1. Open a pack file.
2. Add the sound/sounds to the pack file.
3. Close the pack file.
4. Set your sound storage to the pack file.
5. Play the sound giving the name you called it when adding to the pack file.


Hope that helps!

I've been going by Bryn, which is now reflected in my profile. Please do your best to respect this :) Mess ups are totally OK though, I don't mind and totally understand!
Follow on twitter! @ItsBrynify
Thanks, enjoy, thumbs up, share, like, hate, exist, do what ya do,
my website: brynify.me

2016-09-22 03:32:48

I need an example.

2016-09-22 18:03:44

Go read the documentation and add files to your pack. But, here's how you would take the files for use in the game.
sound s;
void main()
{
set_sound_storage("*");
// this assumes you want to pack the files in your executable. Otherwise, replace the "*" with "sounds.dat"
set_sound_decryption_key("somestupidkey", true);
s.load("something.ogg");
s.play();
}

2016-09-23 03:58:21

To add a file to your pack:

pack file pf;
void main()
{
pf.open("pack.dat");
pf.add_file("sounds/soundname.ogg","soundname.ogg");
pf.close();
}

and how would we read from this?

sound test;
void main()
{
set_sound_storage("pack.dat");
test.load("soundname.ogg");
test.play_wait();
}

Hope that helps!

I've been going by Bryn, which is now reflected in my profile. Please do your best to respect this :) Mess ups are totally OK though, I don't mind and totally understand!
Follow on twitter! @ItsBrynify
Thanks, enjoy, thumbs up, share, like, hate, exist, do what ya do,
my website: brynify.me