كيفية الانتقال من ElevenLabs إلى MorVoice في 5 دقائق
إن الخوف من الارتباط بمورد معين يبقي العديد من الفرق الهندسية عالقة مع مقدمي الخدمة القدامى. تبدو تكاليف التبديل غير قابلة للتجاوز.
لقد بنينا MorVoice بفلسفة أساسية: **كودك ملك لك.** لهذا السبب أنشأنا طبقة توافق MorVoice.
منهجية 'Shim'
عادةً ما تتضمن هجرة واجهة برمجة التطبيقات إعادة كتابة العملاء ورسم خرائط لأكواد الخطأ الجديدة.
مع MorVoice Compat، يتطلب الأمر تغيير **سطر واحد من الكود**.
الخطوة 1: تغيير الكود (Python)
# ==========================================
# EXISTING ELEVENLABS CODE
# ==========================================
# from elevenlabs import generate, set_api_key
# set_api_key("eleven_key_...")
# audio = generate(
# text="Hello there!",
# voice="Bella",
# model="eleven_monolingual_v1"
# )
# ==========================================
# NEW MORVOICE CODE
# ==========================================
from morvoice.compat import elevenlabs as generate
import os
# Point to MorVoice API key instead
os.environ["MORVOICE_API_KEY"] = "mv_key_..."
# Everything else remains IDENTICAL
audio = generate(
text="Hello there!",
voice="Bella",
# We auto-map 'Bella' to 'mv_bella_neural'
model="eleven_monolingual_v1"
# We auto-upgrade this to 'mv-turbo-v2.5'
)الخطوة 2: تغيير الكود (Node.js)
// OLD IMPORTS
// const { ElevenLabsClient } = require("elevenlabs");
// NEW IMPORTS
const { ElevenLabsClient } = require("@morvoice/compat-node");
const client = new ElevenLabsClient({
apiKey: process.env.MORVOICE_API_KEY
});
// No other logic changes needed
const audioStream = await client.generate({
voice: "Adam",
text: "This was surprisingly easy.",
stream: true
});الخطوة 3: التحقق من الاستنساخ
أكبر مصدر للقلق هو فقدان أصواتك المستنسخة. لا يمكنك فقط 'تصدير' نموذج عصبي، ولكن يمكنك تصدير **الصوت المرجعي**.
نحن نقدم أداة `VoiceMigration` في واجهة سطر الأوامر الخاصة بنا:
# Install the CLI tool
pip install morvoice-cli
# Run the migration wizard
morvoice migrate --source elevenlabs --key-source ELEVEN_KEY --key-target MORVOICE_KEY
# Output:
# > Found 14 custom voices
# > Downloading 'Narrator John' samples (5 files)...
# > Uploading to MorVoice Vault...
# > Finetuning MorVoice Diffusion Model...
# > Verifying SSIM (Structural Similarity)... 0.98
# > Migration Complete.جدول رسم خرائط الميزات
| ElevenLabs Usage | MorVoice Equivalent | Behavior |
| :--- | :--- | :--- |
| `stability=0.5` | `style_consistency=0.5` | Exact match |
| `similarity_boost=0.8` | `timbre_focus=0.8` | Exact match |
| `use_speaker_boost=True` | `audio_cleaner=True` | MorVoice is more aggressive on noise removal |
| `<break time="1s"/>` | `[PAUSE=1s]` | Auto-converted |
| `model_id="multilingual_v2"` | `model_id="mv-global-v4"` | MorVoice supports 20 more languages |استراتيجية التراجع
أي تغيير في البنية التحتية يحتاج إلى شبكة أمان. التراجع بسيط مثل سحب بيان الاستيراد.
try:
import morvoice.compat.elevenlabs as tts
print("Using MorVoice")
except ImportError:
import elevenlabs as tts
print("Fallback to Legacy Provider")الأسئلة الشائعة
هل تبدو أصواتي المستنسخة متطابقة تمامًا؟
سوف تبدو مثل *الشخص*، ولكن غالباً ما تكون أكثر نقاءً. نلتقط تفاصيل تنفس أكثر وطنيناً معدنيًا أقل.
ماذا عن الاشتراكات الجارية؟
يمكنك الحفاظ على اشتراكك القديم نشطاً أثناء الاختبار. نظراً لأن MorVoice تعتمد الدفع حسب الاستخدام.
الخلاصة: استعد السيطرة
الارتباط بمورد معين هو خيار. تستغرق الهجرة إلى MorVoice وقتاً أقل من قراءة هذا المقال.
احصل على مفتاح API الخاص بك اليوم وقم بتشغيل نص الهجرة.