Skip to content

Conversation

@HEIHUAa
Copy link
Contributor

@HEIHUAa HEIHUAa commented Sep 21, 2025

Added OPUS audio playback support.

Also started adding multi-format extension support in ChartMetaData (though this part is unfinished). If you want to use OPUS audio globally right now, you can simply rename .opus files to .ogg — yes, they will still play correctly this way.

Also, OGG is itself a container format that supports Opus encoding. So you can absolutely encode your audio as Opus and package it within an OGG container.

@NexIsDumb
Copy link
Member

woah, i'll surely check this out

@NexIsDumb NexIsDumb requested a review from Raltyro September 21, 2025 14:44
@HEIHUAa
Copy link
Contributor Author

HEIHUAa commented Sep 21, 2025

哇,我肯定会检查这个的

What a coincidence! I just finished implementing the auto-detection feature.

@Raltyro
Copy link
Member

Raltyro commented Sep 21, 2025

I was actually thinking of implementing it as a decoder so the getSound Assets function isnt a mess

@HEIHUAa
Copy link
Contributor Author

HEIHUAa commented Sep 21, 2025

我实际上想将其实现为一个解码器,这样 getSound Assets 函数就不会一团糟了

cool

@Vortex2Oblivion
Copy link

wowzers

@HEIHUAa
Copy link
Contributor Author

HEIHUAa commented Sep 27, 2025

I'm wondering if Opus support can be implemented in version 1.0.2? Even if file extension recognition isn't added, that's acceptable.

If we assume no extension support is needed, then only the following three files from this pull request would require updates:

  • building/libs.xml
  • project.xml
  • source/openfl/utils/Assets.hx

This approach would still allow using Opus audio encoding within the .ogg container.

@Raltyro
Copy link
Member

Raltyro commented Oct 4, 2025

I was actually thinking of implementing it as a decoder so the getSound Assets function isnt a mess

quoting my reply, i might be closing this pull request so dont do anymore to the pull request
i was thinking of implementing to the libraries in the organization as a decoder so it'll be easier to implement other audio types like MiniMP3 or Drmp3 for mp3, flac, etc.

@HEIHUAa
Copy link
Contributor Author

HEIHUAa commented Oct 4, 2025

I was actually thinking of implementing it as a decoder so the getSound Assets function isnt a mess

quoting my reply, i might be closing this pull request so dont do anymore to the pull request i was thinking of implementing to the libraries in the organization as a decoder so it'll be easier to implement other audio types like MiniMP3 or Drmp3 for mp3, flac, etc.

Okay.


public static var SOUND_EXTENSIONS:Array<String> = [
#if web "mp3" #else "ogg" #end,
"opus"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it make more sense to include this as part of the #else macro, since Opus support is only available on C++ builds?

@HEIHUAa
Copy link
Contributor Author

HEIHUAa commented Dec 9, 2025

I was thinking, since CNE has hxvlc installed, could we use VLC to decode audio? In theory, this would allow CNE to support a wide range of audio formats — though I’m not sure how to actually implement it.

@r6915ee
Copy link
Contributor

r6915ee commented Dec 9, 2025

I was thinking, since CNE has hxvlc installed, could we use VLC to decode audio? In theory, this would allow CNE to support a wide range of audio formats — though I’m not sure how to actually implement it.

I'm not familiar with how hxvlc properly interfaces with the actual C library, but hxvlc is primarily intended for video playback. hxvlc does not provide any features for audio management with the exception of manually managing libvlc through its respective class. This factor would also make Codename more dependent on desktop targets and prevent some compatibility with tools like Hashlink. hxvlc is also only usable on desktop targets, because libvlc is provided only on those targets; web targets would still need to use their own system.

@HEIHUAa
Copy link
Contributor Author

HEIHUAa commented Dec 9, 2025

I'm not familiar with how hxvlc properly interfaces with the actual C library, but hxvlc is primarily intended for video playback. hxvlc does not provide any features for audio management with the exception of manually managing libvlc through its respective class. This factor would also make Codename more dependent on desktop targets and prevent some compatibility with tools like Hashlink. hxvlc is also only usable on desktop targets, because libvlc is provided only on those targets; web targets would still need to use their own system.

Okay, I understand. Thank you for explaining.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants