Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / The new CreateMusicFromOGGMemblock() and asset protection of OGG music

Author
Message
jd_zoo
5
Years of Service
User Offline
Joined: 12th May 2018
Location: Nova Scotia
Posted: 27th Jun 2021 22:48
I have been dealing with playing OGG music and wanting to delete the file after extracting it from a protected zip, the music stops playing because it needs to constantly read from the file on disk.

There is a new command from the February update that will take a raw memblock file and convert it to music. This loads the compressed file into memory and seems to be able to play music directly from it. Exactly what I needed to protect my music assets.



Thank you to TGC for this adding feature and updating the online documentation!

https://www.appgamekit.com/documentation/Reference/Memblock/CreateMusicFromOGGMemblock.htm
https://www.thegamecreators.com/post/appgamekit-classic-20210210-latest-version-released
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 28th Jun 2021 00:20 Edited at: 28th Jun 2021 00:24
i assume we can also DeleteMemblock() once we CreateMusicFromOGGMemblock() and game_music will remain available?

also, i didnt realize the OGG was accessed during play. do you know if, since it's no longer accessing a file, the ~0.5 sec minimum duration* for sound files to play properly is eliminated?

*on WIN systems, at least?
[My Itch.io Home] [Community Apps on Itch.io]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=agk] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[AGK Showcase][Google Forum Search]
jd_zoo
5
Years of Service
User Offline
Joined: 12th May 2018
Location: Nova Scotia
Posted: 28th Jun 2021 22:15
VN - confirmed two things:

1) Yes you can delete the memory block after creating the sound file, the data must be transferred into another part of memory in the background and the music ID is referencing that.
2) I just tired a 0.4 second OGG file from Kenney and played no problem (although this is for sound and not music)


jd_zoo
5
Years of Service
User Offline
Joined: 12th May 2018
Location: Nova Scotia
Posted: 28th Jun 2021 22:17
Looks like CreateMusicFromOGGMemblock() and CreateSoundFromOGGMemblock() will need to get added to the forums AppGameKit code switch, is that a mod thing or something TGC control?
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 2nd Jul 2021 02:56 Edited at: 2nd Jul 2021 02:56
Quote: "shBrushAGK.js"

i've sent an updated file to thenext. hopefully it will be added soon.
we're at 1878 commands now
[My Itch.io Home] [Community Apps on Itch.io]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=agk] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[AGK Showcase][Google Forum Search]

Login to post a reply

Server time is: 2024-03-28 22:22:02
Your offset time is: 2024-03-28 22:22:02