HaxeFlixel / flixel

Free, cross-platform 2D game engine powered by Haxe and OpenFL
https://haxeflixel.com/
MIT License
1.93k stars 427 forks source link

[FIXEL BUG] Sound starts over when focus gain event triggers (after triggering the focus lost event) #3117

Closed SomeGuyWhoLovesCoding closed 2 months ago

SomeGuyWhoLovesCoding commented 2 months ago

Observed on HashLink btw.

To reproduce: Just play the sound in create() via FlxG.sound.playMusic('assets/music.ogg', 1);

Here's a video to show proof:

https://github.com/HaxeFlixel/flixel-ui/assets/99929173/50ec0569-eb72-4c89-9a74-dcbce053b6b7

SomeGuyWhoLovesCoding commented 2 months ago

I'm on latest flixel btw

Geokureli commented 2 months ago

This doesn't happen to me on my tests with HL, could you share the ogg your using, or any ogg that it happens with?

Geokureli commented 2 months ago

why is this issue in flixel-ui rather than flixel?

SomeGuyWhoLovesCoding commented 2 months ago

why is this issue in flixel-ui rather than flixel?

Oops, made a mistake LOL

SomeGuyWhoLovesCoding commented 2 months ago

Aside from that:

This doesn't happen to me on my tests with HL, could you share the ogg your using, or any ogg that it happens with?

It happens with every ogg file, by putting just a string in the first argument of FlxG.sound.playMusic

Geokureli commented 2 months ago

It happens with every ogg file, by putting just a string in the first argument of FlxG.sound.playMusic

here's what I tried

package states;

import flixel.FlxG;

class MusicRestartTestState extends flixel.FlxState
{
    override function create()
    {
        super.create();

        FlxG.sound.playMusic("assets/sounds/flixel-mono.ogg");
    }
}

it worked totally fine, can you share an ogg that causes this for you

SomeGuyWhoLovesCoding commented 2 months ago

It happens with every ogg file, by putting just a string in the first argument of FlxG.sound.playMusic

here's what I tried

package states;

import flixel.FlxG;

class MusicRestartTestState extends flixel.FlxState
{
    override function create()
    {
        super.create();

        FlxG.sound.playMusic("assets/sounds/flixel-mono.ogg");
    }
}

it worked totally fine, can you share an ogg that causes this for you

It happens on the breakfast music in hashlink

Geokureli commented 2 months ago

I don't know what the breakfast music is can you attach or link it to this thread

SomeGuyWhoLovesCoding commented 2 months ago

I don't know what the breakfast music is can you attach or link it to this thread

The current fnf pause music

Geokureli commented 2 months ago

The current fnf pause music

can you just link it or attach it, dude. I've asked like 5 times

SomeGuyWhoLovesCoding commented 2 months ago

The current fnf pause music

can you just link it or attach it, dude. I've asked like 5 times

Sure, hold on

SomeGuyWhoLovesCoding commented 2 months ago

The current fnf pause music

can you just link it or attach it, dude. I've asked like 5 times

Sure, hold on

I can't send an ogg to github so here's a drive link: https://drive.google.com/file/d/1sNjPbnhEXvpTogwcTxHr3S-TK1_N4t8H/view?usp=sharing

Geokureli commented 2 months ago

thanks for the file, but it still doesn't reproduce the issue for me

https://github.com/HaxeFlixel/flixel/assets/2609513/d8759a45-3586-4751-bcb4-194d268c00d5

There's not much I can do without a solid repro. I recommend trying this with openfl Sounds too and see if it's an openfl issue

SomeGuyWhoLovesCoding commented 2 months ago

thanks for the file, but it still doesn't reproduce the issue for me

Screen.Recording.2024-04-17.at.2.52.22.PM.mov There's not much I can do without a solid repro. I recommend trying this with openfl Sounds too and se if it's a openfl issue

thanks for the file, but it still doesn't reproduce the issue for me

Screen.Recording.2024-04-17.at.2.52.22.PM.mov There's not much I can do without a solid repro. I recommend trying this with openfl Sounds too and se if it's a openfl issue

You're on hl, right?

Geokureli commented 2 months ago

You're on hl, right?

Yes I mention using HL in my initial reply

SomeGuyWhoLovesCoding commented 2 months ago

You're on hl, right?

Yes I mention using HL in my initial reply

Okay, that bug does happen to me though

Geokureli commented 2 months ago

I'm never said it's not happening to you, I'm saying there's not much I can do without reproducing it myself and I recommend things you should try

ACrazyTown commented 2 months ago

Could you be running a Lime fork by chance? I noticed you were making an audio related pull request to Lime so maybe you're using that fork instead of stable?

SomeGuyWhoLovesCoding commented 2 months ago

Could you be running a Lime fork by chance? I noticed you were making an audio related pull request to Lime so maybe you're using that fork instead of stable?

I am running a lime fork - and the bug still persists on the latest stable release (8.1.2)

Geokureli commented 2 months ago

I recommend trying this with openfl Sounds too and see if it's an openfl issue

did you try this?

ACrazyTown commented 2 months ago

Could you be running a Lime fork by chance? I noticed you were making an audio related pull request to Lime so maybe you're using that fork instead of stable?

I am running a lime fork - and the bug still persists on the latest stable release (8.1.2)

I tried your fork and I could reproduce the issue (The sound resets when focus is gained):

https://github.com/HaxeFlixel/flixel/assets/47027981/0c2b5fb1-6c3c-410c-9e3f-0cfb747cdaca

However I can't get it to happen on haxelib Lime 8.1.2 (The sound time progresses as expected):

https://github.com/HaxeFlixel/flixel/assets/47027981/9b9108e5-5d8e-4638-886b-7455bd47fd29

Maybe you're not switching between the fork and haxelib properly?

SomeGuyWhoLovesCoding commented 2 months ago

Could you be running a Lime fork by chance? I noticed you were making an audio related pull request to Lime so maybe you're using that fork instead of stable?

I am running a lime fork - and the bug still persists on the latest stable release (8.1.2)

I tried your fork and I could reproduce the issue (The sound resets when focus is gained):

2024-04-18.16-34-56.mp4 However I can't get it to happen on haxelib Lime 8.1.2 (The sound time progresses as expected):

2024-04-18.16-35-27.mp4 Maybe you're not switching between the fork and haxelib properly?

How does the sound even reset in the first place?

ACrazyTown commented 2 months ago

How does the sound even reset in the first place?

It's your code, I don't know what changes you made

glintfishGH commented 2 months ago

check the stable lime repo you're using, knowing you, you probably changed something in there aswell.

This is what happens when you change code when you have no idea what it does by the way, this is why we tell you not to do shit like this.

YanniZ06 commented 2 months ago

Could you be running a Lime fork by chance? I noticed you were making an audio related pull request to Lime so maybe you're using that fork instead of stable?

I am running a lime fork - and the bug still persists on the latest stable release (8.1.2)

I tried your fork and I could reproduce the issue (The sound resets when focus is gained): 2024-04-18.16-34-56.mp4 However I can't get it to happen on haxelib Lime 8.1.2 (The sound time progresses as expected): 2024-04-18.16-35-27.mp4 Maybe you're not switching between the fork and haxelib properly?

How does the sound even reset in the first place?

Stop asking that, you know the issue is with you so stop requesting us to fix your mess. If you're gonna make your own "better" changes, do them right, otherwise stop complaining and ESPECIALLY don't expect us to be able to fix what is very clearly a mistake 100% on you.

By the way it should generally be common sense to not make an issue for something on the original when you're using a MODIFIED VERSION of it, I mean you wouldn't report any bugs you get while playing a game modded to the original devs of the game, right? I hope this helps you solve your problem(s),

Cheers

Geokureli commented 2 months ago

If anyone can reproduce this on the standard lime repo, I'll reopen, but for now, I'm filing this under "not a flixel issue"