Ejemplo n.º 1
0
def generateRequest():
	with MicrophoneStream(RATE, CHUNK) as stream:
		audio_generator = stream.generator()
		messageReq = gigagenieRPC_pb2.reqQueryVoice()
		messageReq.reqOptions.lang=0
		messageReq.reqOptions.userSession="1234"
		messageReq.reqOptions.deviceId="totallyrandomdeviceid"
		yield messageReq
		for content in audio_generator:
			message = gigagenieRPC_pb2.reqQueryVoice()
			message.audioContent = content
			yield message
Ejemplo n.º 2
0
def generate_request():
    with MS.MicrophoneStream(RATE, CHUNK) as stream:
        audio_generator = stream.generator()
        messageReq = gigagenieRPC_pb2.reqQueryVoice()
        messageReq.reqOptions.lang = 0
        messageReq.reqOptions.userSession = "1234"
        messageReq.reqOptions.deviceId = "aklsjdnalksd"
        yield messageReq
        for content in audio_generator:
            message = gigagenieRPC_pb2.reqQueryVoice()
            message.audioContent = content
            yield message
            rms = audioop.rms(content, 2)
def generate_request_dss():
    with MicrophoneStream(RATE, CHUNK) as stream:
        audio_generator = stream.generator()
        messageReq = gigagenieRPC_pb2.reqQueryVoice()
        messageReq.reqOptions.lang=0
        messageReq.reqOptions.userSession=CLIENT_ID
        messageReq.reqOptions.deviceId=CLIENT_SECRET
        yield messageReq
        for content in audio_generator:
            message = gigagenieRPC_pb2.reqQueryVoice()
            message.audioContent = content
            yield message
            rms = audioop.rms(content,2)