-
Notifications
You must be signed in to change notification settings - Fork 435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pitch support for FlxSound #1465
Conversation
In what OpenFL version was this added (i.e., would we be dropping support for any older OpenFL version that's still working fine with flixel by adding this without any openfl version conditionals)?. What about openfl next? In that thread Joshua seems to suggest that this is only a thing for openfl legacy. |
from this commit |
#if (cpp || neko) | ||
_channel.pitch = v; | ||
#else | ||
FlxG.log.warn("Pitch is only supported on OpenAL targets (i.e. cpp & neko)"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if it wouldn't be better to only have this property exist for cpp and neko in the first place. That's how we handle most of the input stuff in FlxG
for example. Then again. other features like post processing use this approach (except for the warn() call), so I guess we're not really consistent about it...
|
||
private function set_pitch(v:Float):Float | ||
{ | ||
return _pitch = _channel.pitch = v; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can produce null exceptions since _channel
might be null.
GitHub doesn't send notifications for new commits on pull requests, so it's a good idea to comment whenever you add one. I just manually merged this: 415f410 Thanks for the implementation, this is a really cool feature! |
@Gama11 roger that, will comment next time. |
Sorry to necro. @Gama11 is this in a released version of HaxeFlixel? I didn't see any mention of pitch when I looked at the api.haxeflixel.org entry for FlxSound. |
Yes. The api docs are currently only generated for flash. |
Thanks for clarifying. (We should probably have an issue to address the docs ...) |
We do. HaxeFlixel/flixel-docs#132 |
this is a hidden gem...:smirk:
reference: http://community.openfl.org/t/change-pitch-or-speed-of-audio/1118/2