bass 0.1.2

Binding for BASS audio library.


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

bindbc-raylib3

This project provides bindings to the BASS, a simple and easy-to-use library to enjoy audio programming.

See API.

Usage

To use BASS, add bass as a dependency to your project's package config file.

dub.json

dependencies {
    "bass": "~>0.1.0",
}

dub.sdl

dependency "bass" version="~>0.1.0"

Examples

You can find examples inside examples directory.

A simple example:

import std.stdio;
import std.string;
import std.conv;

import bass;

void main()
{
    BASS_Init(-1, 44100, 0, null, null);
    auto chan = BASS_StreamCreateFile(false, "audio.mp3", 0, 0, 0);
    BASS_ChannelPlay(chan, false);
    while (true) {
        auto pos = BASS_ChannelGetPosition(chan, 0);
        auto len = BASS_ChannelGetLength(chan, 0);
        auto time = BASS_ChannelBytes2Seconds(chan, pos);
        auto total = BASS_ChannelBytes2Seconds(chan, len);
        writefln("pos: %s/%s", time.to!string, total.to!string);
    }
}

Dependencies

Authors:
  • Emir Cengiz
Dependencies:
none
Versions:
0.1.3 2023-Jul-04
0.1.2 2023-Jul-03
0.1.1 2023-Jul-03
0.1.0 2023-Jul-03
~master 2023-Jul-06
Show all 5 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 22 downloads total

Score:
0.4
Short URL:
bass.dub.pm