Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

Position of audiohandle doesn't work on web #396

Open
ghost opened this issue Aug 16, 2016 · 3 comments
Open

Position of audiohandle doesn't work on web #396

ghost opened this issue Aug 16, 2016 · 3 comments

Comments

@ghost
Copy link

ghost commented Aug 16, 2016

There is example:

var handle = Luxe.audio.play(source, volume);

override function update (dt:Float){
     trace(Luxe.audio.position_of(handle)); // so, it always outputs: 0
}

And what it must output?

@ruby0x1
Copy link
Member

ruby0x1 commented Aug 16, 2016

What are you testing on?
How long is the sound?

I put this in tests/features/audio:

    override function update(dt:Float) {

        if(Luxe.audio.state_of(last_played) == luxe.Audio.AudioState.as_playing) {
            trace(Luxe.audio.position_of(last_played));
        }

    }

And it works as expected on native.
On web it will return 0

The reason is largely because web audio api doesn't support this concept (yet, maybe).
I was intending to look into implementing the work arounds but I've been focused elsewhere.

@ghost
Copy link
Author

ghost commented Aug 17, 2016

Yes, I worked on Web target. It's not very good news for me, but I'll wait for changes.

@ruby0x1
Copy link
Member

ruby0x1 commented Aug 17, 2016

Not much I can do about browsers not supporting these basic features I'm afraid!
I'll see if we can work around it but it's probably not going to be a best fit until the browsers finish the API. For streaming sounds I think the position is knowable already, which I'll add soon.

@ruby0x1 ruby0x1 changed the title Position of audiohandle doesn't work Position of audiohandle doesn't work on web Jan 1, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant