marian-m12l / studio

STUdio - Story Teller Unleashed
https://marian-m12l.github.io/studio-website/
Mozilla Public License 2.0
710 stars 132 forks source link

Cannot convert story pack #482

Closed valadeAude closed 2 months ago

valadeAude commented 2 months ago

Describe the bug Story diagram is valid but when impossible to export the story to FS format

To Reproduce Steps to reproduce the behavior:

  1. Save pack in the library
  2. Click on library icon
  3. Click on Convert this pack to FS (v2.X)
  4. The white box Converting opens but remains white and nothing more happens in the library

Expected behavior I expected the box Converting to turn green and a purple converted file box to show up.

Screenshots

Logs Check the logs in the console for errors, if any. Join the studio-latest.log file if relevant. Also check the network tab of your browser's developer tools and look for HTTP calls in error, if any. HTTP responses may contain useful data.

2024-09-14 13:58:43,131 [INFO ] [s.w.s.LibraryService]: Pack

to transfer is in archive format. Converting to FS format and storing in temporary folder: /Users/valade/.studio/tmp/La_reine_des_neiges-bb872fb7-9506-48a0-8b09-de47e4ba2e8a-v1.zip14552110300642046216 2024-09-14 13:58:43,134 [INFO ] [s.w.s.LibraryService]: Reading archive format pack 2024-09-14 13:58:43,151 [INFO ] [s.w.s.LibraryService]: Converting assets if necessary 2024-09-14 13:58:43,152 [DEBUG] [s.c.v.u.PackAssetsCompression]: Converting image asset into 4-bits/RLE BMP 2024-09-14 13:58:43,228 [DEBUG] [s.c.v.u.ID3Tags]: Removing ID3v2 tag at beginning of file (241 bytes). 2024-09-14 13:58:43,230 [DEBUG] [s.c.v.u.PackAssetsCompression]: Re-encoding MP3 audio asset 2024-09-14 13:58:43,379 [ERROR] [s.w.s.LibraryService]: Failed to convert archive format pack to FS format javax.sound.sampled.UnsupportedAudioFileException: Stream of unsupported format at java.desktop/javax.sound.sampled.AudioSystem.getAudioFileFormat(AudioSystem.java:928) at studio.core.v1.utils.PackAssetsCompression.withPreparedAssetsFirmware2dot4(PackAssetsCompression.java:182) at studio.webui.service.LibraryService.addConvertedFsPackFile(LibraryService.java:322) at studio.webui.api.LibraryController$2.run(LibraryController.java:102) at java.base/java.util.TimerThread.mainLoop(Timer.java:566) at java.base/java.util.TimerThread.run(Timer.java:516) Exception in thread "Timer-4" java.lang.RuntimeException: Failed to convert archive format pack to FS format at studio.webui.service.LibraryService.addConvertedFsPackFile(LibraryService.java:336) at studio.webui.api.LibraryController$2.run(LibraryController.java:102) at java.base/java.util.TimerThread.mainLoop(Timer.java:566) at java.base/java.util.TimerThread.run(Timer.java:516) Caused by: javax.sound.sampled.UnsupportedAudioFileException: Stream of unsupported format at java.desktop/javax.sound.sampled.AudioSystem.getAudioFileFormat(AudioSystem.java:928) at studio.core.v1.utils.PackAssetsCompression.withPreparedAssetsFirmware2dot4(PackAssetsCompression.java:182) at studio.webui.service.LibraryService.addConvertedFsPackFile(LibraryService.java:322) ... 3 more

Desktop and environment (please complete the following information):

Additional context Add any other context about the problem here. studio-latest.log studio-latest.log

marian-m12l commented 2 months ago

@valadeAude Thanks for the feedback (and for actually filling the issue template :smile:). It looks like an audio file in your story pack uses an unsupported file format, which STUdio fails to convert to mp3 (javax.sound.sampled.UnsupportedAudioFileException: Stream of unsupported format). What audio format did you use? Can you check if one of the nodes contains an invalid or corrupted file?

valadeAude commented 2 months ago

Hi, the files are all .mp3 and I have the same problem irrespective of the files I use. That is for example I tried setting up a small example with two audio files, say audio1 and audio2. I can convert. Then I add a node to which I add one of the two audio files I used before, so I have now audio1, audio2, audio2. That would not convert.

marian-m12l commented 2 months ago

Are you getting the error only when using the same audio file in two nodes? maybe this is not handled correctly. I'll try to reproduce the issue.

valadeAude commented 2 months ago

I tried to see if the problem is linked to the audio file. I did 3 tests :

marian-m12l commented 2 months ago

I was not able to reproduce the issue locally. Can you share a minimal story pack that cannot be converted? What's surprising in your tests is that they point to a potential issue with simplified nodes vs stage nodes. I checked the editor and writer code but didn't see anything suspicious in the generation of underlying stage nodes for menu and story nodes. If you cannot share a full story pack, posting only the story.json files (working and non-working) may be helpful.

valadeAude commented 2 months ago

Pack_title-848229a0-7350-4401-b864-5001d1fa12cf-v1.zip I exported this pack that I cannot convert. and the latest log :

studio-latest.log

Thanks Aude

marian-m12l commented 2 months ago

Thanks,

It looks like two of your audio files are not mp3 but m4a/mp4:

Screenshot from 2024-09-19 21-42-55

Replacing them with mp3/ogg/wav files should fix the conversion issue.

Could you check the audio files in the story pack that you can export without error? There could be another issue preventing conversion.

Anyway, I added a few logs in the conversion process to make it easier to debug this sort of situation in the future.

valadeAude commented 2 months ago

Thank you very much. My last batch of audio files were indeed mis-formatted with .mp3 suffixes. Thank you for the whole project that we are loving. Best, Aude

marian-m12l commented 2 months ago

Good to know that this solved your export failure :-) I'm closing this issue, but feel free to reopen should it not be fixed. Thanks for your feedback.