Audio control HAL הוצג ב-Android 9 כדי לתמוך בתרחישי שימוש באודיו שרלוונטיים לכלי רכב. החל מגרסה Android 14, HAL של בקרת האודיו תומך באפשרויות הבאות:
- הדרגה ואיזון
- בקשה של HAL להתמקד באודיו
- השתקה והשהיה של המכשיר
- שינויים בעוצמת הקול של מכשיר האודיו
- שינויים בהגדרות של יציאת האודיו
באיור 1 מוצגת סקירה כללית ברמה גבוהה של הארכיטקטורה של שירות האודיו ברכב, שבה שירות האודיו ברכב מתקשר עם HAL של בקרת האודיו.
איור 1. הגדרת אודיו בכמה תחומים.
איזון והשהיה של אודיו
גרסה 1 של HAL לבקרת אודיו ב-HIDL הוצגה ב-Android 9 כדי לתמוך בהבהרה ובאיזון של אודיו בתרחישי שימוש ברכב. המנגנון הזה מאפשר לאפליקציות מערכת להגדיר את איזון האודיו ולהשתמש ב-API של CarAudioManager
כדי לבצע מעברים חלקים בין קטעים:
class CarAudioManager {
/**
* Adjust the relative volume in the front vs back of the vehicle cabin.
*
* @param value in the range -1.0 to 1.0 for fully toward the back through
* fully toward the front. 0.0 means evenly balanced.
*/
@SystemApi
@RequiresPermission(Car.PERMISSION_CAR_CONTROL_AUDIO_VOLUME)
public void setFadeTowardFront(float value);
/**
* Adjust the relative volume on the left vs right side of the vehicle cabin.
*
* @param value in the range -1.0 to 1.0 for fully toward the left through
* fully toward the right. 0.0 means evenly balanced.
*/
@SystemApi
@RequiresPermission(Car.PERMISSION_CAR_CONTROL_AUDIO_VOLUME)
public void setBalanceTowardRight(float value);
}
אחרי שמתבצעת קריאה לממשקי ה-API האלה, מתבצעת קריאה לממשקי ה-HAL הרלוונטיים של בקרת האודיו משירות האודיו ברכב:
interface IAudioControl {
/**
* Control the right/left balance setting of the car speakers.
*/
oneway setBalanceTowardRight(float value);
/**
* Control the fore/aft fade setting of the car speakers.
*/
oneway setFadeTowardFront(float value);
}
ה-API זמין בכל הגרסאות של HAL לבקרת אודיו, כולל הממשק החדש של AIDL HAL.
בקשה להרשאת אודיו מ-HAL
בדומה ל-Android, מערכת AAOS מסתמכת על השתתפות פעילה של אפליקציות במצב התמקדות באודיו כדי לנהל את הפעלת האודיו ברכב. המידע על מוקד ההקשה משמש לניהול של השידורים שרוצים לשלוט בהם מבחינת עוצמת הקול וההשתקה. לכן, כדי להרחיב את ההתמקדות באודיו ולספק שילוב טוב יותר של צלילים ספציפיים לרכב בחוויית השימוש ב-Android, הוספנו את מאפייני האודיו הבאים ב-Android 11:
EMERGENCY
SAFETY
VEHICLE_STATUS
ANNOUNCEMENT
בנוסף לשינוי הזה, הוספנו מנגנון שמאפשר לצלילים שמגיעים מחוץ ל-Android להשתתף בבקשות להתמקד באודיו. לכן, הוספנו את HIDL audio control HAL version 2 כדי לאפשר בקשות להתמקד שמגיעות מחוץ ל-Android:
interface IAudioControl {
/**
* Registers focus listener to be used by HAL for requesting and
* abandoning audio focus.
* @param listener the listener interface
* @return closeHandle A handle to unregister observer.
*/
registerFocusListener(IFocusListener listener)
generates (ICloseHandle closeHandle);
/**
* Notifies HAL of changes in audio focus status for focuses requested
* or abandoned by the HAL.
*
* @param usage The audio usage associated with the focus change
* @param zoneId The identifier for the audio zone that the HAL is
* playing the stream in
* @param focusChange the AudioFocusChange that has occurred
*/
oneway onAudioFocusChange(bitfield<AudioUsage> usage, int32_t zoneId,
bitfield<AudioFocusChange> focusChange);
}
כאשר IFocusListener
מוגדר בתור:
interface IFocusListener {
/**
* Called whenever HAL is requesting focus as it is starting to play
* audio of a given usage in a specified zone.
*
* @param usage The audio usage associated with the focus request
* {@code AttributeUsage}
* @param zoneId The identifier for the audio zone where the HAL is
* requesting focus
* @param focusGain The AudioFocusChange associated with this request.
*/
oneway requestAudioFocus(bitfield<AudioUsage> usage,
int32_t zoneId, bitfield<AudioFocusChange> focusGain);
/**
* Called whenever HAL is abandoning focus as it is finished playing audio
* of a given usage in a specific zone.
*
* @param usage The audio usage for which the HAL is abandoning focus
* {@code AttributeUsage}
* @param zoneId The identifier for the audio zone that the HAL
* abandoning focus
*/
oneway abandonAudioFocus(bitfield<AudioUsage> usage, int32_t zoneId);
}
אפשר להשתמש בממשקי ה-API שלמעלה כדי לבקש מ-HAL להתמקד באודיו ולבטל את ההתמקדות. בתגובה, שירות האודיו ברכב מתייחס לבקשה להתמקד באודיו ומעביר את התוצאות באופן אסינכררוני לשיטה IAudioControl#onAudioFocusChange
.
אפשר להשתמש ב-API הזה גם כדי לעקוב אחרי שינויים בבקשה להתמקד באודיו שמגיעה מ-HAL של בקרת האודיו. באופן כללי, כל בקשה קבועה לקבלת הבעלות על האודיו מה-HAL נחשבת פעילה. המשמעות של בקשה כזו שונה מבקשה לקבלת הבעלות על האודיו מ-Android, שבה רק הפעלה פעילה של טראק אודיו תואם נחשבת כבקשה פעילה.
העברה של HIDL ל-HAL לבקרת אודיו של AIDL
עם ההשקה של AIDL וההעברה הנדרשת ב-Android 12 (מידע נוסף זמין במאמר AIDL ל-HALs), ה-HAL של בקרת האודיו הועבר ל-AIDL. בממשקי ה-API הקיימים של HIDL לניהול אודיו בגרסה 2, ההעברה חייבה עדכונים קלים לשיטות הקיימות:
interface IAudioControl {
/**
* Notifies HAL of changes in audio focus status for focuses requested
* or abandoned by the HAL.
*
* @param usage The audio usage associated with the focus change
* {@code AttributeUsage}. See {@code audioUsage} in
* audio_policy_configuration.xsd for the list of allowed values.
* @param zoneId The identifier for the audio zone that the HAL is
* playing the stream in
* @param focusChange the AudioFocusChange that has occurred.
*/
oneway void onAudioFocusChange(in String usage, in int zoneId,
in AudioFocusChange focusChange);
/**
* Registers focus listener to be used by HAL for requesting and
* abandoning audio focus.
* @param listener the listener interface.
*/
oneway void registerFocusListener(in IFocusListener listener);
/**
* Control the right/left balance setting of the car speakers.
*/
oneway void setBalanceTowardRight(in float value);
/**
* Control the fore/aft fade setting of the car speakers.
*/
oneway void setFadeTowardFront(in float value);
}
וגם את IFocusListener
התואם:
interface IFocusListener {
/**
* Called whenever HAL is abandoning focus as it is finished playing audio
* of a given usage in a specific zone.
*
* @param usage The audio usage for which the HAL is abandoning focus
* {@code AttributeUsage}. See {@code audioUsage} in
* audio_policy_configuration.xsd for the list of allowed values.
* @param zoneId The identifier for the audio zone that the HAL
* abandoning focus
*/
oneway void abandonAudioFocus(in String usage, in int zoneId);
/**
* Called whenever HAL is requesting focus as it is starting to play audio
* of a given usage in a specified zone.
*
* @param usage The audio usage associated with the focus request
* {@code AttributeUsage}. See {@code audioUsage} in
* audio_policy_configuration.xsd for the list of allowed values.
* @param zoneId The identifier for the audio zone where the HAL is
* requesting focus
* @param focusGain The AudioFocusChange associated with this request.
*/
oneway void requestAudioFocus(in String usage, in int zoneId,
in AudioFocusChange focusGain);
}
השתקה של קבוצת קול
ב-Android 12 הוספנו את האפשרות להשתיק קבוצות של עוצמות קול, כדי לאפשר שליטה מקיפה יותר בהשתקה במהלך האינטראקציות של המשתמש עם אודיו. כך ה-HAL של בקרת האודיו יכול לקבל אירועי השתקה שנלכדו על ידי שירות האודיו ברכב.
כדי להפעיל את התכונה, יצרני ציוד מקורי צריכים להגדיר את ההגדרה audioUseCarVolumeGroupMuting
ל-true
בשירות הרכב config.xml
:
<!-- Configuration to enable muting of individual volume groups.
If this is set to false, muting of individual volume groups is disabled,
instead muting will toggle master mute. If this is set to true, car volume
group muting is enabled and each individual volume group can be muted separately. -->
<bool name="audioUseCarVolumeGroupMuting">true</bool>
לפני Android 13, היה צריך לשכתב את התצורה באמצעות שכבת-על של משאבים בסביבת זמן ריצה עבור packages/services/Car/service/res/values/config.xml
(מידע נוסף זמין במאמר התאמה אישית של ה-build באמצעות שכבות-על של משאבים). החל מגרסה Android 13, אפשר להשתמש בשכבות-על של משאבים בסביבת זמן ריצה כדי לשנות ערך תצורה. מידע נוסף זמין במאמר שינוי הערך של משאבי האפליקציה במהלך זמן הריצה.
אפליקציות מערכת יכולות לקבוע אם התכונה מופעלת באמצעות API CarAudioManager#isAudioFeatureEnabled
. הפרמטר המועבר צריך להיות הקבוע CarAudioManager.AUDIO_FEATURE_VOLUME_GROUP_MUTING
. השיטה מחזירה את הערך true
אם התכונה מופעלת במכשיר, ואת הערך false
אחרת.
בנוסף להפעלת התכונה audioUseCarVolumeGroupMuting
, צריך להטמיע את מנגנון ההשתקה של קבוצות עוצמת קול ב-HAL של בקרת האודיו ב-AIDL:
interface IAudioControl {
/**
* Notifies HAL of changes in output devices that the HAL should apply
* muting to.
*
* This will be called in response to changes in audio mute state for each
* volume group and will include a {@link MutingInfo} object per audio
* zone that experienced a mute state event.
*
* @param mutingInfos an array of {@link MutingInfo} objects for the audio
* zones where audio mute state has changed.
*/
oneway void onDevicesToMuteChange(in MutingInfo[] mutingInfos);
}
שם פרטי ההשתקה מכילים את פרטי ההשתקה הרלוונטיים למערכת האודיו:
parcelable MutingInfo {
/**
* ID of the associated audio zone
*/
int zoneId;
/**
* List of addresses for audio output devices that should be muted.
*/
String[] deviceAddressesToMute;
/**
* List of addresses for audio output devices that were previously be
* muted and should now be unmuted.
*/
String[] deviceAddressesToUnmute;
}
ל-AAOS יש שני מנגנונים שונים להשתקת קול, על סמך:
אירועים מרכזיים באמצעות הקוד KEYCODE_VOLUME_MUTE.
קריאות ישירות לשירות האודיו ברכב באמצעות ה-API להשתקת מנהל האודיו ברכב,
CarAudioManager#setVolumeGroupMute
.
כשהמנגנונים מופעלים, שניהם מפעילים את השתקת השיחה ב-HAL של בקרת האודיו.
הנמכה של עוצמת השמע ברכב
ב-Android 12 הוספנו את התכונה 'השתקה זמנית של אודיו ברכב' כדי לשפר את השליטה בהפעלה בו-זמנית של מספר מקורות אודיו. כך יצרני ציוד מקורי יכולים להטמיע התנהגות דאקינג משלהם על סמך הגדרת האודיו הפיזית ברכב ומצב ההפעלה הנוכחי, כפי שנקבע על ידי שירות האודיו ברכב.
מנגנון ההנמכה מבוסס על השינויים ב-stack של האודיו. בכל פעם שמתבצע שינוי של המיקוד (בקשה להעברת המיקוד או ביטול המיקוד), ה-HAL של בקרת האודיו מקבל הודעה. בדומה לתמיכה בהשתקת קבוצות של עוצמת קול ברכב, אפשר להפעיל את השקטת האודיו ברכב באמצעות הדגל audioUseHalDuckingSignals
בתצורה:
<!-- Configuration to enable IAudioControl#onDevicesToDuckChange API to
inform HAL when to duck. If this is set to true, the API will receive signals
indicating which output devices to duck as well as what usages are currently
holding focus. If set to false, the API will not be called. -->
<bool name="audioUseHalDuckingSignals">true</bool>
כדי להפעיל את התכונה, ה-HAL של בקרת האודיו ב-AIDL צריך להטמיע את הלוגיקה הרלוונטית עם האות שמתקבל משירות האודיו ברכב:
interface IAudioControl {
/**
* Notifies HAL of changes in output devices that the HAL should apply
* ducking to.
*
* This will be called in response to changes in audio focus, and will
* include a {@link DuckingInfo} object per audio zone that experienced
* a change in audo focus.
*
* @param duckingInfos an array of {@link DuckingInfo} objects for the
* audio zones where audio focus has changed.
*/
oneway void onDevicesToDuckChange(in DuckingInfo[] duckingInfos);
}
פרטי מערכת האודיו הרלוונטיים נכללים במידע על ההשתקה של האודיו:
parcelable DuckingInfo {
/**
* ID of the associated audio zone
*/
int zoneId;
/**
* List of addresses for audio output devices that should be ducked.
*/
String[] deviceAddressesToDuck;
/**
* List of addresses for audio output devices that were previously be
* ducked and should now be unducked.
*/
String[] deviceAddressesToUnduck;
/**
* List of usages currently holding focus for this audio zone.
*/
String[] usagesHoldingFocus;
}
בנוסף למידע על הגדרות האודיו ברכב שמכיל את כתובות המכשיר לביטול או להפעלת ההשתקה, המידע על ההשתקה מכיל גם מידע על שימושי מאפייני האודיו שמקבלים את המיקוד. המטרה של הנתונים האלה היא להודיע למערכת האודיו אילו שימושים במאפייני האודיו פעילים.
הצורך בכך נובע מכך שבהגדרות האודיו ברכב אפשר להקצות כמה מאפייני אודיו למכשיר אחד, ובלי המידע הנוסף לא ברור אילו שימושים פעילים.
AIDL audio control HAL 2.0
כדי לעדכן את ממשקי ה-API ולאפשר פונקציונליות חדשה, עדכנו את HAL של בקרת האודיו ב-AIDL לגרסה 2.0 ב-Android 13:
- מיקוד אודיו עם
PlaybackTrackMetadata
- קריאה חוזרת של הגברה של אודיו
מטא-נתוני ההפעלה מוגדרים ב-android.hardware.audio.common
באופן הבא:
parcelable PlaybackTrackMetadata {
AudioUsage usage = INVALID;
AudioContentType contentType = UNKNOWN;
float gain;
AudioChannelLayout channelMask;
AudioDevice sourceDevice;
String[] tags;
}
כל שאר הפונקציונליות של אמצעי הבקרה של אודיו ב-AIDL בגרסה 1.0 נשארה וניתן להשתמש בה. יש חריג לגבי שיטת השינוי של מוקד האודיו, כפי שמתואר בקטע On audio focus change method.
שליטה באודיו באמצעות מטא-נתונים של טראק ההפעלה
כדי לחשוף מידע נוסף למערכת האודיו מתחת ל-HAL, העדכונים חושפים עכשיו את PlaybackTrackMetadata
. באופן ספציפי, הרחבנו את HAL של בקרת האודיו באמצעות שיטה חדשה:
interface IAudioControl {
/**
* Notifies HAL of changes in audio focus status for focuses requested
* or abandoned by the HAL.
*
* The HAL is not required to wait for a callback of AUDIOFOCUS_GAIN
* before playing audio, nor is it required to stop playing audio in the
* event of a AUDIOFOCUS_LOSS callback is received.
*
* @param playbackMetaData The output stream metadata associated with
* the focus request
* @param zoneId The identifier for the audio zone that the HAL is
* playing the stream in
* @param focusChange the AudioFocusChange that has occurred.
*/
oneway void onAudioFocusChangeWithMetaData(
in PlaybackTrackMetadata playbackMetaData, in int zoneId,
in AudioFocusChange focusChange);
}
מתבצע שינוי דומה ומשויך ב-IFocusListener
:
/**
* Called to indicate that the audio output stream associated with
* {@link android.hardware.audio.common.PlaybackTrackMetadata} is
* abandoning focus as playback has stopped.
*
* @param playbackMetaData The output stream metadata associated with
* the focus request
* @param zoneId The identifier for the audio zone that the HAL
* abandoning focus
*/
oneway void abandonAudioFocusWithMetaData(
in PlaybackTrackMetadata playbackMetaData, in int zoneId);
/**
* Called to indicate that the audio output stream associated with
* {@link android.hardware.audio.common.PlaybackTrackMetadata} has taken
* the focus as playback is starting for the corresponding stream.
*
* @param playbackMetaData The output stream metadata associated with
* the focus request
* @param zoneId The identifier for the audio zone that the HAL
* abandoning focus
* @param focusGain The focus type requested.
*/
oneway void requestAudioFocusWithMetaData(
in PlaybackTrackMetadata playbackMetaData, in int zoneId,
in AudioFocusChange focusGain);
}
שינוי שיטת מיקוד האודיו
פעולות המיקוד שמפורטות למעלה פועלות באותו אופן כמו אלה שמתוארות בקטע בקשה לזיהוי מקור אודיו מ-HAL. רק המטא-נתונים של טראק ההפעלה מכילים מידע נוסף, יחד עם שימושים במאפייני האודיו. באופן כללי, אם אין צורך במידע הנוסף שמסופק על ידי המטא-נתונים של טראק ההפעלה, ה-HAL המעודכן של Android Control יכול להמשיך להשתמש בשיטות הקודמות.
אם מפתחי HAL מחליטים לא לתמוך ב-IAudioControl#onAudioFocusChangeWithMetaData
, השיטה צריכה להחזיר תוצאות עם השגיאה UNKNOWN_TRANSACTION
כפי שמתואר בקטע שימוש בשיטות של ממשק בגרסאות.
שירות האודיו קורא קודם ל-onAudioFocusChangeWithMetaData
ואז מנסה שוב עם השיטה onAudioFocusChange
אם מתקבלת שגיאה UNKNOWN_TRANSACTION
.
השבתת אודיו ברכב באמצעות מטא-נתונים של טראק ההפעלה
בגרסה 2.0 של HAL לבקרת אודיו ב-AIDL נוספו המטא-נתונים של טראק ההפעלה למידע על השהיה של אודיו:
parcelable DuckingInfo {
/**
* ID of the associated audio zone
*/
int zoneId;
/**
* List of addresses for audio output devices that should be ducked.
*/
String[] deviceAddressesToDuck;
/**
* List of addresses for audio output devices that were previously be
* ducked and should now be unducked.
*/
String[] deviceAddressesToUnduck;
/**
* List of usages currently holding focus for this audio zone.
*/
String[] usagesHoldingFocus;
/**
* List of output stream metadata associated with the current focus
* holder for this audio zone
*/
@nullable PlaybackTrackMetadata[] playbackMetaDataHoldingFocus;
}
האפשרות usagesHoldingFocus
הוצאה משימוש. מעכשיו, המפתחים צריכים להשתמש ב-playbackMetaDataHoldingFocus
כדי לקבוע את השימוש במאפיין האודיו ומידע נוסף על האודיו. עם זאת, הפרמטר usagesHoldingFocus
עדיין מכיל את המידע הנדרש עד שהאפשרות הזו תוסר באופן רשמי.
קריאה חוזרת של קידום האודיו
כדי לשפר את החשיפה של שינויים באודיו מתחת ל-HAL ל-AAOS ב-Android 13, הוספנו מנגנון שבעזרתו אפשר להעביר שינויים בעוצמת האודיו ממערכת האודיו ברכב לשירות האודיו ברכב. המנגנון חושף שינויים במדד עוצמת הקול של הגברה של אודיו, עם הסיבה המתאימה לשינוי הגברה:
- הגבלות על חשבונות חסומים או מושתק
- הגבלות על מגבלות
- הגבלות על פגיעה באיכות האות
השינויים האלה חושפים את ההגבלות האלה מתחת ל-HAL לשירות האודיו ברכב, ולבסוף לאפליקציית ממשק המשתמש של המערכת כדי להודיע למשתמש. החלק האחרון, החשיפה לממשק משתמש אפשרי של מערכת, הורחב עוד יותר ב-Android 14 כדי לאפשר לאפליקציות של ממשק משתמש מערכת לקבל את המידע הזה בקלות רבה יותר באמצעות מנגנון קריאה חוזרת (callback) של מידע על קבוצת נפח אחסון.
ממשק ה-API ל-HAL של בקרת האודיו רושם את פונקציית ה-call back של הגבר באופן הבא:
interface IAudioControl {
/**
* Registers callback to be used by HAL for reporting unexpected gain(s)
* changed and the reason(s) why.
*
* @param callback The {@link IAudioGainCallback}.
*/
oneway void registerGainCallback(in IAudioGainCallback callback);
}
הערך של IAudioGainCallback
מוגדר כך:
interface IAudioGainCallback {
/**
* Used to indicate that one or more audio device port gains have changed,
* i.e. initiated by HAL, not by CarAudioService.
* This is the counter part of the
* {@link onDevicesToDuckChange}, {@link onDevicesToMuteChange} and,
* {@link setAudioDeviceGainsChanged} APIs.
*
* @param reasons List of reasons that triggered the given gains changed.
* @param gains List of gains affected by the change.
*/
void onAudioDeviceGainsChanged(in Reasons[] reasons,
in AudioGainConfigInfo[] gains);
}
כפי שצוין במסמכי העזרה של ה-API, שירות האודיו ברכב רושם את הקריאה החוזרת (callback) של הגבר ל-HAL של בקרת האודיו. כשמפעילים את ה-API מ-HAL לבקרת אודיו, שירות האודיו ברכב מגיב עם פעולה תואמת (כמו חסימה, הגבלה או הפחתת מדד הגברה) .
ה-HAL קובע מתי יתבצע קריאה ל-API, בעיקר כדי לדווח על שינויים בסטטוס של מדד הרווח. בהתאם לדרישות הרגולטוריות, מערכת האודיו ברכב צריכה לבצע את הפעולה הנדרשת ולהשתמש בקריאה החוזרת כדי לדווח מידע לשירות האודיו ברכב, כדי לאפשר את השימוש של המשתמש. לדוגמה, כדי להציג למשתמש ממשק משתמש.
AIDL audio control HAL 3.0
גרסת ה-HAL של בקרת האודיו ב-Android 14 ב-AIDL עודכנה לגרסה 3.0 כדי לעדכן את ממשקי ה-API ולספק פונקציונליות חזקה יותר של מדד הרווח האודיו. ממשק ה-HAL API לבקרת אודיו מאפשר לשירות האודיו להגדיר ולבטל הגדרה של IModuleChangeCallback
:
interface IAudioControl {
/**
* Sets callback with HAL for notifying changes to hardware module
* (that is: {@link android.hardware.audio.core.IModule}) configurations.
*
* @param callback The {@link IModuleChangeCallback} interface to use
* use when new updates are available for
*/
void setModuleChangeCallback(in IModuleChangeCallback callback);
/**
* Clears module change callback
*/
void clearModuleChangeCallback();
}
השדה setModuleChangeCallback
רשום על ידי שירות האודיו ברכב כשהשירות מתחיל או כשמתבצע שחזור אחרי שגיאה. לדוגמה, התראה על מוות של HAL binder של בקרת אודיו שהתקבלה על ידי שירות האודיו ברכב. הטמעת HAL של בקרת האודיו אמורה להחליף כל קריאה חוזרת (callback) קיימת לשינוי מודול כשקוראים ל-API.
ב-API של clearModuleChangeCallback
, ההטמעה צריכה לנקות את הקריאה החוזרת הקיימת או לא לעשות דבר אם היא לא קיימת. מומלץ להירשם למעקב אחר מוות של קריאה חוזרת (death observer) בזמן הטמעת בקרת האודיו, ואז לנקות את הקריאה החוזרת אם האירוע on binder death מופעל.
IModuleChangeCallback
מוגדר כך:
oneway interface IModuleChangeCallback {
/**
* Used to indicate that one or more {@link AudioPort} configs have
* changed. Implementations MUST return at least one AudioPort.
*
* @param audioPorts list of {@link AudioPort} that are updated
*/
void onAudioPortsChanged(in AudioPort[] audioPorts);
}
כשהקריאה החוזרת (callback) לשינוי המודול רשומה על ידי שירות האודיו ברכב, היא מוכנה לקבל שינויים ביציאות האודיו דרך ה-API של onAudioPortChanged
. אפשר להשתמש ב-API כדי לאתחל את הגברה של עוצמת הקול במערכת האודיו ברגע שהקריאה החוזרת (callback) רשומה. לשינויים אחרים של הגברה דינמית, אפשר להפעיל את ה-API בכל שלב. השינויים המתאימים יחולו ושירות האודיו ברכב יתעדכן בהתאם.