SNESAmp.DLL Documentation

Written by Marius Fodor.
DLL created by Marius Fodor.
SPC700/DSP core by Anti Resonance.

This is a simple HTML for the functions exported by SNESAmp.DLL, click on one of the links below to jump directly to the text for that function. I would have used frames to do this, but only if I knew how to do frames. :-(

SNESAmp_Play
SNESAmp_Pause
SNESAmp_UnPause
SNESAmp_Stop
SNESAmp_SetConfig
SNESAmp_GetConfig
SNESAmp_GetID666Tag
SNESAmp_SetSongLength
SNESAmp_IsPlaying
SNESAmp_GetPlayTime
SNESAmp_SetPlayTime
SNESAmp_MuteChannels
SNESAmp_SetMixingThreadPriority
SNESAmp_GetVisParams

SNESAmp_Play

The SNESAmp_Play function loads and starts playing an SPC file.

BOOL WINAPI SNESAmp_Play(
  LPCTSTR lpszFileName
);

Return Value

Nonzero if successful; otherwise, 0.

Parameters

lpszFileName
Pointer to a null-terminated string containing the name of the SPC file to load and play.

SNESAmp_Pause

The SNESAmp_Pause function pauses the currently playing SPC.

BOOL WINAPI SNESAmp_Pause();

Return Value

Nonzero if successful; otherwise, 0.


SNESAmp_UnPause

The SNESAmp_UnPause function resumes playing of a previously paused SPC.

BOOL WINAPI SNESAmp_UnPause();

Return Value

Nonzero if successful; otherwise, 0.


SNESAmp_Stop

The SNESAmp_Stop function stops the currently playing or paused SPC.

BOOL WINAPI SNESAmp_Stop();

Return Value

Nonzero if successful; otherwise, 0.


SNESAmp_SetConfig

The SNESAmp_SetConfig function modifies the current configuration of the SNESAmp engine.

BOOL WINAPI SNESAmp_SetConfig(
  LPSNESAMP_CONFIG lpCfg
);

Return Value

Nonzero if successful; otherwise, 0.

Parameters

lpCfg
Address of an SNESAMP_CONFIG structure that contains the configuration information. Look inside the SNESAmp.h header file for the details.

SNESAmp_GetConfig

The SNESAmp_GetConfig function retrives the current configuration for the SNESAmp engine.

BOOL WINAPI SNESAmp_GetConfig(
  LPSNESAMP_CONFIG lpCfg
);

Return Value

Nonzero if successful; otherwise, 0.

Parameters

lpCfg
Address of an SNESAMP_CONFIG structure that will hold the current configuration information. Look inside the SNESAmp.h header file for the details.

SNESAmp_GetID666Tag

The SNESAmp_GetID666Tag function loads the ID666 tag that some SPC files contain.

BOOL WINAPI SNESAmp_GetID666Tag(
  LPCTSTR lpszFileName,
  LPID666_TAG lpTag
);

Return Value

Nonzero if successful; otherwise, 0.

Parameters

lpszFileName
Pointer to a null-terminated string containing the name of the SPC file to load the ID666 tag from.
lpTag
Address of an ID666_TAG structrue that will hold the ID666 information. Look inside the SNESAmp.h header file for the details.

SNESAmp_SetSongLength

The SNESAmp_SetSongLength function allows you to manually specify the length of an SPC overriding the ID666 values. Call this before calling the SNESAmp_Play function.

BOOL WINAPI SNESAmp_SetSongLength(
  INT nPlayLength,
  INT nFadeLength
);

Return Value

Nonzero if successful; otherwise, 0.

Parameters

nPlayLength
Specifies the playing length of the SPC in milliseconds.
nFadeLength
Specifies the fade-out length of the SPC in milliseconds.

SNESAmp_IsPlaying

The SNESAmp_IsPlaying function indicates whether an SPC is still playing or has stopped.

BOOL WINAPI SNESAmp_IsPlaying();

Return Value

Nonzero if an SPC is currently playing; otherwise, 0.


SNESAmp_GetPlayTime

The SNESAmp_GetPlayTime function retrieves the elapsed time, in milliseconds, for the currently playing SPC.

INT WINAPI SNESAmp_GetPlayTime();

Return Value

An integer specifying the elapsed time.


SNESAmp_SetPlayTime

The SNESAmp_SetPlayTime function seeks the current playing position to the specified value.

BOOL WINAPI SNESAmp_SetPlayTime(
  INT nPlayTime
);

Return Value

Nonzero if successful; otherwise, 0.

Parameters

nPlayTime
Specifies the position to seek to in milliseconds.

SNESAmp_MuteChannels

The SNESAmp_MuteChannels function mutes or unmutes one or more of the 8 individual DSP channels.

BOOL WINAPI SNESAmp_MuteChannels(
  INT nChannels
);

Return Value

Nonzero if successful; otherwise, 0.

Parameters

nChannels
8-bit bitmap specifying which channel to mute or unmute. Bit 0 represents channel 0, bit 1 represents channel 1 and so on. A 1 in the bit position means to mute that chanenl and a 0 means to unmute it

SNESAmp_SetMixingThreadPriority

The SNESAmp_SetMixingThreadPriority function adjusts the priority for the thread responsible for mixing the sound data.

BOOL WINAPI SNESAmp_SetMixingThreadPriority(
  INT nPriority
);

Return Value

Nonzero if successful; otherwise, 0.

Parameters

nPriority
Specifies the priority level for the mixing thread. This parameter can be one of the following values:
Priority Meaning
THREAD_PRIORITY_ABOVE_NORMAL Indicates 1 point above normal priority for the priority class.
THREAD_PRIORITY_BELOW_NORMAL Indicates 1 point below normal priority for the priority class.
THREAD_PRIORITY_HIGHEST Indicates 2 points above normal priority for the priority class.
THREAD_PRIORITY_IDLE Indicates a base priority level of 1 for IDLE_PRIORITY_CLASS, NORMAL_PRIORITY_CLASS, or HIGH_PRIORITY_CLASS processes, and a base priority level of 16 for REALTIME_PRIORITY_CLASS processes.
THREAD_PRIORITY_LOWEST Indicates 2 points below normal priority for the priority class.
THREAD_PRIORITY_NORMAL Indicates normal priority for the priority class.
THREAD_PRIORITY_TIME_CRITICAL Indicates a base priority level of 15 for IDLE_PRIORITY_CLASS, NORMAL_PRIORITY_CLASS, or HIGH_PRIORITY_CLASS processes, and a base priority level of 31 for REALTIME_PRIORITY_CLASS processes.


SNESAmp_GetVisParams

The SNESAmp_GetVisParams function retrieves the visualization parameters for the SNESAmp engine.

BOOL WINAPI SNESAmp_GetVisParams(
  LPVIS_PARAMS lpVisParams
);

Return Value

Nonzero if successful; otherwise, 0.

Parameters

lpVisParams
Address of a VIS_PARAMS structure that will hold the visualization information. Look inside the SNESAmp.h header file for the details.