<s> import pygame <EOL> class MediaPlayer ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> self . channel = None <EOL> pygame . mixer . init ( ) <EOL> def play ( self , media_file ) : <EOL> """<STR_LIT>""" <EOL> self . player = pygame . mixer . Sound ( media_file ) <EOL> if self . channel is None or not self . channel . get_busy ( ) : <EOL> self . channel = self . player . play ( ) <EOL> def close ( self ) : <EOL> """<STR_LIT>""" <EOL> if not self . channel is None : <EOL> self . channel . stop ( ) </s>
