Jump to content

PIXI Sound Filters


TR-i
 Share

Recommended Posts

I understand the goal but I do not understand the problem.

Have you created a SoundInstance?  Have you created a Filter?  Are you aware of the "filters" (array) member of the SoundInstance?  If so push the created Filter instance into that array (or create the array).  Done.

Think of it like adding a Filter to a DisplayObject.

Link to comment
Share on other sites

All I know is, this throws an error:

const sound = new PIXI.sound.Sound.from('data:audio/mp3;base64,' + audiodata);
sound.filters = [new filters.TelephoneFilter()];

As does this:

const sound = new PIXI.sound.Sound.from('data:audio/mp3;base64,' + audiodata);
sound.sound.filters = [new filters.TelephoneFilter()];

 

Link to comment
Share on other sites

Option 1.  What's the error?  (F12, console message).

Try the full package reference ...

const sound = new PIXI.sound.Sound.from('data:audio/mp3;base64,' + audiodata);
sound.filters = [new PIXI.sound.filters.TelephoneFilter()];

 

Edited by b10b
Too much haste
Link to comment
Share on other sites

sound.filters = [new PIXI.sound.filter.TelephoneFilter()];

Throws an error.

sound.filters = [new PIXI.sound.filters.TelephoneFilter()];

Does not.

However, there seems to be no change in the sound after adding the filter. Tried Distortion and Reverb filters- no difference.

Edited by TR-i
Link to comment
Share on other sites

Sorry that was my bad on the typo, too much haste on my part!  Yes, package name is PIXI.sound.filters.  I have corrected in original post to avoid errors propagating to others.

Sound.from returns Sound.  Sound has member "filters" which is a passthru to this.media.filters.  I can see nothing specifically wrong with that code, so some debugging is needed - check whether WebAudio is being used perhaps?

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...