This is a set of lambda and ffmpeg powered tools for working with audio from Amazon Connect
This layer includes:
- statically compiled ffmpeg
- boto3
- pydub
- requests
- ffmpeg-python
This function overlays two audio tracks and accepts input in the following form:
{
"sources": [{
"Bucket": "",
"Key": ""
},
{
"Bucket": "",
"Key": ""
}],
"target": {
"Bucket": "",
"Key": ""
}
}This function mutes/removes sections of audio from a track based no timestamps and accepts input in the following form:
{
"source": {
"Bucket": "",
"Key": ""
},
"target": {
"Bucket": "",
"Key": ""
},
"timestamps": [
{"begin": "1000", "end": "2000"},
{"begin": "5000", "end": "8000"}
]
}-
Install CDK (npm i -g aws-cdk)
-
First build the layer:
cd resources/connect-audio-utils-layer mkdir bin/ curl -s https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz | tar -xJC bin --strip=1 'ffmpeg-*-amd64-static/ffmpeg' docker run --rm -v $(pwd):/foo -w /foo lambci/lambda:build-python3.8 pip3 install -r requirements.txt -t python zip -r9 layer.zip bin python -x "*.pyc"
-
Change back to root directory of project
cd ../.. -
Install deps:
npm install -
Next run
npm run build -
Deploy with run
cdk deploy(you may need to runcdk bootstrapfirst)
npm run buildcompile typescript to jsnpm run watchwatch for changes and compilenpm run testperform the jest unit testscdk deploydeploy this stack to your default AWS account/regioncdk diffcompare deployed stack with current statecdk synthemits the synthesized CloudFormation template
This project is licensed under the Apache-2.0 License.