@imgly/plugin-ai-audio-generation-web 0.2.5 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/README.md +34 -0
- package/dist/elevenlabs/index.mjs +2 -2
- package/dist/elevenlabs/index.mjs.map +4 -4
- package/dist/index.d.ts +1 -3
- package/dist/index.mjs +8 -8
- package/dist/index.mjs.map +4 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,12 +2,40 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.2.7] - 2025-09-26
|
|
6
|
+
|
|
7
|
+
### New Features
|
|
8
|
+
|
|
9
|
+
- [image-generation] **QwenImageEdit Provider**: Added Qwen image editing provider via fal.ai for advanced image-to-image transformation with text prompts, supporting all standard quick actions
|
|
10
|
+
- [video-generation] **MinimaxHailuo02StandardImageToVideo Provider**: Added Minimax Hailuo-02 Standard image-to-video provider via fal.ai for transforming still images into videos with selectable resolutions (512P: 912×512, 768P: 1280×720) and adjustable durations (6 or 10 seconds)
|
|
11
|
+
- [video-generation] **ByteDance Seedance v1 Pro Providers**: Added ByteDance Seedance v1 Pro text-to-video and image-to-video providers via fal.ai with:
|
|
12
|
+
- Text-to-video generation from text descriptions with customizable aspect ratios
|
|
13
|
+
- Image-to-video transformation with dynamic motion generation from still images
|
|
14
|
+
- Multiple aspect ratio options (21:9, 16:9, 4:3, 1:1, 3:4, 9:16, or auto from image for i2v)
|
|
15
|
+
- Adjustable duration (3-12 seconds, default 5)
|
|
16
|
+
- Resolution options (480p, 720p, 1080p)
|
|
17
|
+
- Proper aspect ratio handling in placeholder blocks based on user selection
|
|
18
|
+
|
|
19
|
+
- [all] **Property Configuration System**: Providers can now define default values for their properties. Defaults can be static values or dynamic based on context (language, design state, etc.)
|
|
20
|
+
|
|
21
|
+
- [image-generation] **Recraft Provider Defaults**: Recraft providers (V3 and 20b) now support configurable default values for all properties, including dynamic style defaults based on the selected style type
|
|
22
|
+
|
|
23
|
+
## [0.2.6] - 2025-09-09
|
|
24
|
+
|
|
25
|
+
### New Features
|
|
26
|
+
|
|
27
|
+
- [all] **Feature API Integration**: Added comprehensive Feature API support across all AI plugins to control visibility and availability of features through feature flags. Core features include `providerSelect`, `quickAction`, `quickAction.providerSelect`, `fromText`, and `fromImage` flags.
|
|
28
|
+
- [all] **Quick Action Feature Flags**: Each quick action now automatically registers and respects its own feature flag (e.g., `ly.img.plugin-ai-image-generation-web.quickAction.editImage`), allowing fine-grained control over which quick actions are available to users.
|
|
29
|
+
- [image-generation] **Provider Style Group Control**: Added Feature API support for Recraft providers to control style group visibility. RecraftV3 supports `style.image` and `style.vector` flags, while Recraft20b adds `style.icon` flag for controlling icon style availability.
|
|
30
|
+
- [all] **Provider Selection Feature Flags**: Added support for controlling provider selection UI in both panels (`providerSelect`) and quick actions (`quickAction.providerSelect`), with proper handling when multiple providers are configured.
|
|
31
|
+
|
|
5
32
|
## [0.2.5] - 2025-09-03
|
|
6
33
|
|
|
7
34
|
### New Features
|
|
8
35
|
|
|
9
36
|
- [image-generation] **NanoBanana Provider**: Added NanoBanana text-to-image provider via fal.ai with fast generation times, 1024×1024 resolution, support for multiple output formats (JPEG, PNG), configurable number of images (1-4), and remixPageWithPrompt quick action
|
|
10
37
|
- [image-generation] **NanoBananaEdit Provider**: Added NanoBananaEdit image-to-image provider via fal.ai for editing existing images with text prompts, supporting all standard quick actions (editImage, swapBackground, styleTransfer, artistTransfer, createVariant, combineImages with up to 10 images, remixPage, remixPageWithPrompt)
|
|
38
|
+
- [all] **AI Style Asset Library Translations**: AI style presets in asset libraries now automatically use localized names and descriptions from provider translation files, eliminating the need for manual translation configuration
|
|
11
39
|
|
|
12
40
|
### Bug Fixes
|
|
13
41
|
|
package/README.md
CHANGED
|
@@ -48,6 +48,12 @@ CreativeEditorSDK.create(domElement, {
|
|
|
48
48
|
headers: {
|
|
49
49
|
'x-custom-header': 'value',
|
|
50
50
|
'x-client-version': '1.0.0'
|
|
51
|
+
},
|
|
52
|
+
// Optional: Configure default property values
|
|
53
|
+
properties: {
|
|
54
|
+
voice_id: 'pNInz6obpgDQGcFmaJgB', // Default voice (Adam)
|
|
55
|
+
voice_settings_stability: 0.5,
|
|
56
|
+
voice_settings_similarity_boost: 0.75
|
|
51
57
|
}
|
|
52
58
|
}),
|
|
53
59
|
|
|
@@ -135,6 +141,12 @@ text2speech: Elevenlabs.ElevenMultilingualV2({
|
|
|
135
141
|
headers: {
|
|
136
142
|
'x-custom-header': 'value',
|
|
137
143
|
'x-client-version': '1.0.0'
|
|
144
|
+
},
|
|
145
|
+
// Optional: Configure default property values
|
|
146
|
+
properties: {
|
|
147
|
+
voice_id: 'pNInz6obpgDQGcFmaJgB', // Default voice (Adam)
|
|
148
|
+
voice_settings_stability: 0.5, // Voice stability (0.0-1.0)
|
|
149
|
+
voice_settings_similarity_boost: 0.75 // Voice similarity (0.0-1.0)
|
|
138
150
|
}
|
|
139
151
|
});
|
|
140
152
|
```
|
|
@@ -169,6 +181,11 @@ text2sound: Elevenlabs.ElevenSoundEffects({
|
|
|
169
181
|
headers: {
|
|
170
182
|
'x-custom-header': 'value',
|
|
171
183
|
'x-client-version': '1.0.0'
|
|
184
|
+
},
|
|
185
|
+
// Optional: Configure default property values
|
|
186
|
+
properties: {
|
|
187
|
+
duration_seconds: 10, // Duration of sound effect
|
|
188
|
+
prompt_influence: 0.3 // How much the prompt influences generation
|
|
172
189
|
}
|
|
173
190
|
});
|
|
174
191
|
```
|
|
@@ -192,6 +209,23 @@ cesdk.i18n.setTranslations({
|
|
|
192
209
|
});
|
|
193
210
|
```
|
|
194
211
|
|
|
212
|
+
### Feature Control
|
|
213
|
+
|
|
214
|
+
You can control various aspects of the audio generation plugin using the Feature API:
|
|
215
|
+
|
|
216
|
+
```typescript
|
|
217
|
+
// Disable provider selection for speech
|
|
218
|
+
cesdk.feature.enable('ly.img.plugin-ai-audio-generation-web.speech.providerSelect', false);
|
|
219
|
+
|
|
220
|
+
// Disable provider selection for sound effects
|
|
221
|
+
cesdk.feature.enable('ly.img.plugin-ai-audio-generation-web.sound.providerSelect', false);
|
|
222
|
+
|
|
223
|
+
// Control individual provider visibility
|
|
224
|
+
cesdk.feature.enable('ly.img.plugin-ai-audio-generation-web.providerSelect', false);
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
For more information about Feature API and available feature flags, see the [@imgly/plugin-ai-generation-web documentation](https://github.com/imgly/plugins/tree/main/packages/plugin-ai-generation-web#available-feature-flags).
|
|
228
|
+
|
|
195
229
|
### Customizing Labels and Translations
|
|
196
230
|
|
|
197
231
|
You can customize all labels and text in the AI audio generation interface using the translation system. This allows you to provide better labels for your users in any language.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Le=typeof global=="object"&&global&&global.Object===Object&&global,ge=Le
|
|
1
|
+
var Le=typeof global=="object"&&global&&global.Object===Object&&global,ge=Le,je=typeof self=="object"&&self&&self.Object===Object&&self,De=ge||je||Function("return this")(),g=De,Pe=g.Symbol,k=Pe,me=Object.prototype,Ne=me.hasOwnProperty,_e=me.toString,M=k?k.toStringTag:void 0;function ze(e){var t=Ne.call(e,M),i=e[M];try{e[M]=void 0;var r=!0}catch{}var n=_e.call(e);return r&&(t?e[M]=i:delete e[M]),n}var Oe=ze,Ue=Object.prototype,Re=Ue.toString;function Be(e){return Re.call(e)}var Fe=Be,Ve="[object Null]",qe="[object Undefined]",J=k?k.toStringTag:void 0;function Ge(e){return e==null?e===void 0?qe:Ve:J&&J in Object(e)?Oe(e):Fe(e)}var j=Ge;function Ye(e){return e!=null&&typeof e=="object"}var Z=Ye,Or=Array.isArray;function Qe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var be=Qe,He="[object AsyncFunction]",Ke="[object Function]",We="[object GeneratorFunction]",Ze="[object Proxy]";function Xe(e){if(!be(e))return!1;var t=j(e);return t==Ke||t==We||t==He||t==Ze}var Je=Xe,et=g["__core-js_shared__"],V=et,ee=function(){var e=/[^.]+$/.exec(V&&V.keys&&V.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function tt(e){return!!ee&&ee in e}var it=tt,rt=Function.prototype,nt=rt.toString;function ot(e){if(e!=null){try{return nt.call(e)}catch{}try{return e+""}catch{}}return""}var f=ot,at=/[\\^$.*+?()[\]{}|]/g,lt=/^\[object .+?Constructor\]$/,st=Function.prototype,ut=Object.prototype,dt=st.toString,ct=ut.hasOwnProperty,pt=RegExp("^"+dt.call(ct).replace(at,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function gt(e){if(!be(e)||it(e))return!1;var t=Je(e)?pt:lt;return t.test(f(e))}var mt=gt;function bt(e,t){return e?.[t]}var ft=bt;function yt(e,t){var i=ft(e,t);return mt(i)?i:void 0}var I=yt,ht=I(g,"WeakMap"),Y=ht;function vt(e,t){return e===t||e!==e&&t!==t}var wt=vt,kt=9007199254740991;function It(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=kt}var xt=It,Ur=Object.prototype,At="[object Arguments]";function Ct(e){return Z(e)&&j(e)==At}var te=Ct,fe=Object.prototype,St=fe.hasOwnProperty,Et=fe.propertyIsEnumerable,Rr=te(function(){return arguments}())?te:function(e){return Z(e)&&St.call(e,"callee")&&!Et.call(e,"callee")},ye=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ie=ye&&typeof module=="object"&&module&&!module.nodeType&&module,Mt=ie&&ie.exports===ye,re=Mt?g.Buffer:void 0,Br=re?re.isBuffer:void 0,Tt="[object Arguments]",$t="[object Array]",Lt="[object Boolean]",jt="[object Date]",Dt="[object Error]",Pt="[object Function]",Nt="[object Map]",_t="[object Number]",zt="[object Object]",Ot="[object RegExp]",Ut="[object Set]",Rt="[object String]",Bt="[object WeakMap]",Ft="[object ArrayBuffer]",Vt="[object DataView]",qt="[object Float32Array]",Gt="[object Float64Array]",Yt="[object Int8Array]",Qt="[object Int16Array]",Ht="[object Int32Array]",Kt="[object Uint8Array]",Wt="[object Uint8ClampedArray]",Zt="[object Uint16Array]",Xt="[object Uint32Array]",o={};o[qt]=o[Gt]=o[Yt]=o[Qt]=o[Ht]=o[Kt]=o[Wt]=o[Zt]=o[Xt]=!0;o[Tt]=o[$t]=o[Ft]=o[Lt]=o[Vt]=o[jt]=o[Dt]=o[Pt]=o[Nt]=o[_t]=o[zt]=o[Ot]=o[Ut]=o[Rt]=o[Bt]=!1;function Jt(e){return Z(e)&&xt(e.length)&&!!o[j(e)]}var ei=Jt;function ti(e){return function(t){return e(t)}}var ii=ti,he=typeof exports=="object"&&exports&&!exports.nodeType&&exports,T=he&&typeof module=="object"&&module&&!module.nodeType&&module,ri=T&&T.exports===he,q=ri&&ge.process,ni=function(){try{var e=T&&T.require&&T.require("util").types;return e||q&&q.binding&&q.binding("util")}catch{}}(),ne=ni,oe=ne&&ne.isTypedArray,Fr=oe?ii(oe):ei,oi=Object.prototype,Vr=oi.hasOwnProperty;function ai(e,t){return function(i){return e(t(i))}}var li=ai,qr=li(Object.keys,Object),si=Object.prototype,Gr=si.hasOwnProperty,ui=I(Object,"create"),$=ui;function di(){this.__data__=$?$(null):{},this.size=0}var ci=di;function pi(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var gi=pi,mi="__lodash_hash_undefined__",bi=Object.prototype,fi=bi.hasOwnProperty;function yi(e){var t=this.__data__;if($){var i=t[e];return i===mi?void 0:i}return fi.call(t,e)?t[e]:void 0}var hi=yi,vi=Object.prototype,wi=vi.hasOwnProperty;function ki(e){var t=this.__data__;return $?t[e]!==void 0:wi.call(t,e)}var Ii=ki,xi="__lodash_hash_undefined__";function Ai(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=$&&t===void 0?xi:t,this}var Ci=Ai;function x(e){var t=-1,i=e==null?0:e.length;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[1])}}x.prototype.clear=ci;x.prototype.delete=gi;x.prototype.get=hi;x.prototype.has=Ii;x.prototype.set=Ci;var ae=x;function Si(){this.__data__=[],this.size=0}var Ei=Si;function Mi(e,t){for(var i=e.length;i--;)if(wt(e[i][0],t))return i;return-1}var _=Mi,Ti=Array.prototype,$i=Ti.splice;function Li(e){var t=this.__data__,i=_(t,e);if(i<0)return!1;var r=t.length-1;return i==r?t.pop():$i.call(t,i,1),--this.size,!0}var ji=Li;function Di(e){var t=this.__data__,i=_(t,e);return i<0?void 0:t[i][1]}var Pi=Di;function Ni(e){return _(this.__data__,e)>-1}var _i=Ni;function zi(e,t){var i=this.__data__,r=_(i,e);return r<0?(++this.size,i.push([e,t])):i[r][1]=t,this}var Oi=zi;function A(e){var t=-1,i=e==null?0:e.length;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[1])}}A.prototype.clear=Ei;A.prototype.delete=ji;A.prototype.get=Pi;A.prototype.has=_i;A.prototype.set=Oi;var z=A,Ui=I(g,"Map"),L=Ui;function Ri(){this.size=0,this.__data__={hash:new ae,map:new(L||z),string:new ae}}var Bi=Ri;function Fi(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var Vi=Fi;function qi(e,t){var i=e.__data__;return Vi(t)?i[typeof t=="string"?"string":"hash"]:i.map}var O=qi;function Gi(e){var t=O(this,e).delete(e);return this.size-=t?1:0,t}var Yi=Gi;function Qi(e){return O(this,e).get(e)}var Hi=Qi;function Ki(e){return O(this,e).has(e)}var Wi=Ki;function Zi(e,t){var i=O(this,e),r=i.size;return i.set(e,t),this.size+=i.size==r?0:1,this}var Xi=Zi;function C(e){var t=-1,i=e==null?0:e.length;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[1])}}C.prototype.clear=Bi;C.prototype.delete=Yi;C.prototype.get=Hi;C.prototype.has=Wi;C.prototype.set=Xi;var ve=C;function Ji(){this.__data__=new z,this.size=0}var er=Ji;function tr(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i}var ir=tr;function rr(e){return this.__data__.get(e)}var nr=rr;function or(e){return this.__data__.has(e)}var ar=or,lr=200;function sr(e,t){var i=this.__data__;if(i instanceof z){var r=i.__data__;if(!L||r.length<lr-1)return r.push([e,t]),this.size=++i.size,this;i=this.__data__=new ve(r)}return i.set(e,t),this.size=i.size,this}var ur=sr;function D(e){var t=this.__data__=new z(e);this.size=t.size}D.prototype.clear=er;D.prototype.delete=ir;D.prototype.get=nr;D.prototype.has=ar;D.prototype.set=ur;var dr=Object.prototype,Yr=dr.propertyIsEnumerable,cr=I(g,"DataView"),Q=cr,pr=I(g,"Promise"),H=pr,gr=I(g,"Set"),K=gr,le="[object Map]",mr="[object Object]",se="[object Promise]",ue="[object Set]",de="[object WeakMap]",ce="[object DataView]",br=f(Q),fr=f(L),yr=f(H),hr=f(K),vr=f(Y),w=j;(Q&&w(new Q(new ArrayBuffer(1)))!=ce||L&&w(new L)!=le||H&&w(H.resolve())!=se||K&&w(new K)!=ue||Y&&w(new Y)!=de)&&(w=function(e){var t=j(e),i=t==mr?e.constructor:void 0,r=i?f(i):"";if(r)switch(r){case br:return ce;case fr:return le;case yr:return se;case hr:return ue;case vr:return de}return t});var Qr=g.Uint8Array,wr="__lodash_hash_undefined__";function kr(e){return this.__data__.set(e,wr),this}var Ir=kr;function xr(e){return this.__data__.has(e)}var Ar=xr;function W(e){var t=-1,i=e==null?0:e.length;for(this.__data__=new ve;++t<i;)this.add(e[t])}W.prototype.add=W.prototype.push=Ir;W.prototype.has=Ar;var pe=k?k.prototype:void 0,Hr=pe?pe.valueOf:void 0,Cr=Object.prototype,Kr=Cr.hasOwnProperty,Sr=Object.prototype,Wr=Sr.hasOwnProperty,Zr=new RegExp(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,"i"),Xr=new RegExp(/[A-Fa-f0-9]{1}/,"g"),Jr=new RegExp(/[A-Fa-f0-9]{2}/,"g");var Er="ly.img.ai";function we(e){return`${Er}.${e}`}var G="@imgly/plugin-ai-generation",en=`
|
|
2
2
|
<svg>
|
|
3
3
|
<symbol
|
|
4
4
|
fill="none"
|
|
@@ -59,7 +59,7 @@ var Le=typeof global=="object"&&global&&global.Object===Object&&global,ge=Le,$e=
|
|
|
59
59
|
|
|
60
60
|
</symbol>
|
|
61
61
|
</svg>
|
|
62
|
-
`;var ke={openapi:"3.0.0",info:{title:"Elevenlabs API",version:"1.0.0",description:"Elevenlabs API"},components:{schemas:{ElevenlabsInput:{title:"TextToSpeechInput",type:"object",properties:{prompt:{title:"Prompt",type:"string","x-imgly-builder":{component:"TextArea"}},voice_id:{title:"Voice",type:"string",description:"The voice ID to use for the speech synthesis.",default:"JBFqnCBsd6RMkjVDRZzb"},speed:{title:"Speed",type:"number",description:"The speed of the speech synthesis.",default:1,"x-imgly-step":.05,minimum:.7,maximum:1.2}},"x-elevenlabs-order-properties":["prompt","style","image_size"],required:["prompt","voice_id"]}}}};var Ie={version:"2.0.0",id:"ly.img.voices.eleventlabs",assets:[{id:"JBFqnCBsd6RMkjVDRZzb",label:{en:"George"},tags:{en:["British Accent","warm","middle aged","male","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/JBFqnCBsd6RMkjVDRZzb/e6206d1a-0721-4787-aafb-06a6e705cac5.mp3",thumbUri:"{{base_url}}george.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.42"}},{id:"FGY2WhTYpPnrIDTdsKH5",label:{en:"Laura"},tags:{en:["American Accent","upbeat","young","female","social media"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/FGY2WhTYpPnrIDTdsKH5/67341759-ad08-41a5-be6e-de12fe448618.mp3",thumbUri:"{{base_url}}laura.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.04"}},{id:"IKne3meq5aSn9XLyUdCD",label:{en:"Charlie"},tags:{en:["Australian Accent","natural","middle aged","male","conversational"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/IKne3meq5aSn9XLyUdCD/102de6f2-22ed-43e0-a1f1-111fa75c5481.mp3",thumbUri:"{{base_url}}charlie.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.53"}},{id:"9BWtsMINqrJLrRacOk9x",label:{en:"Aria"},tags:{en:["American Accent","expressive","middle-aged","female","social media"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/9BWtsMINqrJLrRacOk9x/405766b8-1f4e-4d3c-aba1-6f25333823ec.mp3",thumbUri:"{{base_url}}aria.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.71"}},{id:"EXAVITQu4vr4xnSDxMaL",label:{en:"Sarah"},tags:{en:["american Accent","soft","young","female","news"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/EXAVITQu4vr4xnSDxMaL/01a3e33c-6e99-4ee7-8543-ff2216a32186.mp3",thumbUri:"{{base_url}}sarah2.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.53"}},{id:"SAz9YHcvj6GT2YYXdXww",label:{en:"River"},tags:{en:["American Accent","confident","middle-aged","non-binary","social media"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/SAz9YHcvj6GT2YYXdXww/e6c95f0b-2227-491a-b3d7-2249240decb7.mp3",thumbUri:"{{base_url}}river.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.53"}},{id:"XrExE9yKIg1WjnnlVkGX",label:{en:"Matilda"},tags:{en:["American Accent","friendly","middle-aged","female","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/XrExE9yKIg1WjnnlVkGX/b930e18d-6b4d-466e-bab2-0ae97c6d8535.mp3",thumbUri:"{{base_url}}matilda.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.64"}},{id:"N2lVS1w4EtoT3dr4eOWO",label:{en:"Callum"},tags:{en:["Transatlantic Accent","intense","middle-aged","male","characters"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/N2lVS1w4EtoT3dr4eOWO/ac833bd8-ffda-4938-9ebc-b0f99ca25481.mp3",thumbUri:"{{base_url}}callum.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"4.18"}},{id:"TX3LPaxmHKxFdv7VOQHJ",label:{en:"Liam"},tags:{en:["American Accent","articulate","young","male","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/TX3LPaxmHKxFdv7VOQHJ/63148076-6363-42db-aea8-31424308b92c.mp3",thumbUri:"{{base_url}}liam.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"4.13"}},{id:"XB0fDUnXU5powFXDhCwa",label:{en:"Charlotte"},tags:{en:["Swedish Accent","seductive","young","female","characters"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/XB0fDUnXU5powFXDhCwa/942356dc-f10d-4d89-bda5-4f8505ee038b.mp3",thumbUri:"{{base_url}}charlotte.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"5.25"}},{id:"CwhRBWXzGAHq8TQ4Fs17",label:{en:"Roger"},tags:{en:["American Accent","confident","middle-aged","male","social media"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/CwhRBWXzGAHq8TQ4Fs17/58ee3ff5-f6f2-4628-93b8-e38eb31806b0.mp3",thumbUri:"{{base_url}}roger.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.89"}},{id:"nPczCjzI2devNBz1zQrb",label:{en:"Brian"},tags:{en:["American Accent","deep","middle-aged","male","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/nPczCjzI2devNBz1zQrb/2dd3e72c-4fd3-42f1-93ea-abc5d4e5aa1d.mp3",thumbUri:"{{base_url}}brian.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"5.46"}},{id:"cgSgspJ2msm6clMCkdW9",label:{en:"Jessica"},tags:{en:["American Accent","expressive","young","female","conversational"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/cgSgspJ2msm6clMCkdW9/56a97bf8-b69b-448f-846c-c3a11683d45a.mp3",thumbUri:"{{base_url}}jessica.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.89"}},{id:"Xb7hH8MSUJpSbSDYk0k2",label:{en:"Alice"},tags:{en:["British Accent","confident","middle-aged","female","news"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/Xb7hH8MSUJpSbSDYk0k2/d10f7534-11f6-41fe-a012-2de1e482d336.mp3",thumbUri:"{{base_url}}alice.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.53"}},{id:"pFZP5JQG7iQjIQuC4Bku",label:{en:"Lily"},tags:{en:["British Accent","warm","middle-aged","female","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/pFZP5JQG7iQjIQuC4Bku/89b68b35-b3dd-4348-a84a-a3c13a3c2b30.mp3",thumbUri:"{{base_url}}lily.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.11"}},{id:"cjVigY5qzO86Huf0OWal",label:{en:"Eric"},tags:{en:["American Accent","friendly","middle-aged","male","conversational"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/cjVigY5qzO86Huf0OWal/d098fda0-6456-4030-b3d8-63aa048c9070.mp3",thumbUri:"{{base_url}}eric.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.32"}},{id:"bIHbv24MWmeRgasZH58o",label:{en:"Will"},tags:{en:["American Accent","friendly","young","male","social media"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/bIHbv24MWmeRgasZH58o/8caf8f3d-ad29-4980-af41-53f20c72d7a4.mp3",thumbUri:"{{base_url}}will.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.74"}},{id:"iP95p4xoKVk53GoZ742B",label:{en:"Chris"},tags:{en:["American Accent","casual","middle-aged","male","conversational"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/iP95p4xoKVk53GoZ742B/3f4bde72-cc48-40dd-829f-57fbf906f4d7.mp3",thumbUri:"{{base_url}}chris.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.29"}},{id:"pqHfZKP75CvOlQylNhV4",label:{en:"Bill"},tags:{en:["American Accent","trustworthy","old","male","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/pqHfZKP75CvOlQylNhV4/d782b3ff-84ba-4029-848c-acf01285524d.mp3",thumbUri:"{{base_url}}bill.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"5.51"}},{id:"onwK4e9ZLuTAKqWW03F9",label:{en:"Daniel"},tags:{en:["British Accent","authoritative","middle-aged","male","news"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/onwK4e9ZLuTAKqWW03F9/7eee0236-1a72-4b86-b303-5dcadc007ba9.mp3",thumbUri:"{{base_url}}daniel.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"5.75"}}]};function xe(e,t,i){return Math.min(Math.max(e,t),i)}async function U(e){return new Promise((t,i)=>{let r=new Audio;r.src=e,r.addEventListener("loadedmetadata",()=>{let n=r.duration;t(n)}),r.addEventListener("error",n=>{i(new Error(`Failed to load audio metadata: ${n.message}`))})})}var jr={width:256,height:256,backgroundColor:"transparent",waveformColor:"black",pixelsPerSecond:100};async function R(e,t={}){let{width:i,height:r,backgroundColor:n,waveformColor:u,pixelsPerSecond:a}={...jr,...t},p=new AudioContext,l=await e.arrayBuffer(),s=await p.decodeAudioData(l),d=s.duration,c=Math.max(i,Math.ceil(d*a)),P=s.sampleRate*d/c,h=document.createElement("canvas");h.width=i,h.height=r;let m=h.getContext("2d");m.fillStyle=n,m.fillRect(0,0,i,r);let Me=s.getChannelData(0),S=r/2,Ee=s.length;m.strokeStyle=u,m.beginPath(),m.moveTo(0,S);for(let b=0;b<i;b++){let M=1,v=-1;for(let F=0;F<P;F++){let X=Math.floor(b*P+F);if(X<Ee){let N=Me[X];N<M&&(M=N),N>v&&(v=N)}}let Te=S-M*S,je=S-v*S;m.lineTo(b,je),m.lineTo(b,Te)}return m.stroke(),new Promise((b,M)=>{h.toBlob(v=>{v?b(v):M(new Error("Canvas to Blob conversion failed"))})})}function B(e,t,i={}){let{ellipsis:r="...",preserveSentences:n=!1,minLength:u=0}=i;if(!e||e.length<=u||e.length<=t)return e;let a=t-r.length;if(n){let s=/[.!?](?:\s|$)/g,d,c=0;for(;(d=s.exec(e))!==null&&!(d.index>a);)c=d.index+1;if(c>0)return e.substring(0,c)+r}let p=e.substring(0,a),l=p.lastIndexOf(" ");return l>0&&(p=p.substring(0,l)),p+r}function Ae(e){return async({cesdk:t})=>Lr(t,e)}function Lr(e,t){let i=t.baseURL??"https://cdn.img.ly/assets/plugins/plugin-ai-audio-generation-web/v1/elevenlabs/",r="ly.img.ai.audio-generation.speech.elevenlabs",n=`${r}.voiceSelection`,u=Dr(e,i),a="elevenlabs/monolingual/v1";return e.setTranslations({en:{[`panel.${a}`]:"AI Voice",[`panel.${n}`]:"Select a Voice",[`panel.${we("elevenlabs")}`]:"AI Voice",[`libraries.${a}.history.label`]:"AI Voice","libraries.elevenlabs/sound-generation.history.label":"Generated Sound"}}),{id:a,name:"Elevenlabs Multilingual V2",kind:"audio",initialize:async()=>{e.ui.addAssetLibraryEntry({id:u,sourceIds:[u],gridColumns:3}),e.ui.registerPanel(n,({builder:l,payload:s})=>{l.Library(`${r}.voiceSelection.library`,{searchable:!0,entries:[u],onSelect:async d=>{let{id:c,label:y}=d;s?.onSelect(c,y??c,d.meta?.thumbUri),e.ui.closePanel(n)}})})},input:{panel:{type:"schema",document:ke,inputReference:"#/components/schemas/ElevenlabsInput",useFlow:"generation-only",renderCustomProperty:{voice_id:l=>{let s=l.experimental.global("voice",{voiceId:"JBFqnCBsd6RMkjVDRZzb",name:"George",thumbnail:`${i}george.webp`});return l.builder.Button(`${r}.openVoiceSelection`,{inputLabel:[`ly.img.plugin-ai-audio-generation-web.${a}.property.voice_id`,"ly.img.plugin-ai-generation-web.property.voice_id",`ly.img.plugin-ai-audio-generation-web.${a}.defaults.property.voice_id`,"ly.img.plugin-ai-generation-web.defaults.property.voice_id"],icon:"@imgly/Appearance",trailingIcon:"@imgly/ChevronRight",labelAlignment:"left",label:s.value.name,onClick:()=>{e.ui.openPanel(n,{payload:{id:s.value.voiceId,onSelect:(d,c,y)=>{s.setValue({voiceId:d,name:c,thumbnail:y})}}})}}),()=>({id:"voice_id",type:"string",value:s.value.voiceId})}},getBlockInput:async l=>({audio:{label:B(l.prompt,25)}})}},output:{abortable:!0,history:t.history??"@imgly/indexedDB",middleware:t.middlewares??t.middleware??[],generate:async(l,{abortSignal:s})=>{let d=await $r(l.prompt,l.voice_id,{speed:parseFloat(l.speed.toFixed(10))},t,s),c=URL.createObjectURL(d),[y,P]=await Promise.all([R(d,{width:512,height:128}),U(c)]),h=URL.createObjectURL(y);return{kind:"audio",url:c,duration:P,thumbnailUrl:h}}},config:t}}async function $r(e,t,i,r,n){let u=`${r.proxyUrl}/v1/text-to-speech/${t}`,a=await fetch(u,{signal:n,method:"POST",headers:{Accept:"audio/mpeg","Content-Type":"application/json",...r.headers??{}},body:JSON.stringify({text:e,model_id:"eleven_multilingual_v2",voice_settings:{speed:xe(i?.speed||1,.7,1.2),stability:i?.stability||.5,similarity_boost:i?.similarityBoost||.5}})});if(!a.ok){let p=await a.text();throw new Error(`API error: ${a.status} - ${p}`)}return a.blob()}function Dr(e,t){let{id:i,assets:r}=Ie;return e.engine.asset.addLocalSource(i),r.map(async n=>{e.engine.asset.addAssetToSource(i,{...n,meta:{...n.meta,thumbUri:n.meta.thumbUri.replace("{{base_url}}",`${t}thumbnails/`)}})}),i}var Ce={openapi:"3.0.0",info:{title:"Elevenlabs Sound Effects API",version:"1.0.0",description:"Elevenlabs Sound Effects API"},components:{schemas:{TextToSoundInput:{title:"TextToSoundInput",type:"object",properties:{text:{title:"Prompt",type:"string","x-imgly-builder":{component:"TextArea"}},duration_seconds:{title:"Duration (sec.)",type:"number",minimum:.6,maximum:22,default:2}},"x-elevenlabs-order-properties":["text"],required:["text"]}}}};function Se(e){return async({cesdk:t})=>Nr(t,e)}function Nr(e,t){let i="elevenlabs/sound-generation";return e.setTranslations({en:{[`panel.${i}`]:"Generate Sound"}}),{id:i,name:"Elevenlabs Sound Generation",kind:"audio",initialize:async()=>{},input:{panel:{type:"schema",document:Ce,inputReference:"#/components/schemas/TextToSoundInput",useFlow:"generation-only",getBlockInput:async n=>({audio:{label:B(n.text,25)}})}},output:{abortable:!0,history:t.history??"@imgly/indexedDB",middleware:t.middlewares??t.middleware??[],generate:async(n,{abortSignal:u})=>{let a=await _r(n.text,n.duration_seconds,t,u),p=URL.createObjectURL(a),[l,s]=await Promise.all([R(a,{width:512,height:128}),U(p)]),d=URL.createObjectURL(l);return{kind:"audio",url:p,duration:s,thumbnailUrl:d}}},config:t}}async function _r(e,t,i,r){let n=`${i.proxyUrl}/v1/sound-generation`,u=await fetch(n,{signal:r,method:"POST",headers:{Accept:"audio/mpeg","Content-Type":"application/json",...i.headers??{}},body:JSON.stringify({text:e,duration_seconds:t})});if(!u.ok){let a=await u.text();throw new Error(`API error: ${u.status} - ${a}`)}return u.blob()}var Or={ElevenMultilingualV2:Ae,ElevenSoundEffects:Se},hn=Or;export{hn as default};
|
|
62
|
+
`;var ke={openapi:"3.0.0",info:{title:"Elevenlabs API",version:"1.0.0",description:"Elevenlabs API"},components:{schemas:{ElevenlabsInput:{title:"TextToSpeechInput",type:"object",properties:{prompt:{title:"Prompt",type:"string","x-imgly-builder":{component:"TextArea"}},voice_id:{title:"Voice",type:"string",description:"The voice ID to use for the speech synthesis.",default:"JBFqnCBsd6RMkjVDRZzb"},speed:{title:"Speed",type:"number",description:"The speed of the speech synthesis.",default:1,"x-imgly-step":.05,minimum:.7,maximum:1.2}},"x-elevenlabs-order-properties":["prompt","style","image_size"],required:["prompt","voice_id"]}}}};var Ie={version:"2.0.0",id:"ly.img.voices.eleventlabs",assets:[{id:"JBFqnCBsd6RMkjVDRZzb",label:{en:"George"},tags:{en:["British Accent","warm","middle aged","male","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/JBFqnCBsd6RMkjVDRZzb/e6206d1a-0721-4787-aafb-06a6e705cac5.mp3",thumbUri:"{{base_url}}george.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.42"}},{id:"FGY2WhTYpPnrIDTdsKH5",label:{en:"Laura"},tags:{en:["American Accent","upbeat","young","female","social media"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/FGY2WhTYpPnrIDTdsKH5/67341759-ad08-41a5-be6e-de12fe448618.mp3",thumbUri:"{{base_url}}laura.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.04"}},{id:"IKne3meq5aSn9XLyUdCD",label:{en:"Charlie"},tags:{en:["Australian Accent","natural","middle aged","male","conversational"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/IKne3meq5aSn9XLyUdCD/102de6f2-22ed-43e0-a1f1-111fa75c5481.mp3",thumbUri:"{{base_url}}charlie.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.53"}},{id:"9BWtsMINqrJLrRacOk9x",label:{en:"Aria"},tags:{en:["American Accent","expressive","middle-aged","female","social media"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/9BWtsMINqrJLrRacOk9x/405766b8-1f4e-4d3c-aba1-6f25333823ec.mp3",thumbUri:"{{base_url}}aria.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.71"}},{id:"EXAVITQu4vr4xnSDxMaL",label:{en:"Sarah"},tags:{en:["american Accent","soft","young","female","news"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/EXAVITQu4vr4xnSDxMaL/01a3e33c-6e99-4ee7-8543-ff2216a32186.mp3",thumbUri:"{{base_url}}sarah2.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.53"}},{id:"SAz9YHcvj6GT2YYXdXww",label:{en:"River"},tags:{en:["American Accent","confident","middle-aged","non-binary","social media"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/SAz9YHcvj6GT2YYXdXww/e6c95f0b-2227-491a-b3d7-2249240decb7.mp3",thumbUri:"{{base_url}}river.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.53"}},{id:"XrExE9yKIg1WjnnlVkGX",label:{en:"Matilda"},tags:{en:["American Accent","friendly","middle-aged","female","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/XrExE9yKIg1WjnnlVkGX/b930e18d-6b4d-466e-bab2-0ae97c6d8535.mp3",thumbUri:"{{base_url}}matilda.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.64"}},{id:"N2lVS1w4EtoT3dr4eOWO",label:{en:"Callum"},tags:{en:["Transatlantic Accent","intense","middle-aged","male","characters"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/N2lVS1w4EtoT3dr4eOWO/ac833bd8-ffda-4938-9ebc-b0f99ca25481.mp3",thumbUri:"{{base_url}}callum.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"4.18"}},{id:"TX3LPaxmHKxFdv7VOQHJ",label:{en:"Liam"},tags:{en:["American Accent","articulate","young","male","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/TX3LPaxmHKxFdv7VOQHJ/63148076-6363-42db-aea8-31424308b92c.mp3",thumbUri:"{{base_url}}liam.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"4.13"}},{id:"XB0fDUnXU5powFXDhCwa",label:{en:"Charlotte"},tags:{en:["Swedish Accent","seductive","young","female","characters"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/XB0fDUnXU5powFXDhCwa/942356dc-f10d-4d89-bda5-4f8505ee038b.mp3",thumbUri:"{{base_url}}charlotte.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"5.25"}},{id:"CwhRBWXzGAHq8TQ4Fs17",label:{en:"Roger"},tags:{en:["American Accent","confident","middle-aged","male","social media"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/CwhRBWXzGAHq8TQ4Fs17/58ee3ff5-f6f2-4628-93b8-e38eb31806b0.mp3",thumbUri:"{{base_url}}roger.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.89"}},{id:"nPczCjzI2devNBz1zQrb",label:{en:"Brian"},tags:{en:["American Accent","deep","middle-aged","male","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/nPczCjzI2devNBz1zQrb/2dd3e72c-4fd3-42f1-93ea-abc5d4e5aa1d.mp3",thumbUri:"{{base_url}}brian.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"5.46"}},{id:"cgSgspJ2msm6clMCkdW9",label:{en:"Jessica"},tags:{en:["American Accent","expressive","young","female","conversational"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/cgSgspJ2msm6clMCkdW9/56a97bf8-b69b-448f-846c-c3a11683d45a.mp3",thumbUri:"{{base_url}}jessica.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.89"}},{id:"Xb7hH8MSUJpSbSDYk0k2",label:{en:"Alice"},tags:{en:["British Accent","confident","middle-aged","female","news"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/Xb7hH8MSUJpSbSDYk0k2/d10f7534-11f6-41fe-a012-2de1e482d336.mp3",thumbUri:"{{base_url}}alice.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.53"}},{id:"pFZP5JQG7iQjIQuC4Bku",label:{en:"Lily"},tags:{en:["British Accent","warm","middle-aged","female","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/pFZP5JQG7iQjIQuC4Bku/89b68b35-b3dd-4348-a84a-a3c13a3c2b30.mp3",thumbUri:"{{base_url}}lily.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.11"}},{id:"cjVigY5qzO86Huf0OWal",label:{en:"Eric"},tags:{en:["American Accent","friendly","middle-aged","male","conversational"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/cjVigY5qzO86Huf0OWal/d098fda0-6456-4030-b3d8-63aa048c9070.mp3",thumbUri:"{{base_url}}eric.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.32"}},{id:"bIHbv24MWmeRgasZH58o",label:{en:"Will"},tags:{en:["American Accent","friendly","young","male","social media"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/bIHbv24MWmeRgasZH58o/8caf8f3d-ad29-4980-af41-53f20c72d7a4.mp3",thumbUri:"{{base_url}}will.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.74"}},{id:"iP95p4xoKVk53GoZ742B",label:{en:"Chris"},tags:{en:["American Accent","casual","middle-aged","male","conversational"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/iP95p4xoKVk53GoZ742B/3f4bde72-cc48-40dd-829f-57fbf906f4d7.mp3",thumbUri:"{{base_url}}chris.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.29"}},{id:"pqHfZKP75CvOlQylNhV4",label:{en:"Bill"},tags:{en:["American Accent","trustworthy","old","male","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/pqHfZKP75CvOlQylNhV4/d782b3ff-84ba-4029-848c-acf01285524d.mp3",thumbUri:"{{base_url}}bill.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"5.51"}},{id:"onwK4e9ZLuTAKqWW03F9",label:{en:"Daniel"},tags:{en:["British Accent","authoritative","middle-aged","male","news"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/onwK4e9ZLuTAKqWW03F9/7eee0236-1a72-4b86-b303-5dcadc007ba9.mp3",thumbUri:"{{base_url}}daniel.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"5.75"}}]};function xe(e,t,i){return Math.min(Math.max(e,t),i)}async function U(e){return new Promise((t,i)=>{let r=new Audio;r.src=e,r.addEventListener("loadedmetadata",()=>{let n=r.duration;t(n)}),r.addEventListener("error",n=>{i(new Error(`Failed to load audio metadata: ${n.message}`))})})}var $r={width:256,height:256,backgroundColor:"transparent",waveformColor:"black",pixelsPerSecond:100};async function R(e,t={}){let{width:i,height:r,backgroundColor:n,waveformColor:u,pixelsPerSecond:a}={...$r,...t},p=new AudioContext,l=await e.arrayBuffer(),s=await p.decodeAudioData(l),d=s.duration,c=Math.max(i,Math.ceil(d*a)),P=s.sampleRate*d/c,h=document.createElement("canvas");h.width=i,h.height=r;let m=h.getContext("2d");m.fillStyle=n,m.fillRect(0,0,i,r);let Ee=s.getChannelData(0),S=r/2,Me=s.length;m.strokeStyle=u,m.beginPath(),m.moveTo(0,S);for(let b=0;b<i;b++){let E=1,v=-1;for(let F=0;F<P;F++){let X=Math.floor(b*P+F);if(X<Me){let N=Ee[X];N<E&&(E=N),N>v&&(v=N)}}let Te=S-E*S,$e=S-v*S;m.lineTo(b,$e),m.lineTo(b,Te)}return m.stroke(),new Promise((b,E)=>{h.toBlob(v=>{v?b(v):E(new Error("Canvas to Blob conversion failed"))})})}function B(e,t,i={}){let{ellipsis:r="...",preserveSentences:n=!1,minLength:u=0}=i;if(!e||e.length<=u||e.length<=t)return e;let a=t-r.length;if(n){let s=/[.!?](?:\s|$)/g,d,c=0;for(;(d=s.exec(e))!==null&&!(d.index>a);)c=d.index+1;if(c>0)return e.substring(0,c)+r}let p=e.substring(0,a),l=p.lastIndexOf(" ");return l>0&&(p=p.substring(0,l)),p+r}function Ae(e){return async({cesdk:t})=>Lr(t,e)}function Lr(e,t){let i=t.baseURL??"https://cdn.img.ly/assets/plugins/plugin-ai-audio-generation-web/v1/elevenlabs/",r="ly.img.ai.audio-generation.speech.elevenlabs",n=`${r}.voiceSelection`,u=Dr(e,i),a="elevenlabs/monolingual/v1";return e.setTranslations({en:{[`panel.${a}`]:"AI Voice",[`panel.${n}`]:"Select a Voice",[`panel.${we("elevenlabs")}`]:"AI Voice",[`libraries.${a}.history.label`]:"AI Voice","libraries.elevenlabs/sound-generation.history.label":"Generated Sound"}}),{id:a,name:"Elevenlabs Multilingual V2",kind:"audio",initialize:async()=>{e.ui.addAssetLibraryEntry({id:u,sourceIds:[u],gridColumns:3}),e.ui.registerPanel(n,({builder:l,payload:s})=>{l.Library(`${r}.voiceSelection.library`,{searchable:!0,entries:[u],onSelect:async d=>{let{id:c,label:y}=d;s?.onSelect(c,y??c,d.meta?.thumbUri),e.ui.closePanel(n)}})})},input:{panel:{type:"schema",document:ke,inputReference:"#/components/schemas/ElevenlabsInput",useFlow:"generation-only",renderCustomProperty:{voice_id:l=>{let s=l.experimental.global("voice",{voiceId:"JBFqnCBsd6RMkjVDRZzb",name:"George",thumbnail:`${i}george.webp`});return l.builder.Button(`${r}.openVoiceSelection`,{inputLabel:[`ly.img.plugin-ai-audio-generation-web.${a}.property.voice_id`,"ly.img.plugin-ai-generation-web.property.voice_id",`ly.img.plugin-ai-audio-generation-web.${a}.defaults.property.voice_id`,"ly.img.plugin-ai-generation-web.defaults.property.voice_id"],icon:"@imgly/Appearance",trailingIcon:"@imgly/ChevronRight",labelAlignment:"left",label:s.value.name,onClick:()=>{e.ui.openPanel(n,{payload:{id:s.value.voiceId,onSelect:(d,c,y)=>{s.setValue({voiceId:d,name:c,thumbnail:y})}}})}}),()=>({id:"voice_id",type:"string",value:s.value.voiceId})}},getBlockInput:async l=>({audio:{label:B(l.prompt,25)}})}},output:{abortable:!0,history:t.history??"@imgly/indexedDB",middleware:t.middlewares??t.middleware??[],generate:async(l,{abortSignal:s})=>{let d=await jr(l.prompt,l.voice_id,{speed:parseFloat(l.speed.toFixed(10))},t,s),c=URL.createObjectURL(d),[y,P]=await Promise.all([R(d,{width:512,height:128}),U(c)]),h=URL.createObjectURL(y);return{kind:"audio",url:c,duration:P,thumbnailUrl:h}}},config:t}}async function jr(e,t,i,r,n){let u=`${r.proxyUrl}/v1/text-to-speech/${t}`,a=await fetch(u,{signal:n,method:"POST",headers:{Accept:"audio/mpeg","Content-Type":"application/json",...r.headers??{}},body:JSON.stringify({text:e,model_id:"eleven_multilingual_v2",voice_settings:{speed:xe(i?.speed||1,.7,1.2),stability:i?.stability||.5,similarity_boost:i?.similarityBoost||.5}})});if(!a.ok){let p=await a.text();throw new Error(`API error: ${a.status} - ${p}`)}return a.blob()}function Dr(e,t){let{id:i,assets:r}=Ie;return e.engine.asset.addLocalSource(i),r.map(async n=>{e.engine.asset.addAssetToSource(i,{...n,meta:{...n.meta,thumbUri:n.meta.thumbUri.replace("{{base_url}}",`${t}thumbnails/`)}})}),i}var Ce={openapi:"3.0.0",info:{title:"Elevenlabs Sound Effects API",version:"1.0.0",description:"Elevenlabs Sound Effects API"},components:{schemas:{TextToSoundInput:{title:"TextToSoundInput",type:"object",properties:{text:{title:"Prompt",type:"string","x-imgly-builder":{component:"TextArea"}},duration_seconds:{title:"Duration (sec.)",type:"number",minimum:.6,maximum:22,default:2}},"x-elevenlabs-order-properties":["text"],required:["text"]}}}};function Se(e){return async({cesdk:t})=>Nr(t,e)}function Nr(e,t){let i="elevenlabs/sound-generation";return e.setTranslations({en:{[`panel.${i}`]:"Generate Sound"}}),{id:i,name:"Elevenlabs Sound Generation",kind:"audio",initialize:async()=>{},input:{panel:{type:"schema",document:Ce,inputReference:"#/components/schemas/TextToSoundInput",useFlow:"generation-only",getBlockInput:async n=>({audio:{label:B(n.text,25)}})}},output:{abortable:!0,history:t.history??"@imgly/indexedDB",middleware:t.middlewares??t.middleware??[],generate:async(n,{abortSignal:u})=>{let a=await _r(n.text,n.duration_seconds,t,u),p=URL.createObjectURL(a),[l,s]=await Promise.all([R(a,{width:512,height:128}),U(p)]),d=URL.createObjectURL(l);return{kind:"audio",url:p,duration:s,thumbnailUrl:d}}},config:t}}async function _r(e,t,i,r){let n=`${i.proxyUrl}/v1/sound-generation`,u=await fetch(n,{signal:r,method:"POST",headers:{Accept:"audio/mpeg","Content-Type":"application/json",...i.headers??{}},body:JSON.stringify({text:e,duration_seconds:t})});if(!u.ok){let a=await u.text();throw new Error(`API error: ${u.status} - ${a}`)}return u.blob()}var zr={ElevenMultilingualV2:Ae,ElevenSoundEffects:Se},hn=zr;export{hn as default};
|
|
63
63
|
/*! Bundled license information:
|
|
64
64
|
|
|
65
65
|
@imgly/plugin-ai-generation-web/dist/index.mjs:
|