MaxMod2.MaxMod2 reference

| MaxMod2.MaxMod2: | Functions | Modinfo | Source |

MaxMod2

## Constants

Constants | Description
--- | ---
MM_BYTES | value passed represents number of bytes
MM_SAMPLES | value passed represents number of audio samples
MM_MILLISECS | value passed represents milliseconds
MM_SEQUENCE | value passed represents tracker sequence number
MM_LINE | value passed represents tracker line number
MM_TRACK | value passed represents a track number

## Functions Summary

AddChannelEffect | Add an effect filter to a channel.
ChannelSeek | Seek the audio to the given position, if available.
ChannelSeekable | Query if audio is seekable.
CreateAudioCallbackStream | Start a new audio callback stream.
CreateMemoryStream | Streams music to memory using a thread.
CueMusic | Cue a new music stream.
GetChannelLength | Returns the total length of audio.
GetChannelLoop | Get the channels loop mode.
GetChannelPosition | Retrieve the current stream position.
GetChannelUV | Set the channels loop points.
LoadMusic | Streams audio outputs to a TAudioSample for use with the BlitzMax LoadSound command.
MaxModVerbose | Set the verbose debug mode for all maxmod modules.
MusicExtensions | Query supported music formats for streaming.
OutputWavFile | Stream audio output to file.
PlayMusic | Start a new music stream.
SetAudioStreamDriver | Initialize MaxMods audio stream for playback.
SetChannelLoop | Set the channels loop mode.
SetChannelLoopPoints | Set the channels loop points.
SetGlobalVolume | Set the global volume.

## Functions

Function AddChannelEffect:Int(channel:TChannel, effect:TMaxModEffect)
Returns | True if successfull.
Description | Add an effect filter to a channel.

Information

Parameters: | Description:
--- | ---
channel | TChannel object to apply the effect with
effect | TMaxModEffect filter object to apply to the channel

Function ChannelSeek:Int(Channel:TChannel,Pos:Int,Mode:Int=MM_SAMPLES)
Returns | True if seeking was successful, else False.
Description | Seek the audio to the given position, if available.

Information

Parameters: | Description:
--- | ---
Channel | Channel to perform seek on
Pos | Position to seek too
Mode | Format of the Pos value, can be either MM_SAMPLES, MM_BYTES or MM_MILLISECS Defaults to MM_SAMPLES

Function ChannelSeekable:Int(Channel:TChannel)
Returns | True if seekable, else False.
Description | Query if audio is seekable.

Function CreateAudioCallbackStream:TChannel(Music:TCustomMusic,Loop:Int=False,Paused:Int=False)
Returns | A TChannel object.
Description | Start a new audio callback stream.

Information

Parameters: | Description:
--- | ---
Music | A TCustomMusic object to use for audio stream
Loop | True to loop the stream forever False to play the stream only once (defaults to False)
Paused | True to create the stream in a paused state False to start playback on creation of the stream (defaults to False)

Function CreateMemoryStream:TChannel(URL:Object,buf:Byte Ptr)
Returns | A TChannel object.
Description | Streams music to memory using a thread.

Information

Parameters: | Description:
--- | ---
URL | URL to the audio you want to stream
buf | a pointer to the memory where to write

Function CueMusic:TChannel(URL:Object,Loop:Int=False)
Returns | A TChannel object.
Description | Cue a new music stream.

Information

Parameters: | Description:
--- | ---
URL | URL to the audio you want to stream
Loop | True to loop the stream forever False to play the stream only once (defaults to False)
Paused | True to create the stream in a paused state False to start playback on creation of the stream (defaults to False)

Function GetChannelLength:Int(Channel:TChannel,Mode:Int=MM_SAMPLES)
Description | Returns the total length of audio.

Information

Parameters: | Description:
--- | ---
Channel | Channel to retrieve length from
Mode | Format of the length returned, can be either MM_SAMPLES, MM_BYTES or MM_MILLISECS Defaults to MM_SAMPLES

Function GetChannelLoop:Int(Channel:TChannel)
Returns | True if the audio is in looping mode, else False.
Description | Get the channels loop mode.

Function GetChannelPosition:Int(Channel:TChannel,Mode:Int=MM_SAMPLES)
Description | Retrieve the current stream position.

Information

Parameters: | Description:
--- | ---
Channel | Channel to retrieve position from
Mode | Format of the returned position, can be either MM_SAMPLES, MM_BYTES or MM_MILLISECS Defaults to MM_SAMPLES

Function GetChannelUV(Channel:TChannel,L:Double Var, R:Double Var)
Description | Set the channels loop points.

Information

Parameters: | Description:
--- | ---
Channel | Channel to change loop point on
Start | Position in samples to start loop at
EndSample | Position in samples to end loop at

Function LoadMusic:TAudioSample( URL:String )
Returns | A TAudioSample object.
Description | Streams audio outputs to a TAudioSample for use with the BlitzMax LoadSound command.

Function MaxModVerbose(bool:Int)
Description | Set the verbose debug mode for all maxmod modules.
Information | Calling this function with a value of True will cause maxmod to spew debug infomation during execution.

Function MusicExtensions:String(AllSupported:Int=True,AllFiles:Int=True)
Returns | a string for use with RequestFile() ect.
Description | Query supported music formats for streaming.

Information

Parameters: | Description:
--- | ---
AllSupported | adds an "all supported" item to the filter list
AllFiles | adds an "all files" item to the filter list

Function OutputWavFile:TChannel(source:Object, destination:Object)
Description | Stream audio output to file.

Information

Parameters: | Description:
--- | ---
Volume | Volume to be applied to all audio output, 0=silent, 0.5=half, 1=normal, 2=double etc

Function PlayMusic:TChannel(URL:Object,Loop:Int=False)
Returns | A TChannel object.
Description | Start a new music stream.

Information

Parameters: | Description:
--- | ---
URL | URL to the audio you want to stream
Loop | True to loop the stream forever False to play the stream only once (defaults to False)
Paused | True to create the stream in a paused state False to start playback on creation of the stream (defaults to False)

Function SetAudioStreamDriver(name$)
Description | Initialize MaxMods audio stream for playback.
Information | You can use this function to start an audio stream driver without using it for sample playback, allowing you to still use other audio drivers and still take advantage of maxmod2 audio streaming.

Function SetChannelLoop(Channel:TChannel,Bool:Int=True)
Description | Set the channels loop mode.

Information

Parameters: | Description:
--- | ---
Channel | Channel to set looping mode on
Bool | True to enable looping on this channel, False to disable it

Function SetChannelLoopPoints(Channel:TChannel,Start:Int,Length:Int)
Description | Set the channels loop points.

Information

Parameters: | Description:
--- | ---
Channel | Channel to change loop point on
Start | Position in samples to start loop at
EndSample | Position in samples to end loop at

Function SetGlobalVolume(Volume:Double)
Description | Set the global volume.

Information

Parameters: | Description:
--- | ---
Volume | Volume to be applied to all audio output, 0=silent, 0.5=half, 1=normal, 2=double etc

## Module Information

MaxMod2 | Audio Driver V1.0
Author | REDi - Cliff Harman
License | MIT