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 / OGG extract from ZIP

Author
Message
jd_zoo
5
Years of Service
User Offline
Joined: 12th May 2018
Location: Nova Scotia
Posted: 12th Dec 2020 02:19
Am I just having some bad luck here or does AppGameKit hang for anyone else when trying to extract an OGG music file from a ZIP?
SFSW
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location:
Posted: 12th Dec 2020 04:13
I perform extractions like that frequently in my work (Windows and Android). What platform are you trying this with? And are you zipping it within AGKS internally, then also extracting with AGKS? What is the file size of the OGG file you are working with? Is the OGG file large enough to zip, unzip, and finally load within AGKS? And lastly, are you extracting it from the \media folder, then to the \AGKApps folder in the user folder tree... or some other source and destination (one of which might be write/UAC protected)?
jd_zoo
5
Years of Service
User Offline
Joined: 12th May 2018
Location: Nova Scotia
Posted: 12th Dec 2020 17:04
Hi SFSW, this is on windows. I'm extracting images and WAV files no problem, this is the first I've started to put music into zip files with intention of adding password protection before deploying. The ZIP files are just created with windows and I'm dragging the media into them.

So I am unzipping to an "extract" folder, but like I say its the exact same for all the other media. I've tried locating the ZIP in the root media folder but no change. AppGameKit issues no messages or errors. What _IS_ happening is I am playing an OGG while the level loads (my level loading music) after which once the level is done loading the level music starts playing. This all works fine if the OGG file is sitting on its own, but hangs when the OGG is extracted from a ZIP like below:



And this is a part of the sound handler that deals with it:


So as of now looking like I'm not going to be able to ZIP protect my OGG assets...
SFSW
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location:
Posted: 15th Dec 2020 02:01
I'd recommend checking state and conditions next then. Try stepping through the process (message break at each event to stop and perform these checks) and verify the following in order:

- Verify 'extract\Digital_Sunset.ogg' (or similarly, 'extract/Digital_Sunset.ogg') exists when checked before doing anything else. See if both AppGameKit can see it with 'GetFileExists' and that it is present in File Explorer.
- If the file exists, stop again and load it externally in some other program to verify that the OGG file itself was extracted properly and plays normally in another program.
- Load the file within AppGameKit, verify it exists in its relevant index (so try loading it in a fixed index for testing, ie 'LoadMusicOGG(1,"extract\Digital_Sunset.ogg"), checking 'GetMusicExistsOGG(1)').
- If that all checks out, then try to play the OGG directly without volume control and its related multipliers you use above, check to verify that the music is then playing as AppGameKit sees it ('GetMusicPlayingOGG(1)').

If stepping through doesn't reveal a problem along the way (which would certainly be a good thing), then the issue may simply be with one of your volume control multipliers nulling out the volume. This may be confirmed if both your index existence check and play status check return true. Another possibility would be an index vs handle mismatch (hence the suggestion to try a fixed index). You appear to try to be returning an instance handle ('audio_levelMusic = LoadMusicOGG("extract\Digital_Sunset.ogg")') in place of an index being used in the follow up commands. So it may be something as simple as mismatched/invalid parameters.
jd_zoo
5
Years of Service
User Offline
Joined: 12th May 2018
Location: Nova Scotia
Posted: 16th Dec 2020 01:12
Thanks SFSW, still no dice I'm afraid. I'll have to try with AG2 when comes time to deploy, I've attempted multiple OGG files and the hang is during the extract - I can't get a message directly after that command. When I say hang I mean its a crash, if you click at the window enough will eventually report back as unresponding.

This works just fine:


This is what I want but doesn't work. If no one else has issues with extracting OGG from a ZIP file must be something else on my end going on...
SFSW
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location:
Posted: 16th Dec 2020 05:40
I'm a little unclear on whether these tests are including password protection at this stage or not. You're specifying a password in your extraction (null string), but I'm not sure that can be applied that way, maybe even file specifically. What happens if you zip -and- extract it without password protection (no password field at all in the 'ExtractZip' command)? When you crash it out, is there a 0 byte OGG file left behind in the extract folder?

Cracking a passworded zip is pretty easy when the file is extracted for any length of time, so the level of protection is minimal. If you aren't able to sort out what may be preventing the extraction from working, you might want to consider your own encryption system, even if just for those files. If you want to post the file, I'd be happy to try some zip and extract operations with that specific OGG file you are having problems with to see if I might be able to determine more about what may be happening.
jd_zoo
5
Years of Service
User Offline
Joined: 12th May 2018
Location: Nova Scotia
Posted: 19th Dec 2020 14:21 Edited at: 19th Dec 2020 14:32
Hi SFSW, here is a simple mock up. I found the issue - clearing the extract folder after loading the music.

No difference with respect to having the password field populated as blank (the zip files have no passwords yet.) Where my problem is trying to delete the OGG file after loading it, that causes the crash. If I leave extract folder then no problem.

I'm not quite sure next step, maybe try loading into a memory block or something I dunno yet.

Thank you very much for your replies! Take a look at the demo if you like, music is from Kenny.

Attachments

Login to view attachments
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 19th Dec 2020 19:20
Quote: "clearing the extract folder after loading the music."

This was an issue with an asset packer that either GarBenjamin or nz0 created (I think)
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 20th Dec 2020 00:36 Edited at: 20th Dec 2020 00:40
this works?:
[My Itch.io Home] [Now Playing]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=AGK] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[Google Forum Search]
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 20th Dec 2020 01:55
Now that i think about it, it was fonts not audio
jd_zoo
5
Years of Service
User Offline
Joined: 12th May 2018
Location: Nova Scotia
Posted: 20th Dec 2020 15:46
@VirtualNomad - not for me it doesn't just hangs, does it work for you? Seems I'm deleting the OGG file before it gets loaded into memory. I thought I saw something about a different way to load OGG music but haven't dug it up yet.
SFSW
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location:
Posted: 20th Dec 2020 16:18 Edited at: 20th Dec 2020 16:18
Ah ok, that would likely do it, not sure why I didn't think of that sooner as I've actually run into this myself. It didn't make sense to me that extracting and loading it would be a problem, but deleting the file after loading it into an index would be. I'm not sure why this behavior exists, but it seems to be common among certain audio formats. I ran into this kind of thing with the DBPro enhanced audio plugin years ago. If you load an audio file using some methods/systems, it seems to hook something into the file as a dependency, preventing it from being deleted or otherwise altered. Could be due to whatever library/module is being used and how it threads the audio for playback. In the end, you will indeed likely have to wait until you delete the index you load the file into before deleting the file or figure out some other way to load it.

Login to post a reply

Server time is: 2024-04-24 06:54:18
Your offset time is: 2024-04-24 06:54:18