Qt for HarmonyOS/qtohosextras doc/Audio Stream Usage Hint Example: Difference between revisions
Add example documentation from qdoc output (QTFOROH-2307) |
Fix example page conversion (QTFOROH-2307) |
||
| Line 1: | Line 1: | ||
< [[Qt_for_HarmonyOS/qtohosextras_doc|Qt for HarmonyOS / qtohosextras doc]] | < [[Qt_for_HarmonyOS/qtohosextras_doc|Qt for HarmonyOS / qtohosextras doc]] | ||
= Audio Stream Usage Hint Example = | |||
Demonstrates tagging Qt sound playback with an OHOS audio stream usage hint. | |||
A combo box lists all [[Qt_for_HarmonyOS/qtohosextras_doc/Multimedia_Namespace#AudioStreamUsageHint-enum|QtOhosExtras::Multimedia::AudioStreamUsageHint]] values. Two buttons play a bundled sound either through QSoundEffect or through QSound; before playback the selected hint is applied with Multimedia::setAudioStreamUsageHintProperty(). The hint influences how the system routes the audio and which volume policy applies. | |||
'''Note: '''The target object must be a QSoundEffect or QSound instance; other object types are rejected with an error log. The example sets the hint before starting playback. | |||
* [[Qt_for_HarmonyOS/qtohosextras_doc/Audio_Stream_Usage_Hint_Example|multimedia/audiostreamusagehint/resources.qrc]] | |||
[[Category:Qt for HarmonyOS]] | [[Category:Qt for HarmonyOS]] | ||
Revision as of 09:20, 16 September 2026
< Qt for HarmonyOS / qtohosextras doc
Audio Stream Usage Hint Example
Demonstrates tagging Qt sound playback with an OHOS audio stream usage hint.
A combo box lists all QtOhosExtras::Multimedia::AudioStreamUsageHint values. Two buttons play a bundled sound either through QSoundEffect or through QSound; before playback the selected hint is applied with Multimedia::setAudioStreamUsageHintProperty(). The hint influences how the system routes the audio and which volume policy applies.
Note: The target object must be a QSoundEffect or QSound instance; other object types are rejected with an error log. The example sets the hint before starting playback.