"No one can be told what GeeXLab is, you have to see it for yourself!"

"Stop Playing Games and Start Making Them! With GeeXLab, your are on your way!"


Quick Links
What is GeeXLab
Download GeeXLab
GeeXLab Requirements
Online Help
Articles and Tutorials
Samples Screenshots
Videos

GeeXLab Changelog

XML Ref. Guide
Scripting Ref. Guide
Code Samples

Purchase GeeXLab
GeeXLab SDK

Shader Library

Follow GeeXLab's News
GeeXLab news, articles, tutorials and demos @ Geeks3D.com
GeeXLab @ Twitter GeeXLab RSS Feed

Subscribe to GeeXLab news by email

[ Back to Geeks3D.com ]

GeeXLab

GeeXLab

Laboratory for Real Time 3D Programming (prototyping and demos)
OpenGL, Lua, Python, GLSL,
PhysX and more...

Reference Guide
Host-API Lua / Python



Back to Homepage
Back to Developer's Guide Index

HYP_Sound Library


Description
Sound library

Number of functions: 27

HYP_Sound.GetId

Description
Returns sound id from XML name. Useful when the sound has been loaded from the XML description.

Languages: Lua - Python

Return Values
  • id [INTEGER]: sound id

    Code sample :

    soundId = HYP_Sound.GetId("water")


    HYP_Sound.Load

    Description
    Loads a sound file from a relative path.

    Languages: Lua - Python

    Parameters
  • file [STRING]: sound file - relative path.
  • loop [INTEGER]: loop mode. - Values = 0|1

    Return Values
  • id [INTEGER]: sound id

    Code sample :

    waterSoundId = HYP_Sound.Load("data/water.mp3", 1)


    HYP_Sound.Unload

    Description
    Unloads a sound.

    Languages: Lua - Python

    Parameters
  • soundId [INTEGER]: sound id.

    Code sample :

    HYP_Sound.Unload(waterSoundId)


    HYP_Sound.Play

    Description
    Plays a sound.

    Languages: Lua - Python

    Parameters
  • soundId [INTEGER]: sound id.

    Code sample :

    HYP_Sound.Play(waterSoundId)


    HYP_Sound.Stop

    Description
    Stops sound playing.

    Languages: Lua - Python

    Parameters
  • soundId [INTEGER]: sound id.

    Code sample :

    HYP_Sound.Stop(waterSoundId)


    HYP_Sound.Enable_DSP_Unit

    Description
    Enables sound system DSP unit. This function should be called once per frame in conjunczion with GetSpectrumValue(). FMOD only

    Languages: Lua

    Code sample :

    HYP_Sound.Enable_DSP_Unit()


    HYP_Sound.Disable_DSP_Unit

    Description
    Disables the DSP unit. FMOD only.

    Languages: Lua

    Code sample :

    HYP_Sound.Disable_DSP_Unit()


    HYP_Sound.GetSpectrumValue

    Description
    Returns the spectrum buffer values (frequency band's amplitude). There are 512 possible bands: 0 to 511. Sprectrum values are normalized in the range [0;1]. FMOD only.

    Languages: Lua

    Parameters
  • freq_value [INTEGER]: frequency band index - Values = [0;511]

    Return Values
  • amp [REAL]: frequency band amplitude.

    Code sample :

    amp = HYP_Sound.GetSpectrumValue(10)


    HYP_Sound.SetSourcePosition

    Description
    Specifies the position of the audio source. OpenAL and FMOD

    Languages: Lua

    Parameters
  • soundId [INTEGER]: sound id.
  • x, y, z [REAL]: source position.

    Code sample :

    HYP_Sound.SetSourcePosition(soundId, x, y. z)


    HYP_Sound.SetListenerPosition

    Description
    Specifies the position of the listener (for example the active camera). OpenAL and FMOD

    Languages: Lua

    Parameters
  • x, y, z [REAL]: listener position.

    Code sample :

    HYP_Sound.SetListenerPosition(x, y. z)


    HYP_Sound.SetListenerOrientation

    Description
    Specifies the orientation of the listener (for example the active camera). OpenAL and FMOD

    Languages: Lua

    Parameters
  • forward_x, forward_y, forward_z [REAL]: listener direction vector.
  • up_x, up_y, up_z [REAL]: listener up vector.

    Code sample :

    HYP_Sound.SetListenerOrientation( forward_x, forward_y, forward_z, up_x, up_y, up_z )


    HYP_Sound.SetListenerOrientation

    Description
    Specifies the orientation of the listener (for example the active camera). OpenAL and FMOD

    Languages: Lua

    Parameters
  • forward_x, forward_y, forward_z [REAL]: listener direction vector.
  • up_x, up_y, up_z [REAL]: listener up vector.

    Code sample :

    HYP_Sound.SetListenerOrientation( forward_x, forward_y, forward_z, up_x, up_y, up_z )


    HYP_Sound.SetTrackVolume

    Description
    Sets the volume of a specific sound object. FMOD only.

    Languages: Lua

    Parameters
  • soundId [INTEGER]: sound id.
  • volume [INTEGER]: sound volume. - Values = [0; 255]

    Code sample :

    HYP_Sound.SetTrackVolume(soundId, volume)


    HYP_Sound.GetTrackVolume

    Description
    Gets the volume of a specific sound object. FMOD only.

    Languages: Lua

    Parameters
  • soundId [INTEGER]: sound id.

    Return Values
  • volume [INTEGER]: sound volume.

    Code sample :

    volume = HYP_Sound.GetTrackVolume(soundId)


    HYP_Sound.GetTrackTime

    Description
    Gets the elapsed time since the beginning of the soundtrack in milliseconds.

    Languages: Lua

    Parameters
  • id [INTEGER]: Soundtrack identifier

    Return Values
  • elapsed_time [INTEGER]: Playlist identifier

    Code sample :

    elapsed_time = HYP_Sound.GetTrackTime( id )


    HYP_Sound.GetTrackVolume

    Description
    Gets the volume of a particular soundtrack.

    Languages: Lua

    Parameters
  • id [INTEGER]: Soundtrack identifier

    Return Values
  • volume [INTEGER]: Volume of soundtrack, values range from 0 to 255.

    Code sample :

    volume = HYP_Sound.GetTrackVolume( id )


    HYP_Sound.IsTrackFinished

    Description
    Lets you know if a soundtrack is still played or not. Returns 1 if track is finiched else 0.

    Languages: Lua

    Parameters
  • id [INTEGER]: Soundtrack identifier

    Return Values
  • state [INTEGER]: Status of soundtrack : 1 finished ; 0 not finished.

    Code sample :

    state = HYP_Sound.IsTrackFinished( id )


    HYP_Sound.MP3Player_Open

    Description
    Creates an audio node using the internal MP3 player, loads the audio file and returns the audio id.

    Languages: Lua - Python

    Parameters
  • file [STRING]: sound file - relative path.
  • loop [INTEGER]: loop mode. - Values = 0|1

    Return Values
  • id [INTEGER]: sound id

    Code sample :

    waterSoundId = HYP_Sound.MP3Player_Open("data/water.mp3", 1)


    HYP_Sound.MP3Player_Close

    Description
    Closes and frees an audio node created by MP3Player_Open().

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: sound id

    Code sample :

    HYP_Sound.MP3Player_Close(id)


    HYP_Sound.MP3Player_Play

    Description
    Starts the playing.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: sound id

    Code sample :

    HYP_Sound.MP3Player_Play(id)


    HYP_Sound.MP3Player_SetVolume

    Description
    Sets the volume [0;255].

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: sound id
  • volume [INTEGER]: volume [0;255]

    Code sample :

    HYP_Sound.MP3Player_SetVolume(id, 255)


    HYP_Sound.MP3Player_GetVolume

    Description
    Gets the volume [0;255].

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: sound id

    Return Values
  • volume [INTEGER]: volume [0;255]

    Code sample :

    volume = HYP_Sound.MP3Player_GetVolume(id)


    HYP_Sound.MP3Player_GetDuration

    Description
    Gets the duration in seconds of the audio track.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: sound id

    Return Values
  • duration [REAL]: volume [0;255]

    Code sample :

    duration = HYP_Sound.MP3Player_GetDuration(id)


    HYP_Sound.MP3Player_GetPosition

    Description
    Gets the current position in seconds of the audio track.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: sound id

    Return Values
  • position [REAL]: volume [0;255]

    Code sample :

    pos = HYP_Sound.MP3Player_GetPosition(id)


    HYP_Sound.MP3Player_Pause

    Description
    Pauses a sound track.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: sound id

    Code sample :

    HYP_Sound.MP3Player_Pause(id)


    HYP_Sound.MP3Player_Restart

    Description
    Restart a sound track after a pause.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: sound id

    Code sample :

    HYP_Sound.MP3Player_Restart(id)


    HYP_Sound.MP3Player_Reset

    Description
    Stop and reset a sound track.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: sound id

    Code sample :

    HYP_Sound.MP3Player_Reset(id)




  • Random Projects

    Lens Circle Effect
    Lens Circle Effect

    2D Shockwave Effect
    2D Shockwave Effect

    Posterization Effect
    Posterization Effect


    Random Code Samples

    W4K Format Loading
    W4K Format Loading

    Point Light - Phong Lighting
    Point Light - Phong Lighting

    MP3 File
    MP3 File



    (C)2009-2010 Geeks3D.com