HaxeFlixel / HaxeFlixel/flixel

No warning if FlxSound fails to play because audio sampling is above 44.1 kHZ

Open
#2,287 2 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.