o
    ^9h                      @   s<   d dl mZ d dlmZ d dlZd dlZd dlZdd ZdS )    )jsonify)AudioSegmentNc                 C   s   t | }|  t|j}tj| }tj	|\}}d| d}tj
d}	tj|	|}
tj|	dd t|}||d |d  }|j|
dd}|
S )	Ntrimmed_z.mp3z	./output/T)exist_oki  mp3)format)requestsgetraise_for_statusioBytesIOcontentospathbasenamesplitextrealpathjoinmakedirsr   	from_fileexport)	audio_urlstartendresponseaudiooriginal_filenamenameexttrimmed_filename
output_diroutput_path	ogg_audiotrimmed	mp3_audio r%   //var/www/html/audio_editor/app/audio_trimmer.py
trim_audio   s   

r'   )flaskr   pydubr   r   r   r   r'   r%   r%   r%   r&   <module>   s    