Board.music#

`` Board.music`` handles Music in your miniworlder.

You can add a music with:

if board.music.is_playing():
    board.music.play(path)

When you call music.play() with the path to a new piece of music, the current music is paused and the new music is started.

class miniworldmaker.boards.board_manager.board_music_manager.BoardMusicManager(app)[source]#

Public Methods:

__init__(app)

pause()

pauses a music

is_playing()

returns True, if board is playing a music (and music ist not paused")

get_path()

gets path to current music

play([path])

plays a music from path

stop()

stops a music

set_volume(volume)

sets volume of music

get_volume()

gets volume of music


get_path()[source]#

gets path to current music

Return type:

str

Returns:

The path to current music file

get_volume()[source]#

gets volume of music

Return type:

float

Returns:

current volume

is_playing()[source]#

returns True, if board is playing a music (and music ist not paused”)

Return type:

bool

pause()[source]#

pauses a music

play(path=None)[source]#

plays a music from path

Parameters:

path – The path to the music

Returns:

set_volume(volume)[source]#

sets volume of music

Parameters:

volume – Volume between 0 and 100

stop()[source]#

stops a music

Returns: