New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android: can't play any sound in an external vox package in single game launcher #1577
Comments
ok, the problem is that when searching for assets (like diff --git a/Common/util/file.cpp b/Common/util/file.cpp
index f2759030a..2c09f43fe 100644
--- a/Common/util/file.cpp
+++ b/Common/util/file.cpp
@@ -218,8 +218,12 @@ Stream *File::OpenFile(const String &filename, FileOpenMode open_mode, FileWorkM
fs = nullptr;
#if AGS_PLATFORM_OS_ANDROID
try {
- if (work_mode == kFile_Read) // look into Android Assets too
- fs = new AAssetStream(filename, AASSET_MODE_RANDOM);
+ if (work_mode == kFile_Read) { // look into Android Assets too
+ String filename_right = filename;
+ if (filename.StartsWith("./"))
+ filename_right = filename.Right(filename.GetLength() - 2);
+ fs = new AAssetStream(filename_right, AASSET_MODE_RANDOM);
+ }
if (fs != nullptr && !fs->IsValid()) {
delete fs;
fs = nullptr; I don't know yet which is pretty fix for this, but I guess something just like it in the AAssetStream class would fix it. |
This is probably equivalent to
|
not exactly, the asset can have directories inside it, I think https://developer.android.com/reference/android/content/res/AssetManager#list(java.lang.String) I am not sure if we support it or not, but I think so. It just need the it's an addition to this: ags/Common/util/aasset_stream.cpp Lines 179 to 183 in b8a811f
But the filenames here also needs it: https://github.com/adventuregamestudio/ags/blob/master/Common/util/android_file.cpp Basically, if it's inside the Android Asset with AAssetManager, drop I was thinking about creating a |
Describe the bug
Sounds not in the game main .ags package can't be played. Because speech is always packaged as speech.vox, we can't play any speech. First reported here: https://www.adventuregamestudio.co.uk/forums/index.php?topic=59772.msg636644240#msg636644240
AGS Version
AGS 3.6.0.20 but also current master https://github.com/adventuregamestudio/ags/tree/b8a811f9e939328987af3adbbad7c72617dfbafd
To Reproduce
In the editor create a new game
Expected behavior
The sound should play
Desktop:
Smartphone:
Additional context
When listing the libraries in AssetManager
_activeLibs
, I can only see the root dir and the game.ags file - the vox package doesn't appear as a library. I can see the game tries to look for the"/au000004.mp3"
clip but it can't find it in either the ags game or in the root dir. The vox packages apparently can't be found.In the single game package the files are not in a regular directory, and instead are accessible through the AAssetManager from Android. It appears some logic is missing for the vox packages there, but I am not sure what it's yet.
The text was updated successfully, but these errors were encountered: