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

Add support for ogg vorbis / ogg opus #15

Open
pseiler opened this issue Jun 6, 2020 · 8 comments
Open

Add support for ogg vorbis / ogg opus #15

pseiler opened this issue Jun 6, 2020 · 8 comments

Comments

@pseiler
Copy link

pseiler commented Jun 6, 2020

As I encode most of my Music as ogg vorbis, please add support for it.
Ogg Opus is also used often in podcasts etc and is a future-proof codec.

I already opened a issue on the codecs github project (mackron/dr_libs#139), but this seems not a solution for the near future.
But I found this (for vorbis support):
https://nothings.org/stb_vorbis/

@HookedBehemoth
Copy link
Owner

I had issues with flag ogg in dr_libs implementation so it's currently disabled.

About stb: Haven't tried stb_vorbis but my experience with the other stb stuff was that it uses too much dynamic memory and heavily relies on a fast unix filesystem.

e.g. stb_image takes 8 seconds loading a 1280*720 RGB bitmap from the sd card as it allocates and loads line by line.

@pseiler
Copy link
Author

pseiler commented Jun 6, 2020

I see. I haven't had a deeper look into it. I simply found this and thought this could be useful.

I'm looking forward to have vorbis support somewhen in the future.
Thank you very much!

@HookedBehemoth
Copy link
Owner

I'll look into the libopus + hwopus.

@mackron
Copy link

mackron commented Jun 9, 2020

I had issues with flag ogg in dr_libs implementation so it's currently disabled.

I'm the author of dr_flac - what was the issue with the Ogg encapsulation stuff? I'm happy to take a look at it. (Note that this is only for encapsulating a FLAC stream in an Ogg container, nothing to do with Vorbis.)

@HookedBehemoth
Copy link
Owner

Probably was because it wasn't a flac file.

Didn't really investigate at that time.

@HookedBehemoth
Copy link
Owner

Oh and another reason was that the size of oggbs is more than 8 times my stack size ^^

@mackron
Copy link

mackron commented Jun 9, 2020

Ah, yes it does that to avoid a malloc(). You can disable Ogg encapsulation with DR_FLAC_NO_OGG:

#define DR_FLAC_NO_OGG
#define DR_FLAC_IMPLEMENTATION
#include "dr_flac.h"

That should hopefully exclude that oggbs thing, albeit while also disabling Ogg encapsulation (no huge loss - it's extremely rare).

@HookedBehemoth
Copy link
Owner

Yeah I have that already.
https://github.com/HookedBehemoth/sys-tune/blob/master/sys-tune/source/impl/source.cpp#L9

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

No branches or pull requests

3 participants