Page 1129 - 3-2
P. 1129
elif re.search('Fan Off', data, re.I):
ser.write('d')
elif re.search('Led_1 On', data, re.I):
ser.write('e')
elif re.search('Led_1 Off', data, re.I):
ser.write('f')
elif re.search('Led_2 On', data, re.I):
ser.write('g')
elif re.search('Led_2 Off', data, re.I):
ser.write('h')
elif re.search('Curtain On', data, re.I):
ser.write('i')
elif re.search('Curtain Off', data, re.I):
ser.write('j')
except KeyboardInterrupt :
serverSocket.close()
****** 음성인식 코드**********************************
# -*- coding: utf8 -*-
#!/usr/bin/python
# 하위모듈 음성인식 모듈:
# Copyright (C) 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Sample that streams audio to the Google Cloud Speech API via GRPC."""
from __future__ import division
- 1129 -