Skip to content

Missing a way to set the start time of sound components #5364

@JonathannJacobs

Description

@JonathannJacobs

Hi, well first thing, it's not a bug but a missing feature.

I wish to have a way to play a sound entirely at first loop and then rewind at some specific start loop value different than zero.
So far i had the following code :

this.el.removeAttribute('sound')
this.el.setAttribute('sound', 'src', 'assets/some.mp3');
this.el.components.sound.playSound()
this.el.addEventListener('sound-ended', () => {
// Missing here a way to set the next playSound start value
this.el.components.sound.playSound()
});

And that is sad because i could totally do it with a regular audio html element that lacks positionnal audio and pool.

Currently my best shot is to split my file into two mp3: one for the intro and another for the looping part.

  • A-Frame Version: 1.4.2
  • Platform / Device: All

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions