Clone and edit this document
Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
aflr npm
node v10.24.1
version:
0.3.6
endpoint
share
tweet
Aflorithmic Javascript SDK example usage with CommonJS
const Aflr = require("aflr").default; async function example() { try { Aflr.configure({ apiKey: process.env.apikey, debug: true }); const script = await Aflr.Script.create({ scriptText: "Hello world" }); console.log(script); const speech = await Aflr.Speech.create({ scriptId: script["scriptId"] }); console.log(speech); const bg_tracks = await Aflr.Sound.list(); console.log(bg_tracks); const mastering = await Aflr.Mastering.create({ scriptId: script["scriptId"], backgroundTrackId: bg_tracks[0]["id"], audience: [{}] }); console.log(mastering); const masteringResult = await Aflr.Mastering.retrieve(script["scriptId"], {}); console.log(masteringResult); } catch (e) { console.error(e); } } example();
Loading…
no comments
sign in
to comment