Skip to content
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

Automatically append file extension to sound asset ids #3314

Merged
merged 7 commits into from
Dec 12, 2024

Conversation

Geokureli
Copy link
Member

@Geokureli Geokureli commented Dec 11, 2024

Define flag FLX_DEFAULT_SOUND_EXT to allow sound asset ids to omit the extension. Useful when targeting multiple platforms that use different sound files. Can also use the flag to determine the desired sound extension, setting the flags value to "mp3" "wav" or "ogg" will use that extension. The default extension can be read via FlxG.assets.defaultSoundExtension

@Geokureli Geokureli added this to the 5.9.0 milestone Dec 11, 2024
@Geokureli Geokureli added New Feature Assets Pertains to using and including assets labels Dec 11, 2024
@Geokureli Geokureli changed the title auto add sound extensions Auto add sound extensions Dec 11, 2024
@Geokureli Geokureli changed the title Auto add sound extensions Automatically append file extension to sound asset ids Dec 11, 2024
@ACrazyTown
Copy link
Contributor

Does it make sense to limit to only mp3, wav and ogg? On web, audio format support is limited by the browser so it supports a lot more than just those 3

@Geokureli
Copy link
Member Author

Does it make sense to limit to only mp3, wav and ogg? On web, audio format support is limited by the browser so it supports a lot more than just those 3

do you have examples?

@ACrazyTown
Copy link
Contributor

do you have examples?

For file formats? Off the top of my head m4a/aac, flac and ogg/opus

@EliteMasterEric
Copy link
Contributor

@ACrazyTown The main reason this exists is because OGG is not supported on all browsers (glares intently at Safari) and because MP3 is not supported on desktop (for some reason).

This is a very useful PR as is, considering I manually do something similar on multiple projects.

@Geokureli
Copy link
Member Author

Geokureli commented Dec 12, 2024

@ACrazyTown The main reason this exists is because OGG is not supported on all browsers (glares intently at Safari) and because MP3 is not supported on desktop (for some reason).

This is a very useful PR as is, considering I manually do something similar on multiple projects.

I think you misread ACrazyTown's message. They weren't questioning why this exists, just why it only allowed 3 values, so I made this change

@Geokureli Geokureli merged commit e4a994d into HaxeFlixel:dev Dec 12, 2024
11 checks passed
@Geokureli Geokureli deleted the add-sound-ext branch December 12, 2024 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Assets Pertains to using and including assets New Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants