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

Support Opus #71

Closed
ygabuev opened this issue Jul 31, 2022 · 0 comments
Closed

Support Opus #71

ygabuev opened this issue Jul 31, 2022 · 0 comments

Comments

@ygabuev
Copy link

ygabuev commented Jul 31, 2022

Let's add support for Opus!

I don't have any substantial knowledge on the matter, but afaik all Opus-encoded files are packed in Ogg containers. Correct me if I am wrong, but according to Ogg and Opus specifications, the matching function for an Ogg Opus buffer should look something like

pub fn is_oggopus(buf: &[u8]) -> bool {
    buf.len() > 35
        // Ogg
        && buf[0] == 0x4F
        && buf[1] == 0x67
        && buf[2] == 0x67
        && buf[3] == 0x53
        // Opus
        && buf[28] == 0x4F
        && buf[29] == 0x70
        && buf[30] == 0x75
        && buf[31] == 0x73
        && buf[32] == 0x48
        && buf[33] == 0x65
        && buf[34] == 0x61
        && buf[35] == 0x64
}
@ygabuev ygabuev changed the title Support opus Support Opus Jul 31, 2022
@bojand bojand closed this as completed in 8798e33 Oct 29, 2022
bojand added a commit that referenced this issue Oct 29, 2022
feat: add support for Ogg Opus format. fixes #71
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

1 participant