TannerRogalsky / love.js

LÖVE ported to the web using Emscripten
MIT License
491 stars 52 forks source link

source:setPitch() doesn't work #30

Open MadByteDE opened 8 years ago

MadByteDE commented 8 years ago

Changing the pitch of an audio source seems to have no effect.

TannerRogalsky commented 8 years ago

@MadByteDE Can you give me a quick test case for this?

MadByteDE commented 8 years ago

edit: links no longer available. sure. using love.js http://destructivereality.de/pitch/

and here is the *.love of the same code: http://destructivereality.de/pitch.love

TannerRogalsky commented 8 years ago

I looked into it. Seems like this isn't possible: https://github.com/kripken/emscripten/blob/07b87426f898d6e9c677db291d9088c839197291/src/library_openal.js#L523-L527

MadByteDE commented 8 years ago

To bad... thanks anyway.

henkboom commented 8 years ago

Support seems to be there since march 1, but not in master for some reason?

https://github.com/kripken/emscripten/commits/fe96f0e5153e22370a88163ac09680f11af70b1c/src/library_openal.js

TannerRogalsky commented 8 years ago

Incoming tends to be what I use to compile this anyway since the release cycle to master is a little long and incoming is reasonably stable. Thanks for the heads up, @henkboom. I'll see if that patch fixes this issue.

NPException commented 8 years ago

Are there any news regarding this issue? I initially wanted to use love.js to package a web version for my LD35 game. But I shyed away from doing so, because the engine revs in my game are done through setPitch().

TannerRogalsky commented 8 years ago

@NPException This hasn't been resolved yet. I will close this issue when it has.

Ulydev commented 7 years ago

I would love to get some updates concerning this issue :)

AlexisTM commented 7 years ago

@Ulydev The problem comes from the openal which don't support static pitch change on the web, according to emscripten code, this won't be fixed. https://github.com/kripken/emscripten/blob/07b87426f898d6e9c677db291d9088c839197291/src/library_openal.js#L523-L527

    case 0x1003 /* AL_PITCH */:
#if OPENAL_DEBUG
      console.log("alSourcef was called with 0x1003 /* AL_PITCH */, but Web Audio does not support static pitch changes");
#endif
      break;
henkboom commented 7 years ago

@AlexisTM like I posted above, that code has since been modified to add an implementation:

https://github.com/kripken/emscripten/commit/fe96f0e5153e22370a88163ac09680f11af70b1c#diff-36fcd036fa88446c972f56ca850c357fL524

Ulydev commented 7 years ago

Amazing! So how hard would it be to implement it in love.js?

TannerRogalsky commented 7 years ago

Pitch is working 0.11.0-rc1 but setting and getting offsets isn't implemented yet so audio isn't working quite right yet. Still, progress.