HaxeFlixel / HaxeFlixel/flixel
No warning if FlxSound fails to play because audio sampling is above 44.1 kHZ
Nobody has claimed this yet.
- Dominant language
- Haxe
- Stars
- 2.2k
- Forks
- 522
- Avg merge
- 34m
- Merged PRs (30d)
- 1
Description
class PlayState extends FlxState
{
var mySound:FlxSound;
override public function create():Void
{
mySound = FlxG.sound.load(AssetPaths.high_quality_sound__wav); // sound file is sampled higher than 44.1 kHz
mySound.play()
}
}
Observed behavior:
I haven't done extensive testing on other targets, but I believe on neko and probably flash, sound files with audio sampling over 44.1 kHz do not play. There's no warning. I only realized this in my own project because it was mentioned in this guide: https://gamefromscratch.com/haxeflixel-tutorial-sound-and-music/.
Expected behavior:
The sound either plays, or warns you that it can't be played because it is sampled at a higher rate than allowed.
I've been told this is an openFL thing and not really a flixel thing, so I wonder if a simple warning would be best. I also wonder if this can be better documented somewhere.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at FlxG.sound.load and FlxSound.play, using the provided PlayState example to trace what happens when a sound exceeds 44.1 kHz. Check the reported behavior on neko and Flash and determine whether the warning belongs in Flixel or OpenFL. Done means the limitation is surfaced to users or documented clearly.
Written by the indexing model from the issue text.
Assessment
- Domain
- audio-video-rtc, game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100