wait () def stop_playing ( self ): # self.sd.play("./res/non.wav") sd. _fs ) def play_audio ( self, arr ): # print(self._playing_flag) sd. wait () print ( "Recorded successful" ) # self.sd.play(myrecording) # self.sd.wait() sf. argv ) def record ( self ): print ( "Start recording" ) myrecording = sd. add_argument ( '-l', '-loop', default = "False" ) # print(parser.parse_args(sys.argv)) return parser. add_argument ( '-p', '-pid', default = "pid.txt" ) parser. add_argument ( '-t', '-time', default = "20" ) parser. add_argument ( '-f', '-file', default = "./resources/sounds/game.wav" ) parser. add_argument ( '-m', '-mode', default = "play" ) parser. add_argument ( '-d', '-device', nargs = '+' ) parser. add_argument ( '-c', '-channels', nargs = '+' ) parser. _contains_ ( "True" ) def create_parser (): parser = argparse. samplerate = _fs def _init_ ( self ): self. Import argparse import os import sys import sounddevice as sd import soundfile as sf class Music : _record_flag = False _playing_flag = False _current_time = 0 _fs = 48000 _duration = 5 # seconds sd.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |