
\                 @   s   d  d l  m Z m Z d  d l Z d  d l m Z d  d l Z d  d l m Z d  d l	 m
 Z
 d  d l m Z e j d d    Z d S)	    )HttpResponseJsonResponseN)
S3Transfer)settings)SurveyReport)appc       
      C   s   d d  l  } | j   } d t j d t j i } t j d d |  } | j d d t |  t j	 d t |   t j	 d t |  } | j
 |   } | j |  } Wd  QRX| j |  } t j j d	 t |    }	 t |  |	 _ |	 j   d  S)
Nr   aws_access_key_idaws_secret_access_keys3z	us-east-1dls2018z
recording/zrecordings/pk)Zspeech_recognitionZ
Recognizerr   AWS_ACCESS_KEYAWS_SECRET_KEYboto3clientdownload_filestr
MEDIA_ROOTZ	AudioFilerecordZrecognize_googler   objectsgetintvessel_descriptionsave)
survey_report_idoriginal_namesrrcredentialsr   audiosourcer   Zsurvey_update r!   :/var/www/html/dls.localhost.com/myproject/dls_api/tasks.pytext_to_speech	   s    	.r#   )django.httpr   r   r   boto3.s3.transferr   requestsdjango.confr   
dls.modelsr   Zmyproject.celeryr   taskr#   r!   r!   r!   r"   <module>   s   