Comments (3)
Hi Allen,
Thanks for reaching out.
Currently DeepAffects.Audio.fromFile("LOCAL_FILE_PATH");
function expects a valid audio path on the file system, so blob url might not work here.
For your use case You can do few things as follows:
- Download blob as file and the pass it to
DeepAffects.Audio.fromFile("LOCAL_FILE_PATH");
- Convert blob to base64 and and pass it as content parameter in the request body, thats what
.fromFIle
does under the hood.
Thanks
DeepAffects
from deepaffects-node.
Hi @viveknimkarde I'll use the conversion of blob to base64 because I'm planning to deploy the application to Heroku which don't have a file storage folder.
So currently the blob I'm getting is this:
var url = URL.createObjectURL(AudioBLOB);
console.log(url);
the snippet above returns
blob:http://localhost:3001/fcd3f823-5254-4909-9702-e58ded38ce09
so you mean if I convert the result above to base64 so I should be able to pass it in the .fromFile
function?
from deepaffects-node.
@ChunAllen Browser can directly give you base64 converted audio as follows
var reader = new FileReader();
reader.readAsDataURL(blob);
reader.onloadend = function() {
base64data = reader.result;
console.log(base64data);
}
just use it as content parameter for request body.
no need to use .fromFile in the browser
from deepaffects-node.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deepaffects-node.