core.components.event.actions.sound module

class core.components.event.actions.sound.Sound[source]

Bases: object

fadeout_music(game, action)[source]

Fades out the music over a set amount of time in milliseconds

Parameters:
  • game (core.control.Control) – The main game object that contains all the game’s variables.
  • action (Tuple) – The action (tuple) retrieved from the database that contains the action’s parameters
Return type:

None

Returns:

None

Valid Parameters: time_milliseconds

Examples:

>>> action.__dict__
{
    "type": "fadeout_music",
    "parameters": [
        "1000"
    ]
}
pause_music(game, action)[source]

Pauses the current music playback

Parameters:
  • game (core.control.Control) – The main game object that contains all the game’s variables.
  • action (Tuple) – The action (tuple) retrieved from the database that contains the action’s parameters
Return type:

None

Returns:

None

Valid Parameters: None

Examples:

>>> action.__dict__
{
    "type": "play_music",
    "parameters": []
}
play_music(game, action)[source]

Plays a music file from “resources/music/”

Parameters:
  • game (core.control.Control) – The main game object that contains all the game’s variables.
  • action (Tuple) – The action (tuple) retrieved from the database that contains the action’s parameters
Return type:

None

Returns:

None

Valid Parameters: filename

Examples:

>>> action.__dict__
{
    "type": "play_music",
    "parameters": [
        "147066_pokemon.ogg"
    ]
}
play_sound(game, action)[source]

Plays a sound from “resources/sounds/”

Parameters:
  • game (core.control.Control) – The main game object that contains all the game’s variables.
  • action (Tuple) – The action (tuple) retrieved from the database that contains the action’s parameters
Return type:

None

Returns:

None

Valid Parameters: filename

Examples:

>>> action.__dict__
{
    "type": "play_sound",
    "parameters": [
        "interface/NenadSimic_Click.ogg"
    ]
}