• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - IDE .ogg music in IDE skips a bit but works fine in-game

kburkhart84

Firehammer Games
I have a couple of small music clips I made for my audio system. They are in .ogg format. I also have another piece of music I've loaded that is an mp3.

1. Both the .oggs and the mp3 work perfectly fine in-game from what I can tell. The .oggs even seamlessly loop. (I didn't feel like waiting on the MP3 to see if it loops seamlessly since it is much longer).

2. In the IDE, sound asset editor, the sounds for the oggs seem to skip the first maybe quarter second when testing the sound there. It also loops seamlessly, skipping the same time from the beginning each loop. I can even see it showing the skip in the part where it shows the progress text(0.46 / 16.00s) just under the play button. Note that it doesn't do this for the MP3 though, only for the two oggs. If I do a quick double-click on the play button(just to barely start and stop the track as fast as possible), the MP3 stops at like 0.18s, while the ogg one stops at like 0.46. This is me double-clicking pretty much the same speed, getting really close results.

So, this isn't a show stopper for me as the thing works fine when I play music in the game itself. I'm just posting this to see if anyone else has noticed the issue. I'm guessing its a bug of some sort and should be reported. Thanks for reading!
 

TsukaYuriko

☄️
Forum Staff
Moderator
While it does nothing to solve the issue you're facing, you should be importing uncompressed (.wav) files for your audio resources. This is because they will be (re)compressed upon compilation into the format chosen in the resource's settings. If they are already compressed, they will be compressed again, resulting in quality loss on top of quality loss. For the best quality, use uncompressed files.

That aside, I could imagine the skip at the start to be related to the time it takes to decompress the audio... but that's really just a guess and doesn't mean that it should be that way. It's probably indeed best to file a ticket for this.
 

kburkhart84

Firehammer Games
While it does nothing to solve the issue you're facing, you should be importing uncompressed (.wav) files for your audio resources. This is because they will be (re)compressed upon compilation into the format chosen in the resource's settings. If they are already compressed, they will be compressed again, resulting in quality loss on top of quality loss. For the best quality, use uncompressed files.
This makes sense, and indeed for a project I probably would do so. I don't think its a compression issue though since I know mp3 also has do undergo a similar(yet different) decompression process, so unless its just a case of MP3 being that much faster, I'm not seeing it. At the least I would think it would simply stutter before starting to play, but not skip a portion of the audio.

Do you happen to know what form the project file's sound asset stores the audio in? I'm guessing it stores the original file in some fashion, simply because it needs it to re-perform compression, etc... when exporting builds and changing settings. If I'm right, then I certainly don't want to use raw WAVs for this. Its for the audio system I'm working on, and raw WAVs would create massive files I don't need for the audio system.

EDIT******

I just looked at the project file...it is literally copying the file(MP3 or OGG, and presumably the same if its a WAV) into the project folders, and then has the yy file which would define the asset settings. So most certainly, in this specific case, I do not want to get raw WAVs imported. A 16 second OGG in my case is just over 300KB, while a raw WAV is just over 4MB. I'm going to have several little music clips(for the example, showing the cross-fading and stuff), so I'd rather sacrifice the quality. That said, for an actual game project, I agree that it will be better to use raw WAVs where possible so they aren't re-compressed, etc...
 
Last edited:

TsukaYuriko

☄️
Forum Staff
Moderator
Indeed, the original file you imported is stored in the project files. So yeah, that leads to massive-sized project files, but normal-sized exports (as long as you set them to be compressed - otherwise they will be exported as wav).
 

kburkhart84

Firehammer Games
Indeed, the original file you imported is stored in the project files. So yeah, that leads to massive-sized project files, but normal-sized exports (as long as you set them to be compressed - otherwise they will be exported as wav).
I'm going to have to pay some attention to this eventually. If I write my own music and export that to a raw WAV, I'm wondering if tracks are going to end up over 100MB. If they are, I'm going to have to add a line to my Git LFS file :eek:
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
So, this isn't a show stopper for me as the thing works fine when I play music in the game itself. I'm just posting this to see if anyone else has noticed the issue. I'm guessing its a bug of some sort and should be reported. Thanks for reading!
I would file a bug report about this behaviour just to be safe, but in my experience the in-IDE audio playback is very flaky in general. Most of the time playback of sound effects from the PLAY button in the sound editor cuts off the last bit of all sounds, and looping can rather hit-or-miss, and sometimes sounds play with distortion. I imagine it's a low-priority item for YYG, especially of they play fine in game, but they should still be made aware of the issues.

I didn't feel like waiting on the MP3 to see if it loops seamlessly since it is much longer
Wee bit of advice... NEVER use mp3 for looping audio. The way the mp3 compression works, unless your audio falls exactly within certain parameters of bit-rate, the format will "pad" the sound at the beginning or end. You can check this by opening the sound in an editor, cropping it to loop then saving it as mp3 and re-opening it. You'll see that there is a very short 0db section added to the waveform at the beginning and end. OGG doesn't have this issue, so it's always better to edit any mp3 to crop the padding and save as OGG format then import it into GM.

Finally, on the subject of compression, I generally try to author all OGG music files at CD quality ( 44.1 KHz/16 bit ) then let GM re-compress them at the quality you've chosen in the IDE. I'm pretty sure that if the IDE quality settings are the same, then they will not be re-compressed... Certainly, I've never found any audio issues associated with that type of double-compression in any of my projects (and I pay a lot of attention to audio!). And, just for good measure, you should author all sound effects that aren't music in WAV format (although I'm sure you know that already, but this is really for the benefit of anyone else coming to this topic).
 

kburkhart84

Firehammer Games
I would file a bug report about this behaviour just to be safe, but in my experience the in-IDE audio playback is very flaky in general. Most of the time playback of sound effects from the PLAY button in the sound editor cuts off the last bit of all sounds, and looping can rather hit-or-miss, and sometimes sounds play with distortion. I imagine it's a low-priority item for YYG, especially of they play fine in game, but they should still be made aware of the issues.
Thanks, I think I'll do that.

Wee bit of advice... NEVER use mp3 for looping audio. The way the mp3 compression works, unless your audio falls exactly within certain parameters of bit-rate, the format will "pad" the sound at the beginning or end. You can check this by opening the sound in an editor, cropping it to loop then saving it as mp3 and re-opening it. You'll see that there is a very short 0db section added to the waveform at the beginning and end. OGG doesn't have this issue, so it's always better to edit any mp3 to crop the padding and save as OGG format then import it into GM.
Indeed, I'm aware of this issue. I had imported the MP3 for testing to see if it had the same issue(it's one I found on Incompetech, that guy has tons of good music). If I were to use it in an actual project I would take this advice.

Finally, on the subject of compression, I generally try to author all OGG music files at CD quality ( 44.1 KHz/16 bit ) then let GM re-compress them at the quality you've chosen in the IDE. I'm pretty sure that if the IDE quality settings are the same, then they will not be re-compressed... Certainly, I've never found any audio issues associated with that type of double-compression in any of my projects (and I pay a lot of attention to audio!).
Hmmm, I wonder if this is actually a thing or not though. Maybe I can ask Yoyo for confirmation if they purposefully avoid the re-compression in these cases. I wonder if its that they indeed avoid it, or if you personally just haven't noticed any re-compression issues. Confirmation can't hurt.

And, just for good measure, you should author all sound effects that aren't music in WAV format (although I'm sure you know that already, but this is really for the benefit of anyone else coming to this topic).
100% accurate. It's better for quality AND performance, and since sound effects are generally much smaller than music, space isn't an issue either.
 

kburkhart84

Firehammer Games
@Nocturne Just FYI for you and anyone else who is paying attention, I just got a response back. They have reproduced the issue and added it to the "Known Issues" section for releases, and eventually will get it fixed. I'm sure it's not a high priority as it's just a thing in the IDE, but at the least we finally got it confirmed and on the list.
 
Top