• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2025 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16package OHOS.AudioStandard;
17
18sequenceable OHOS.IRemoteObject;
19sequenceable oh_audio_buffer..OHOS.AudioStandard.OHAudioBuffer;
20sequenceable oh_audio_buffer..OHOS.AudioStandard.OHAudioBufferBase;
21sequenceable audio_info..OHOS.AudioStandard.AudioPlaybackCaptureConfig;
22
23interface IIpcStream {
24    [ipccode 0] void RegisterStreamListener([in] IRemoteObject object);
25    void ResolveBuffer([out] sharedptr<OHAudioBuffer> buffer);
26    void UpdatePosition();
27    void GetAudioSessionID([out] unsigned int sessionId);
28    void Start();
29    void Pause();
30    void Stop();
31    void Release([in] boolean isSwitchStream); // isSwitchStream = false
32    void Flush();
33    void Drain([in] boolean stopFlag); // stopFlag = false
34    void UpdatePlaybackCaptureConfig([in] AudioPlaybackCaptureConfig config);
35    void GetAudioTime([out] unsigned long framePos, [out] unsigned long timestamp);
36    void GetAudioPosition([out] unsigned long framePos, [out] unsigned long timestamp, [out] unsigned long latency,
37        [in] int base);
38    void GetSpeedPosition([out] unsigned long framePos, [out] unsigned long timestamp, [out] unsigned long latency,
39        [in] int base);
40    void GetLatency([out] unsigned long latency);
41    void SetRate([in] int rate); // SetRenderRate
42    void GetRate([out] int rate); // SetRenderRate
43    void SetLowPowerVolume([in] float volume); // renderer only
44    void GetLowPowerVolume([out] float volume); // renderer only
45    void SetAudioEffectMode([in] int effectMode); // renderer only
46    void GetAudioEffectMode([out] int effectMode); // renderer only
47    void SetPrivacyType([in] int privacyType); // renderer only
48    void GetPrivacyType([out] int privacyType); // renderer only
49    void SetOffloadMode([in] int state, [in] boolean isAppBack); // renderer only
50    void UnsetOffloadMode(); // renderer only
51    void GetOffloadApproximatelyCacheTime([out] unsigned long timestamp, [out] unsigned long paWriteIndex,
52        [out] unsigned long cacheTimeDsp, [out] unsigned long cacheTimePa); // renderer only
53    void UpdateSpatializationState([in] boolean spatializationEnabled, [in] boolean headTrackingEnabled); // rendererOnly
54    void GetStreamManagerType();
55    void SetSilentModeAndMixWithOthers([in] boolean on);
56    void SetClientVolume();
57    void SetMute([in] boolean isMute);
58    void SetDuckFactor([in] float duckFactor);
59    void RegisterThreadPriority([in] int tid, [in] String bundleName, [in] unsigned int method); // BoostTriggerMethod method
60    void SetDefaultOutputDevice([in] int defaultOutputDevice, [in] boolean skipForce); // DeviceType defaultOutputDevice
61    void SetSourceDuration([in] long duration);
62    void SetOffloadDataCallbackState([in] int state);
63    void SetSpeed([in] float speed);
64    void SetLoudnessGain([in] float loudnessGain);
65    void ResolveBufferBaseAndGetServerSpanSize([out] sharedptr<OHAudioBufferBase> buffer,
66        [out] unsigned int spanSizeInFrame, [out] unsigned long engineTotalSizeInFrame);
67    void SetAudioHapticsSyncId([in] int audioHapticsSyncId);
68}