Giter Club home page Giter Club logo

liekkas's Introduction

Liekkas

a simple audio wrapper libary base on OpenAL. inspired by Liekkas. ;)

support platform

platform status
MAC OSX done
window done
ios done
android done
ubuntu working

support audio format

audio format status
CAF done
mp3 done
wav done
ogg done

require

  1. OpenAL
  2. mpg123 (if you want support mp3)
  3. libvorbis (if you want support ogg)
  4. mingw32 (window need)
  5. lua (>=lua5.2)

tutorial

$ make
$ make sound_test

read t.lua for more detail.

android

$ make android

read test_audio_jni.c and TestAudio.java for more detail.

LUA API

simple effect sound API

  local sound = require "sound"

  sound:load(file_path [, file_type])                     -- load a audio file
  sound:unload(file_path)                                 -- unload a audio file
  sound:play(file_path, [loop, [pitch, [gain]]])          -- play a effect sound

background music API

  local music = require "music"

  music.load(file_path)          -- preload a music sound
  music.play(file_path, loop)    -- play a music sound, will load audio file when not load.
  music.stop()                   -- stop the current playing music sound
  
  music.open()                   -- open background music
  music.close()                  -- close background music

audio API

  local audio = require "audio"

  audio:load(file_path)          -- load sound file
  audio.unload(file_path)        -- unload sound file

  audio:listen_position(x, y, z) -- set listener position

group effect sound API

  local audio = require "audio"

  local group1 = audio:create_group([count]) -- create a sound group has count source
  local handle = group1:add(file_path, [loop, [pitch, [gain, [max_distanc]]]]) -- add sound file to group

  group1:play(handle)    -- play sound
  group1:stop(handle)    -- stop sound
  group1:rewind(handle)  -- rewind sound
  group1:pause(handle)   -- pause sound
  group1:position(handle, x, y, z) -- set source position
  group1:volume(handle, v)  -- set source volume

  group1:open()          -- open group all sound
  group1:close()         -- stop and close group all sound

read audio.lua wrapper file for more detail.

interrupt interface

// call after interruption starts
void oal_interrupted();

// call after interruption ends
void oal_resumed();

liekkas's People

Contributors

lvzixun avatar rainfiel avatar desertlost avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.