בדיקת אודיו של Bluetooth באמולטורים
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
באמולטור Wear OS, תמונות מערכת שפועלות עם Wear OS 4 ואילך כוללות
תמיכה באמולציה של Bluetooth. התמיכה הזו מאפשרת לבדוק תרחישים לדוגמה
שקשורה לאודיו Bluetooth.
התאמה בעזרת אמולציה של טלפון
באמצעות התמיכה ב-Bluetooth של האמולטור אפשר לבצע התאמה עם טלפון האמולטור. שפת תרגום
כדי לעשות זאת, הפעילו את אשף ההגדרה משורת הפקודה:
-append-userspace-opt androidboot.setupwizard_mode=REQUIRED
השמעת אודיו באמצעות אמולציה של המכשיר להצגת אודיו
באמצעות תמיכת Bluetooth של האמולטור ניתן גם להשמיע אודיו באמצעות
אמולציה של מכשיר פלט Bluetooth. כדי לבדוק את שינוי פלט האודיו
אמולטור, התחברות למכשיר אמולטור של פלט Bluetooth באמצעות קוד פתוח
Bumble project
מכינים את הסביבה
כדי להכין את מכונת הפיתוח לשימוש ב-Bumble, מבצעים את הפעולות הבאות
שלבים:
מאחזרים את קוד המקור של Bumble:
git clone https://github.com/google/bumble
עוברים לספרייה bumble
, ואז יוצרים ומתקינים
מודולים של Bumble:
cd bumble && python3 -m pip install "."
הפעלת רמקול Bluetooth אמולציה
כדי להפעיל את הרמקול האמולציה, מבצעים את השלבים הבאים:
פותחים גרסה של האמולטור שתומכת ב-Wear OS 4 ואילך.
הערה: אם משתמשים בגרסת אמולטור
מגרסה 33.1.10 ואילך, הפעילו את האמולטור משורת הפקודה באמצעות הפקודה
-packet-streamer-endpoint default
.
כדי למצוא את הרמקול האמולציה ולהתחבר אליו, מריצים את הפקודה הבאה
הפקודה בספרייה bumble
:
python3 examples/run_a2dp_sink.py examples/a2dp_sink1.json \
android-netsim stdout | ffplay -i
פלט האודיו מופעל דרך הרמקולים של המחשב.
אפשר גם להפנות את הפלט לקובץ באופן אוטומטי:
python3 examples/run_a2dp_sink.py examples/a2dp_sink1.json \
android-netsim output.sbc
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. Java ו-OpenJDK הם סימנים מסחריים או סימנים מסחריים רשומים של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-27 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-27 (שעון UTC)."],[],[],null,["# Test Bluetooth audio on emulators\n\nOn the Wear OS emulator, system images that run Wear OS 4 or higher include\nsupport for emulated Bluetooth. This support lets you test several use cases\nrelated to Bluetooth audio.\n\nPair with an emulated phone\n---------------------------\n\nUsing the emulator's Bluetooth support, you can pair with an emulated phone. To\ndo so, enable the setup wizard from the command line: \n\n -append-userspace-opt androidboot.setupwizard_mode=REQUIRED\n\nPlay audio through an emulated output device\n--------------------------------------------\n\nUsing the emulator's Bluetooth support, you can also play audio through an\nemulated Bluetooth output device. To test audio output switching in the\nemulator, connect to an emulated Bluetooth output device using the open source\n[Bumble project](https://www.github.com/google/bumble).\n\n### Prepare your environment\n\nTo prepare your development machine for using Bumble, complete the following\nsteps:\n\n1. Fetch the Bumble source code:\n\n ```\n git clone https://github.com/google/bumble\n ```\n2. Navigate to the `bumble` directory, then build and install\n Bumble modules:\n\n ```\n cd bumble && python3 -m pip install \".\"\n ```\n\n### Launch emulated Bluetooth speaker\n\nTo launch the emulated speaker, complete the following steps:\n\n1. Launch a version of the emulator that supports Wear OS 4 or higher.\n\n **Note:** If you're using an emulator version\n lower than 33.1.10, launch the emulator from the command line using the\n `-packet-streamer-endpoint default` parameter.\n2. To discover and connect to the emulated speaker, run the following\n command in the `bumble` directory:\n\n ```\n python3 examples/run_a2dp_sink.py examples/a2dp_sink1.json \\\n android-netsim stdout | ffplay -i\n ```\n\n The audio output is played through your computer's speakers.\n\n You can also redirect output to a file: \n\n ```\n python3 examples/run_a2dp_sink.py examples/a2dp_sink1.json \\\n android-netsim output.sbc\n ```"]]