Skip to content

A simple single-header Organya decoding library written in C89.

License

Notifications You must be signed in to change notification settings

Strultz/organya.h

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

organya.h

Description

organya.h is a simple single-header Organya decoding library written in C89.

Organya is a sequenced music format created in 1999 by Studio Pixel and used in games such as Cave Story, Azarashi (2001 version), STARGAZER, and more.

Usage

To use this library, just #include "organya.h" in your project.

In one .c file, you should define ORGANYA_IMPLEMENTATION before including the header, in order to create the implementation.

Basic Example

Create a context:

organya_context *ctx = organya_context_create();
if (ctx == NULL) {
    Error
}

Load a file:

if (organya_context_load_song_file(ctx, "path/to/file.org") < 0) {
    Error
}

Start playing:

organya_context_play(ctx);

Generate samples:

organya_context_generate_samples(ctx, output_buffer, num_samples);
  • This will output interleaved stereo host-endian signed 16-bit PCM to output_buffer.

When you're done:

organya_context_destroy(ctx);

About

A simple single-header Organya decoding library written in C89.

Topics

Resources

License

Stars

Watchers

Forks

Languages