Skip to content

GuillaumeGomez/rust-fmod

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 

rust-fmod Build Status

This is a rust binding for FMOD, the library developped by FIRELIGHT TECHNOLOGIES.

FMOD website : www.fmod.org

You can also find it on crates.io !

Installation

You must install on your computer the FMOD library which is used for the binding.

Since this project supports cargo, you can build it this way:

> cargo build

This isn't a binding to the lastest version. You can find the bound version here.

Documentation

You can access the rfmod documentation locally, just build it:

> cargo doc --open

You can also access the latest build of the documentation directly on docs.rs.

Short example

Here is a short example on how to create a file and to play it :

extern crate rfmod;

fn main() {
    let fmod = match rfmod::Sys::new() {
        Ok(f) => f,
        Err(e) => {
            panic!("Error code : {:?}", e);
        }
    };

    match fmod.init() {
        rfmod::Result::Ok => {}
        e => {
            panic!("FmodSys.init failed : {:?}", e);
        }
    };

    let sound = match fmod.create_sound("music.mp3", None, None) {
        Ok(s) => s,
        Err(err) => {
            panic!("Error code : {:?}", err);
        }
    };

    match sound.play_to_the_end() {
        rfmod::Result::Ok => {
            println!("Ok !");
        }
        err => {
            panic!("Error code : {:?}", err);
        }
    };
}

For a more complete example : https://github.com/GuillaumeGomez/rust-music-player

License

Please refer to the LICENSE.txt file for more details.
If you want more information, here is the FMOD website : http://www.fmod.org/

About

A rust binding for the FMOD library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages