{"id":18020917,"url":"https://github.com/edubart/minivorbis","last_synced_at":"2025-03-26T22:30:31.379Z","repository":{"id":122955250,"uuid":"316975030","full_name":"edubart/minivorbis","owner":"edubart","description":"Single-file port of libogg and libvorbis for decoding ogg sound files.","archived":false,"fork":false,"pushed_at":"2022-12-23T19:57:58.000Z","size":708,"stargazers_count":70,"open_issues_count":1,"forks_count":7,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-22T14:22:06.028Z","etag":null,"topics":["c","libogg","libvorbis","minivorbis","ogg","single-file","single-header","single-header-lib","vorbis"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/edubart.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-29T14:56:32.000Z","updated_at":"2025-02-04T22:58:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"78c9a72b-86be-4b45-9179-858f63e21bbc","html_url":"https://github.com/edubart/minivorbis","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edubart%2Fminivorbis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edubart%2Fminivorbis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edubart%2Fminivorbis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edubart%2Fminivorbis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edubart","download_url":"https://codeload.github.com/edubart/minivorbis/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245747385,"owners_count":20665779,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","libogg","libvorbis","minivorbis","ogg","single-file","single-header","single-header-lib","vorbis"],"created_at":"2024-10-30T06:08:16.830Z","updated_at":"2025-03-26T22:30:31.372Z","avatar_url":"https://github.com/edubart.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MiniVorbis\n\nThis is libogg 1.3.4 + libvorbis 1.3.7 contained in a single header\nto be bundled in C/C++ applications with ease for decoding OGG sound files.\n[Ogg Vorbis](https://en.wikipedia.org/wiki/Vorbis) is a open general-purpose compressed audio format\nfor mid to high quality audio and music at fixed and variable bitrates.\n\n## Example Usage\n\n```c\n#define OGG_IMPL\n#define VORBIS_IMPL\n#include \"minivorbis.h\"\n\nint main(int argc, char** argv)\n{\n    if(argc \u003c 2) {\n        printf(\"No input file.\\n\");\n        return -1;\n    }\n    /* Open sound file. */\n    FILE* fp = fopen(argv[1], \"rb\");\n    if(!fp) {\n        printf(\"Failed to open file '%s'.\", argv[1]);\n        return -1;\n    }\n    /* Open sound stream. */\n    OggVorbis_File vorbis;\n    if(ov_open_callbacks(fp, \u0026vorbis, NULL, 0, OV_CALLBACKS_DEFAULT) != 0) {\n        printf(\"Invalid Ogg file '%s'.\", argv[1]);\n        return -1;\n    }\n    /* Print sound information. */\n    vorbis_info* info = ov_info(\u0026vorbis, -1);\n    printf(\"Ogg file %d Hz, %d channels, %d kbit/s.\\n\", info-\u003erate, info-\u003echannels, info-\u003ebitrate_nominal / 1024);\n    /* Read the entire sound stream. */\n    unsigned char buf[4096];\n    while(1) {\n        int section = 0;\n        long bytes = ov_read(\u0026vorbis, buf, sizeof(buf), 0, 2, 1, \u0026section);\n        if(bytes \u003c= 0) /* end of file or error */\n            break;\n    }\n    /* Close sound file */\n    ov_clear(\u0026vorbis);\n    return 0;\n}\n```\n\n## Usage\n\nCopy `minivorbis.h` into your C/C++ project, include it anywhere you want to use the Vorbis API.\nThen do the following in *one* C file to implement Ogg and Vorbis:\n```c\n#define OGG_IMPL\n#define VORBIS_IMPL\n#include \"minivorbis.h\"\n```\n\nOptionally provide the following defines:\n  - `OV_EXCLUDE_STATIC_CALLBACKS`     - exclude the default static callbacks\n\nNote that almost no modification was made in the Ogg/Vorbis implementation code,\nthus there are some C variable names that may collide with your code,\ntherefore it is best to declare the implementation in dedicated C file.\n\n## Documentation\n\nFor documentation on how to use Ogg and Vorbis read its [official documentation](https://xiph.org/doc/).\n\n## Extra Miniaudio Vorbis Decoder\n\nYou can use `miniaudio_vorbis.h` to replace Vorbis decoder of the awesome\nsingle-header [miniaudio](https://miniaud.io/) library with minivorbis, follow the\ninstructions described on it.\n\n## Updates\n\n- **02-Nov-2020**: Library created, using Ogg 1.3.4 and Vorbis 1.3.7.\n\n## Notes\n\nThe header is generated using the bash script `gen.sh` all modifications done is there.\n\n## License\n\nBSD-like License, same as libogg and libvorbis, see LICENSE.txt for information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedubart%2Fminivorbis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedubart%2Fminivorbis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedubart%2Fminivorbis/lists"}