示例#1
0
 def __init__(self):
     self.is_playing = False
     self.vol = config.app["main"]["volume"]
     self.is_working = False
     self.queue = []
     self.stopped = True
     self.queue_pos = 0
     self.shuffle = False
     self.worker = RepeatingTimer(5, self.player_function)
     self.worker.start()
     self.output = output.Output()
     self.set_output_device(config.app["main"]["output_device"])
     self.player = None
示例#2
0
# -*- coding: utf-8 -*-
#BGT-ish Sound_lib wrapper
#Original author: Carter Temm
#Edited by Yukio Nozawa <*****@*****.**>
#Modified by me, [email protected]
import math, ctypes
import sound_lib
from sound_lib import output
from sound_lib import stream
o = output.Output()


class sound():
    def __init__(self, filename="", vol=0, playing=False, looping=False):
        self.handle = None
        self.freq = 44100
        if len(filename) > 0:
            self.load(filename)
            self.handle.looping = looping
        self.volume = vol
        self.looping = looping
        if playing == True:
            self.play(ignore_loop=False)

    def load(self, filename=""):
        if self.handle:
            self.close()


#end close previous
        self.handle = stream.FileStream(file=filename)
示例#3
0
 def initialize(self):
     global generic_output
     generic_output = (
         output.Output()
     )  # initializing default output because the 3d one doesnt work.
     generic_output.start()