1# Multimedia Subsystem Changelog 2 3 4## cl.multimedia.1 Stream Type Enum Declaration in Audio C APIs Changed 5 6For the audio APIs of API version 10 in C, the audio output stream type is changed from **AUDIOSTREAM_TYPE_RERNDERER** to **AUDIOSTREAM_TYPE_RENDERER**. 7 8**Change Impact** 9 10Applications that use the involved APIs may have compatibility issues. 11 12**Key API/Component Changes** 13 14Before change: 15 16```C 17enum OH_AudioStream_Type { 18 /** 19 * The type for audio stream is renderer. 20 */ 21 AUDIOSTREAM_TYPE_RERNDERER = 1, 22 23 /** 24 * The type for audio stream is capturer. 25 */ 26 AUDIOSTREAM_TYPE_CAPTURER = 2 27}; 28``` 29 30After change: 31 32```C 33enum OH_AudioStream_Type { 34 /** 35 * The type for audio stream is renderer. 36 */ 37 AUDIOSTREAM_TYPE_RENDERER = 1, 38 39 /** 40 * The type for audio stream is capturer. 41 */ 42 AUDIOSTREAM_TYPE_CAPTURER = 2 43}; 44``` 45 46**Adaptation Guide** 47 48Change **AUDIOSTREAM_TYPE_RERNDERER** to **AUDIOSTREAM_TYPE_RENDERER** in your code. Example: 49 50Before change: 51 52```C 53OH_AudioStreamBuilder* builder; 54OH_AudioStreamBuilder_Create(&builder, AUDIOSTREAM_TYPE_RERNDERER); 55``` 56 57After change: 58 59```C 60OH_AudioStreamBuilder* builder; 61OH_AudioStreamBuilder_Create(&builder, AUDIOSTREAM_TYPE_RENDERER); 62``` 63 64 65## cl.multimedia.2 OH_AudioStream_Usage Changed 66 67In the **native_audiostream_base.h** file of the audio APIs of API version 10 in C, for the **OH_AudioStream_Usage** enum, the enumerated value **AUDIOSTREAM_USAGE_MEDIA** is deleted, and **AUDIOSTREAM_USAGE_COMMUNICATION** is changed to **AUDIOSTREAM_USAGE_VOICE_COMMUNICATION** and **AUDIOSTREAM_USAGE_VOICE_ASSISTANT**. 68 69**Change Impact** 70 71Applications that use the involved APIs may have compatibility issues. 72 73**Key API/Component Changes** 74 75Before change: 76 77```C 78typedef enum { 79 AUDIOSTREAM_USAGE_UNKNOWN = 0, 80 AUDIOSTREAM_USAGE_MEDIA = 1, 81 AUDIOSTREAM_USAGE_COMMUNICATION = 2, 82} OH_AudioStream_Usage; 83``` 84 85After change: 86 87```C 88typedef enum { 89 /** 90 * Unknown usage. 91 */ 92 AUDIOSTREAM_USAGE_UNKNOWN = 0, 93 /** 94 * Music usage. 95 */ 96 AUDIOSTREAM_USAGE_MUSIC = 1, 97 /** 98 * Voice communication usage. 99 */ 100 AUDIOSTREAM_USAGE_VOICE_COMMUNICATION = 2, 101 /** 102 * Voice assistant usage. 103 */ 104 AUDIOSTREAM_USAGE_VOICE_ASSISTANT = 3, 105 /** 106 * Movie or video usage. 107 */ 108 AUDIOSTREAM_USAGE_MOVIE = 10, 109 110} OH_AudioStream_Usage; 111``` 112 113**Adaptation Guide** 114 115When using **OH_AudioStreamBuilder_SetRendererInfo**, set **OH_AudioStream_Usage** to **AUDIOSTREAM_USAGE_MUSIC** or **AUDIOSTREAM_USAGE_MOVIE**, rather than **AUDIOSTREAM_USAGE_MEDIA**. 116 117Before change: 118 119```C 120OH_AudioStreamBuilder_SetRendererInfo(builder, AUDIOSTREAM_USAGE_MEDIA); 121``` 122 123After change: 124 125```C 126OH_AudioStreamBuilder_SetRendererInfo(builder, AUDIOSTREAM_USAGE_MUSIC); // Music scene 127``` 128 129Or: 130 131```C 132OH_AudioStreamBuilder_SetRendererInfo(builder, AUDIOSTREAM_USAGE_MOVIE); // Video scene 133``` 134 135When using **OH_AudioStreamBuilder_SetRendererInfo**, set **OH_AudioStream_Usage** to **AUDIOSTREAM_USAGE_VOICE_COMMUNICATION** or **AUDIOSTREAM_USAGE_VOICE_ASSISTANT**, rather than **AUDIOSTREAM_USAGE_COMMUNICATION**. 136 137Before change: 138 139```C 140OH_AudioStreamBuilder_SetRendererInfo(builder, AUDIOSTREAM_USAGE_COMMUNICATION); 141``` 142 143After change: 144 145```C 146OH_AudioStreamBuilder_SetRendererInfo(builder, AUDIOSTREAM_USAGE_VOICE_COMMUNICATION); // Communication scene 147``` 148 149Or: 150 151```C 152OH_AudioStreamBuilder_SetRendererInfo(builder, AUDIOSTREAM_USAGE_VOICE_ASSISTANT); // Voice assistant scene 153``` 154 155 156## cl.multimedia.3 AUDIOSTREAM_SAMPLE_F32LE Deleted for OH_AudioStream_SampleFormat 157 158In the **native_audiostream_base.h** file of the audio APIs of API version 10 in C, the enumerated value **AUDIOSTREAM_SAMPLE_F32LE** is deleted for the **OH_AudioStream_SampleFormat** enum. 159 160**Change Impact** 161 162Applications that use the involved APIs may have compatibility issues. 163 164**Key API/Component Changes** 165 166Before change: 167 168```C 169typedef enum { 170 AUDIOSTREAM_SAMPLE_U8 = 0, 171 AUDIOSTREAM_SAMPLE_S16LE = 1, 172 AUDIOSTREAM_SAMPLE_S24LE = 2, 173 AUDIOSTREAM_SAMPLE_S32LE = 3, 174 AUDIOSTREAM_SAMPLE_F32LE = 4, 175} OH_AudioStream_SampleFormat; 176``` 177 178After change: 179 180```C 181typedef enum { 182 /** 183 * Unsigned 8 format. 184 */ 185 AUDIOSTREAM_SAMPLE_U8 = 0, 186 /** 187 * Signed 16 bit integer, little endian. 188 */ 189 AUDIOSTREAM_SAMPLE_S16LE = 1, 190 /** 191 * Signed 24 bit integer, little endian. 192 */ 193 AUDIOSTREAM_SAMPLE_S24LE = 2, 194 /** 195 * Signed 32 bit integer, little endian. 196 */ 197 AUDIOSTREAM_SAMPLE_S32LE = 3, 198} OH_AudioStream_SampleFormat; 199``` 200 201**Adaptation Guide** 202 203Do not use **AUDIOSTREAM_SAMPLE_F32LE** for **OH_AudioStream_SampleFormat**. 204 205 206## cl.multimedia.4 Deleted content from getAudioEffectInfoArray 207 208The input parameter **content** is deleted from **getAudioEffectInfoArray**. 209 210**Change Impact** 211 212Applications that use the involved APIs may have compatibility issues. 213 214**Key API/Component Changes** 215 216Before change: 217 218```js 219getAudioEffectInfoArray(content: ContentType, usage: StreamUsage, callback: AsyncCallback<AudioEffectInfoArray>): void; 220getAudioEffectInfoArray(content: ContentType, usage: StreamUsage): Promise<AudioEffectInfoArray>; 221``` 222 223After change: 224 225```js 226getAudioEffectInfoArray(usage: StreamUsage, callback: AsyncCallback<AudioEffectInfoArray>): void; 227getAudioEffectInfoArray(usage: StreamUsage): Promise<AudioEffectInfoArray>; 228``` 229 230**Adaptation Guide** 231 232When calling this API, pass in only the input parameter **usage**. If **getAudioEffectInfoArray** is used in your application code, delete the **content** parameter. 233 234 235## cl.multimedia.5 Playback APIs Changed 236 237The APIs related to audio track switching are deleted. 238 239**Change Impact** 240 241These APIs are unavailable. 242 243**Key API/Component Changes** 244 245The deleted APIs are as follows: 246 247| Class| API| 248| -------- | -------- | 249| Media.Core | MD_KEY_LANGUAGE | 250| Media.AVPlayer | selectTrack(index: number): void | 251| Media.AVPlayer | deselectTrack(index: number): void | 252| Media.AVPlayer | getCurrentTrack(trackType: MediaType, callback: AsyncCallback<number>): void | 253| Media.AVPlayer | getCurrentTrack(trackType: MediaType): Promise<number> | 254| Media.AVPlayer | on(type: 'trackChange', callback: (index: number, isSelect: boolean) => void): void; | 255| Media.AVPlayer | off(type: 'trackChange'): void | 256