ElevenLabsTTS
1.0.0
wrapper น้ำหนักเบาสำหรับ API ข้อความถึงการพูดของ Elevenlabs
เพิ่มแพ็คเกจเป็นการพึ่งพาไฟล์ pubspec.yaml ของคุณ
จำเป็นต้องมีแพ็คเกจเสียง ฉันแนะนำผู้เล่นเสียงหรือ Just_audio
เริ่มต้นสิบเอ็ดคน:
Future < void > main () async {
WidgetsFlutterBinding . ensureInitialized ();
// Initialize ElevenLabs
await ElevenLabs . init (apiKey : 'your-api-key' );
runApp ( const MyApp ());
} File file = await ElevenLabs .instance. create (
// Required
// Your Input
text : text,
// Optional
// The Voice Id for the Voice.
// See: https://api.elevenlabs.io/v1/voices
voiceId : "ErXwobaYiN019PkySvjV" ,
// Optional
// Creates a cached audio file which can then be called by name.
fileName : "Hello World" ,
// Optional
// Higher stability ensures consistency but may result in monotony, therefore
// for longer text, it is recommended to decrease stability.
stability : 1.0 ,
// Optional
// Boosting voice clarity and target speaker similarity is achieved by high
// enhancement; however, very high values can produce artifacts, so it's
// essential to find the optimal setting.
similarityBoost : 1.0 ,
); final voices = await ElevenLabs .instance. listVoices ();
for ( var i in voices) {
print (
'Voice Name: ${ i . name }, Voice ID: ${ i . voiceId }, Category: ${ i . category }' );
} final voices = await ElevenLabs .instance. listHistory ();
for ( var i in voices) {
print (
'Item Id: ${ i . historyItemId }, Voice ID: ${ i . voiceId }, Voice Name: ${ i . voiceName }, Text: ${ i . text },' );
} final file = await ElevenLabs .instance. createHistoryAudioId (
// Required
// History Item Id
itemId : "your-history-item-id" ,
// Optional
// Creates a cached audio file which can then be called by name
fileName : "your-file-name" ,
);ดูตัวอย่างสำหรับรายละเอียดเพิ่มเติม
ข้อสังเกต: แพ็คเกจนี้ถูกสร้างขึ้นเพื่อใช้ในการใช้งานภายใน บริษัท เนื่องจากการพัฒนาดังกล่าวเป็นสิ่งแรกและสำคัญที่สุดที่สอดคล้องกับข้อกำหนดภายใน