source
stringlengths
14
113
code
stringlengths
10
21.3k
application-dev\reference\apis-audio-kit\js-apis-audio.md
import { BusinessError } from '@kit.BasicServicesKit'; audioCapturer.getAudioTime().then((audioTime: number) => { console.info(`AudioFrameworkRecLog: AudioCapturer getAudioTime : Success ${audioTime}`); }).catch((err: BusinessError) => { console.error(`AudioFrameworkRecLog: AudioCapturer Created : ERROR : ${err}`)...
application-dev\reference\apis-audio-kit\js-apis-audio.md
import { BusinessError } from '@kit.BasicServicesKit'; try { let audioTime: number = audioCapturer.getAudioTimeSync(); console.info(`AudioFrameworkRecLog: AudioCapturer getAudioTimeSync : Success ${audioTime}`); } catch (err) { let error = err as BusinessError; console.error(`AudioFrameworkRecLog: AudioCapture...
application-dev\reference\apis-audio-kit\js-apis-audio.md
import { BusinessError } from '@kit.BasicServicesKit'; audioCapturer.getBufferSize((err: BusinessError, bufferSize: number) => { if (!err) { console.info(`BufferSize : ${bufferSize}`); audioCapturer.read(bufferSize, true).then((buffer: ArrayBuffer) => { console.info(`Buffer read is ${buffer.byteLength}...
application-dev\reference\apis-audio-kit\js-apis-audio.md
import { BusinessError } from '@kit.BasicServicesKit'; let bufferSize: number = 0; audioCapturer.getBufferSize().then((data: number) => { console.info(`AudioFrameworkRecLog: getBufferSize :SUCCESS ${data}`); bufferSize = data; }).catch((err: BusinessError) => { console.error(`AudioFrameworkRecLog: getBufferSize...
application-dev\reference\apis-audio-kit\js-apis-audio.md
import { BusinessError } from '@kit.BasicServicesKit'; let bufferSize: number = 0; try { bufferSize = audioCapturer.getBufferSizeSync(); console.info(`AudioFrameworkRecLog: getBufferSizeSync :SUCCESS ${bufferSize}`); } catch (err) { let error = err as BusinessError; console.error(`AudioFrameworkRecLog: getBuf...
application-dev\reference\apis-audio-kit\js-apis-audio.md
let deviceDescriptors: audio.AudioDeviceDescriptors = audioCapturer.getCurrentInputDevices(); console.info(`Device id: ${deviceDescriptors[0].id}`); console.info(`Device type: ${deviceDescriptors[0].deviceType}`); console.info(`Device role: ${deviceDescriptors[0].deviceRole}`); console.info(`Device name: ${deviceDescri...
application-dev\reference\apis-audio-kit\js-apis-audio.md
let info: audio.AudioCapturerChangeInfo = audioCapturer.getCurrentAudioCapturerChangeInfo(); console.info(`Info streamId: ${info.streamId}`); console.info(`Info source: ${info.capturerInfo.source}`); console.info(`Info capturerFlags: ${info.capturerInfo.capturerFlags}`); console.info(`Info muted: ${info.muted}`); conso...
application-dev\reference\apis-audio-kit\js-apis-audio.md
import { audio } from '@kit.AudioKit'; let isCapturing: boolean; // An identifier specifying whether capturing is in progress. onAudioInterrupt(); async function onAudioInterrupt(){ audioCapturer.on('audioInterrupt', (interruptEvent: audio.InterruptEvent) => { // When an audio interruption event occurs, the Aud...
application-dev\reference\apis-audio-kit\js-apis-audio.md
audioCapturer.off('audioInterrupt');
application-dev\reference\apis-audio-kit\js-apis-audio.md
audioCapturer.on('inputDeviceChange', (deviceChangeInfo: audio.AudioDeviceDescriptors) => { console.info(`inputDevice id: ${deviceChangeInfo[0].id}`); console.info(`inputDevice deviceRole: ${deviceChangeInfo[0].deviceRole}`); console.info(`inputDevice deviceType: ${deviceChangeInfo[0].deviceType}`); });
application-dev\reference\apis-audio-kit\js-apis-audio.md
// Cancel all subscriptions to the event. audioCapturer.off('inputDeviceChange'); // For the same event, if the callback parameter passed to the off API is the same as that passed to the on API, the off API cancels the subscription registered with the specified callback parameter. let inputDeviceChangeCallback = (devi...
application-dev\reference\apis-audio-kit\js-apis-audio.md
audioCapturer.on('audioCapturerChange', (capturerChangeInfo: audio.AudioCapturerChangeInfo) => { console.info(`audioCapturerChange id: ${capturerChangeInfo[0].id}`); console.info(`audioCapturerChange deviceRole: ${capturerChangeInfo[0].deviceRole}`); console.info(`audioCapturerChange deviceType: ${capturerChangeI...
application-dev\reference\apis-audio-kit\js-apis-audio.md
// Cancel all subscriptions to the event. audioCapturer.off('audioCapturerChange'); // For the same event, if the callback parameter passed to the off API is the same as that passed to the on API, the off API cancels the subscription registered with the specified callback parameter. let audioCapturerChangeCallback = (...
application-dev\reference\apis-audio-kit\js-apis-audio.md
audioCapturer.on('markReach', 1000, (position: number) => { if (position == 1000) { console.info('ON Triggered successfully'); } });
application-dev\reference\apis-audio-kit\js-apis-audio.md
// Cancel all subscriptions to the event. audioCapturer.off('markReach'); // For the same event, if the callback parameter passed to the off API is the same as that passed to the on API, the off API cancels the subscription registered with the specified callback parameter. let markReachCallback = (position: number) =>...
application-dev\reference\apis-audio-kit\js-apis-audio.md
audioCapturer.on('periodReach', 1000, (position: number) => { if (position == 1000) { console.info('ON Triggered successfully'); } });
application-dev\reference\apis-audio-kit\js-apis-audio.md
// Cancel all subscriptions to the event. audioCapturer.off('periodReach'); // For the same event, if the callback parameter passed to the off API is the same as that passed to the on API, the off API cancels the subscription registered with the specified callback parameter. let periodReachCallback = (position: number...
application-dev\reference\apis-audio-kit\js-apis-audio.md
audioCapturer.on('stateChange', (state: audio.AudioState) => { if (state == 1) { console.info('audio capturer state is: STATE_PREPARED'); } if (state == 2) { console.info('audio capturer state is: STATE_RUNNING'); } });
application-dev\reference\apis-audio-kit\js-apis-audio.md
// Cancel all subscriptions to the event. audioCapturer.off('stateChange'); // For the same event, if the callback parameter passed to the off API is the same as that passed to the on API, the off API cancels the subscription registered with the specified callback parameter. let stateChangeCallback = (state: audio.Aud...
application-dev\reference\apis-audio-kit\js-apis-audio.md
import { BusinessError } from '@kit.BasicServicesKit'; import { fileIo as fs } from '@kit.CoreFileKit'; import { common } from '@kit.AbilityKit'; class Options { offset?: number; length?: number; } let bufferSize: number = 0; // Obtain the context from the component and ensure that the return value of this.getUIC...
application-dev\reference\apis-audio-kit\js-apis-audio.md
// Cancel all subscriptions to the event. audioCapturer.off('readData'); // For the same event, if the callback parameter passed to the off API is the same as that passed to the on API, the off API cancels the subscription registered with the specified callback parameter. let readDataCallback = (data: ArrayBuffer) => ...
application-dev\reference\apis-audio-kit\js-apis-audio.md
import { BusinessError } from '@kit.BasicServicesKit'; audioCapturer.getOverflowCount().then((value: number) => { console.info(`Get overflow count Success! ${value}`); }).catch((err: BusinessError) => { console.error(`Get overflow count Fail: ${err}`); });
application-dev\reference\apis-audio-kit\js-apis-audio.md
import { BusinessError } from '@kit.BasicServicesKit'; try { let value: number = audioCapturer.getOverflowCountSync(); console.info(`Get overflow count Success! ${value}`); } catch (err) { let error = err as BusinessError; console.error(`Get overflow count Fail: ${error}`); }
application-dev\reference\apis-audio-kit\js-apis-audioHaptic.md
import { audioHaptic } from '@kit.AudioKit';
application-dev\reference\apis-audio-kit\js-apis-audioHaptic.md
let audioHapticManagerInstance: audioHaptic.AudioHapticManager = audioHaptic.getAudioHapticManager();
application-dev\reference\apis-audio-kit\js-apis-audioHaptic.md
import { BusinessError } from '@kit.BasicServicesKit'; let audioUri = 'data/audioTest.wav'; // Change it to the URI of the target audio source. let hapticUri = 'data/hapticTest.json'; // Change it to the URI of the target haptic source. let id = 0; audioHapticManagerInstance.registerSource(audioUri, hapticUri).then((...
application-dev\reference\apis-audio-kit\js-apis-audioHaptic.md
import { BusinessError } from '@kit.BasicServicesKit'; let audioUri = 'data/audioTest.wav'; // Change it to the URI of the target audio source. let hapticUri = 'data/hapticTest.json'; // Change it to the URI of the target haptic source. let id = 0; audioHapticManagerInstance.registerSource(audioUri, hapticUri).then((...
application-dev\reference\apis-audio-kit\js-apis-audioHaptic.md
import { BusinessError } from '@kit.BasicServicesKit'; let audioUri = 'data/audioTest.wav'; // Change it to the URI of the target audio source. let hapticUri = 'data/hapticTest.json'; // Change it to the URI of the target haptic source. let id = 0; audioHapticManagerInstance.registerSource(audioUri, hapticUri).then((...
application-dev\reference\apis-audio-kit\js-apis-audioHaptic.md
import { audio } from '@kit.AudioKit'; import { BusinessError } from '@kit.BasicServicesKit'; let audioUri = 'data/audioTest.wav'; // Change it to the URI of the target audio source. let hapticUri = 'data/hapticTest.json'; // Change it to the URI of the target haptic source. let id = 0; audioHapticManagerInstance.reg...
application-dev\reference\apis-audio-kit\js-apis-audioHaptic.md
import { BusinessError } from '@kit.BasicServicesKit'; let audioUri = 'data/audioTest.wav'; // Change it to the URI of the target audio source. let hapticUri = 'data/hapticTest.json'; // Change it to the URI of the target haptic source. let id = 0; audioHapticManagerInstance.registerSource(audioUri, hapticUri).then((...
application-dev\reference\apis-audio-kit\js-apis-audioHaptic.md
let audioHapticType: audioHaptic.AudioHapticType = audioHaptic.AudioHapticType.AUDIO_HAPTIC_TYPE_AUDIO; let result: boolean = audioHapticPlayerInstance.isMuted(audioHapticType);
application-dev\reference\apis-audio-kit\js-apis-audioHaptic.md
import { BusinessError } from '@kit.BasicServicesKit'; audioHapticPlayerInstance.start().then(() => { console.info(`Promise returned to indicate that start playing successfully.`); }).catch ((err: BusinessError) => { console.error(`Failed to start playing. ${err}`); });
application-dev\reference\apis-audio-kit\js-apis-audioHaptic.md
import { BusinessError } from '@kit.BasicServicesKit'; audioHapticPlayerInstance.stop().then(() => { console.info(`Promise returned to indicate that stop playing successfully.`); }).catch ((err: BusinessError) => { console.error(`Failed to stop playing. ${err}`); });
application-dev\reference\apis-audio-kit\js-apis-audioHaptic.md
import { BusinessError } from '@kit.BasicServicesKit'; audioHapticPlayerInstance.release().then(() => { console.info(`Promise returned to indicate that release the audio haptic player successfully.`); }).catch ((err: BusinessError) => { console.error(`Failed to release the audio haptic player. ${err}`); });
application-dev\reference\apis-audio-kit\js-apis-audioHaptic.md
audioHapticPlayerInstance.on('endOfStream', () => { console.info(`Receive the callback of endOfStream.`); });
application-dev\reference\apis-audio-kit\js-apis-audioHaptic.md
// Cancel all subscriptions to the event. audioHapticPlayerInstance.off('endOfStream'); // For the same event, if the callback parameter passed to the off API is the same as that passed to the on API, the off API cancels the subscription registered with the specified callback parameter. let endOfStreamCallback = () =>...
application-dev\reference\apis-audio-kit\js-apis-audioHaptic.md
import { audio } from '@kit.AudioKit'; let isPlaying: boolean; // An identifier specifying whether rendering is in progress. let isDucked: boolean; // An identifier specifying whether the audio volume is reduced. audioHapticPlayerInstance.on('audioInterrupt', (interruptEvent: audio.InterruptEvent) => { // When an a...
application-dev\reference\apis-audio-kit\js-apis-audioHaptic.md
import { audio } from '@kit.AudioKit'; // Cancel all subscriptions to the event. audioHapticPlayerInstance.off('audioInterrupt'); // For the same event, if the callback parameter passed to the off API is the same as that passed to the on API, the off API cancels the subscription registered with the specified callback...
application-dev\reference\apis-audio-kit\js-apis-inner-multimedia-ringtonePlayer-sys.md
import { systemSoundManager } from '@kit.AudioKit';
application-dev\reference\apis-audio-kit\js-apis-inner-multimedia-ringtonePlayer-sys.md
import { media } from '@kit.MediaKit'; let state: media.AVPlayerState = systemRingtonePlayer.state;
application-dev\reference\apis-audio-kit\js-apis-inner-multimedia-ringtonePlayer-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; systemRingtonePlayer.getTitle((err: BusinessError, value: string) => { if (err) { console.error(`Failed to get system ringtone title. ${err}`); return; } console.info(`Callback invoked to indicate the value of the system ringtone title is obtained ${...
application-dev\reference\apis-audio-kit\js-apis-inner-multimedia-ringtonePlayer-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; systemRingtonePlayer.getTitle().then((value: string) => { console.info(`Promise returned to indicate that the value of the system ringtone title is obtained ${value}.`); }).catch ((err: BusinessError) => { console.error(`Failed to get the system ringtone title...
application-dev\reference\apis-audio-kit\js-apis-inner-multimedia-ringtonePlayer-sys.md
import { audio } from '@kit.AudioKit'; import { BusinessError } from '@kit.BasicServicesKit'; let audioRendererInfo: audio.AudioRendererInfo | undefined = undefined; systemRingtonePlayer.getAudioRendererInfo((err: BusinessError, value: audio.AudioRendererInfo) => { if (err) { console.error(`Failed to get ringto...
application-dev\reference\apis-audio-kit\js-apis-inner-multimedia-ringtonePlayer-sys.md
import { audio } from '@kit.AudioKit'; import { BusinessError } from '@kit.BasicServicesKit'; let audioRendererInfo: audio.AudioRendererInfo | undefined = undefined; systemRingtonePlayer.getAudioRendererInfo().then((value: audio.AudioRendererInfo) => { console.info(`Promise returned to indicate that the value of th...
application-dev\reference\apis-audio-kit\js-apis-inner-multimedia-ringtonePlayer-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; class RingtoneOptions { volume: number = 0; loop: boolean = false; } let ringtoneOptions: RingtoneOptions = {volume: 0.5, loop: true}; systemRingtonePlayer.configure(ringtoneOptions, (err: BusinessError) => { if (err) { console.error(`Failed to configur...
application-dev\reference\apis-audio-kit\js-apis-inner-multimedia-ringtonePlayer-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; class RingtoneOptions { volume: number = 0; loop: boolean = false; } let ringtoneOptions: RingtoneOptions = {volume: 0.5, loop: true}; systemRingtonePlayer.configure(ringtoneOptions).then(() => { console.info(`Promise returned to indicate a successful setti...
application-dev\reference\apis-audio-kit\js-apis-inner-multimedia-ringtonePlayer-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; systemRingtonePlayer.start((err: BusinessError) => { if (err) { console.error(`Failed to start playing ringtone. ${err}`); return; } console.info(`Callback invoked to indicate a successful starting of ringtone.`); });
application-dev\reference\apis-audio-kit\js-apis-inner-multimedia-ringtonePlayer-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; systemRingtonePlayer.start().then(() => { console.info(`Promise returned to indicate a successful starting of ringtone.`); }).catch ((err: BusinessError) => { console.error(`Failed to start playing ringtone. ${err}`); });
application-dev\reference\apis-audio-kit\js-apis-inner-multimedia-ringtonePlayer-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; systemRingtonePlayer.stop((err: BusinessError) => { if (err) { console.error(`Failed to stop playing ringtone. ${err}`); return; } console.info(`Callback invoked to indicate a successful stopping of ringtone.`); });
application-dev\reference\apis-audio-kit\js-apis-inner-multimedia-ringtonePlayer-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; systemRingtonePlayer.stop().then(() => { console.info(`Promise returned to indicate a successful stopping of ringtone.`); }).catch ((err: BusinessError) => { console.error(`Failed to stop playing ringtone. ${err}`); });
application-dev\reference\apis-audio-kit\js-apis-inner-multimedia-ringtonePlayer-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; systemRingtonePlayer.release((err: BusinessError) => { if (err) { console.error(`Failed to release ringtone player. ${err}`); return; } console.info(`Callback invoked to indicate a successful releasing of ringtone player.`); });
application-dev\reference\apis-audio-kit\js-apis-inner-multimedia-ringtonePlayer-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; systemRingtonePlayer.release().then(() => { console.info(`Promise returned to indicate a successful releasing of ringtone player.`); }).catch ((err: BusinessError) => { console.error(`Failed to release ringtone player. ${err}`); });
application-dev\reference\apis-audio-kit\js-apis-inner-multimedia-ringtonePlayer-sys.md
import { audio } from '@kit.AudioKit'; let isPlaying: boolean; // An identifier specifying whether rendering is in progress. let isDucked: boolean; // An identifier specifying whether the audio volume is reduced. systemRingtonePlayer.on('audioInterrupt', async(interruptEvent: audio.InterruptEvent) => { if (interrup...
application-dev\reference\apis-audio-kit\js-apis-inner-multimedia-ringtonePlayer-sys.md
systemRingtonePlayer.off('audioInterrupt');
application-dev\reference\apis-audio-kit\js-apis-inner-multimedia-systemTonePlayer-sys.md
import { systemSoundManager } from '@kit.AudioKit';
application-dev\reference\apis-audio-kit\js-apis-inner-multimedia-systemTonePlayer-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; systemTonePlayer.getTitle().then((value: string) => { console.info(`Promise returned to indicate that the value of the system tone player title is obtained ${value}.`); }).catch ((err: BusinessError) => { console.error(`Failed to get the system tone player tit...
application-dev\reference\apis-audio-kit\js-apis-inner-multimedia-systemTonePlayer-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; systemTonePlayer.prepare().then(() => { console.info(`Promise returned to indicate a successful prepareing of system tone player.`); }).catch ((err: BusinessError) => { console.error(`Failed to prepareing system tone player. ${err}`); });
application-dev\reference\apis-audio-kit\js-apis-inner-multimedia-systemTonePlayer-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; class SystemToneOptions { muteAudio: boolean = false; muteHaptics: boolean = false; } let systemToneOptions: SystemToneOptions = {muteAudio: true, muteHaptics: false}; systemTonePlayer.start(systemToneOptions).then((value: number) => { console.info(`Promise...
application-dev\reference\apis-audio-kit\js-apis-inner-multimedia-systemTonePlayer-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; let streamID: number = 0; // streamID is the stream ID returned by start(). Only initialization is performed here. systemTonePlayer.stop(streamID).then(() => { console.info(`Promise returned to indicate a successful stopping of system tone player.`); }).catch ((...
application-dev\reference\apis-audio-kit\js-apis-inner-multimedia-systemTonePlayer-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; systemTonePlayer.release().then(() => { console.info(`Promise returned to indicate a successful releasing of system tone player.`); }).catch ((err: BusinessError) => { console.error(`Failed to release system tone player. ${err}`); });
application-dev\reference\apis-audio-kit\js-apis-inner-multimedia-systemTonePlayer-sys.md
let scale: number = 0.5; try { systemTonePlayer.setAudioVolumeScale(scale); } catch (err) { console.error(`Failed to set audio volume scale. ${err}`); }
application-dev\reference\apis-audio-kit\js-apis-inner-multimedia-systemTonePlayer-sys.md
try { let scale: number = systemTonePlayer.getAudioVolumeScale(); console.info(` get audio volume scale. ${scale}`); } catch (err) { console.error(`Failed to get audio volume scale. ${err}`); }
application-dev\reference\apis-audio-kit\js-apis-inner-multimedia-systemTonePlayer-sys.md
try { let features: Array<systemSoundManager.ToneHapticsFeature> = await systemTonePlayer.getSupportedHapticsFeatures(); console.info(` get supported haptics features. ${features}`); } catch (err) { console.error(`Failed to get supported haptics features. ${err}`); }
application-dev\reference\apis-audio-kit\js-apis-inner-multimedia-systemTonePlayer-sys.md
try { let features: Array<systemSoundManager.ToneHapticsFeature> = await systemTonePlayer.getSupportedHapticsFeatures(); if (features.lenght == 0) { return; } let feature: systemSoundManager.ToneHapticsFeature = features[0]; systemTonePlayer.setHapticsFeature(feature); console.info(` set haptics feature...
application-dev\reference\apis-audio-kit\js-apis-inner-multimedia-systemTonePlayer-sys.md
try { let feature: systemSoundManager.ToneHapticsFeature = systemTonePlayer.getHapticsFeature(); console.info(` get haptics feature success. ${features}`); } catch (err) { console.error(`Failed to get haptics feature. ${err}`); }
application-dev\reference\apis-audio-kit\js-apis-inner-multimedia-systemTonePlayer-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; // Subscribe to the playback complete events of all audio streams. systemTonePlayer.on('playFinished', 0, (streamId: number) => { console.info(`Receive the callback of playFinished, streamId: ${streamId}.`); }); // Subscribe to the playback complete event of a ...
application-dev\reference\apis-audio-kit\js-apis-inner-multimedia-systemTonePlayer-sys.md
// Cancel all subscriptions to the event. systemTonePlayer.off('playFinished'); // For the same event, if the callback parameter passed to the off API is the same as that passed to the on API, the off API cancels the subscription registered with the specified callback parameter. let playFinishedCallback = (streamId: n...
application-dev\reference\apis-audio-kit\js-apis-inner-multimedia-systemTonePlayer-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; systemTonePlayer.on('error', (err: BusinessError) => { console.log("on error, err:" + JSON.stringify(err)); });
application-dev\reference\apis-audio-kit\js-apis-inner-multimedia-systemTonePlayer-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; // Cancel all subscriptions to the event. systemTonePlayer.off('error'); // For the same event, if the callback parameter passed to the off API is the same as that passed to the on API, the off API cancels the subscription registered with the specified callback p...
application-dev\reference\apis-audio-kit\js-apis-systemSoundManager-sys.md
import { systemSoundManager } from '@kit.AudioKit';
application-dev\reference\apis-audio-kit\js-apis-systemSoundManager-sys.md
toneAttrs.getTitle();
application-dev\reference\apis-audio-kit\js-apis-systemSoundManager-sys.md
let toneAttrs = systemSoundManager.createCustomizedToneAttrs(); let title = 'text'; toneAttrs.setTitle(title);
application-dev\reference\apis-audio-kit\js-apis-systemSoundManager-sys.md
toneAttrs.getFileName();
application-dev\reference\apis-audio-kit\js-apis-systemSoundManager-sys.md
let toneAttrs = systemSoundManager.createCustomizedToneAttrs(); let fileName = 'textFileName'; toneAttrs.setFileName(fileName);
application-dev\reference\apis-audio-kit\js-apis-systemSoundManager-sys.md
toneAttrs.getUri();
application-dev\reference\apis-audio-kit\js-apis-systemSoundManager-sys.md
toneAttrs.getCustomizedType();
application-dev\reference\apis-audio-kit\js-apis-systemSoundManager-sys.md
let toneAttrs = systemSoundManager.createCustomizedToneAttrs(); let categoryValue = systemSoundManager.TONE_CATEGORY_ALARM; // Change the value to the required constant. toneAttrs.setCategory(categoryValue);
application-dev\reference\apis-audio-kit\js-apis-systemSoundManager-sys.md
toneAttrs.getCategory();
application-dev\reference\apis-audio-kit\js-apis-systemSoundManager-sys.md
let toneAttrs: systemSoundManager.ToneAttrs = systemSoundManager.createCustomizedToneAttrs();
application-dev\reference\apis-audio-kit\js-apis-systemSoundManager-sys.md
toneHapticsAttrs.getUri();
application-dev\reference\apis-audio-kit\js-apis-systemSoundManager-sys.md
toneHapticsAttrs.getTitle();
application-dev\reference\apis-audio-kit\js-apis-systemSoundManager-sys.md
toneHapticsAttrs.getFileName();
application-dev\reference\apis-audio-kit\js-apis-systemSoundManager-sys.md
let systemSoundManagerInstance: systemSoundManager.SystemSoundManager = systemSoundManager.getSystemSoundManager();
application-dev\reference\apis-audio-kit\js-apis-systemSoundManager-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; import { common } from '@kit.AbilityKit'; // Obtain the context from the component and ensure that the return value of this.getUIContext().getHostContext() is UIAbilityContext. let context = this.getUIContext().getHostContext() as common.UIAbilityContext; let uri ...
application-dev\reference\apis-audio-kit\js-apis-systemSoundManager-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; import { common } from '@kit.AbilityKit'; // Obtain the context from the component and ensure that the return value of this.getUIContext().getHostContext() is UIAbilityContext. let context = this.getUIContext().getHostContext() as common.UIAbilityContext; let uri ...
application-dev\reference\apis-audio-kit\js-apis-systemSoundManager-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; import { common } from '@kit.AbilityKit'; // Obtain the context from the component and ensure that the return value of this.getUIContext().getHostContext() is UIAbilityContext. let context = this.getUIContext().getHostContext() as common.UIAbilityContext; let type...
application-dev\reference\apis-audio-kit\js-apis-systemSoundManager-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; import { common } from '@kit.AbilityKit'; // Obtain the context from the component and ensure that the return value of this.getUIContext().getHostContext() is UIAbilityContext. let context = this.getUIContext().getHostContext() as common.UIAbilityContext; let type...
application-dev\reference\apis-audio-kit\js-apis-systemSoundManager-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; import { common } from '@kit.AbilityKit'; // Obtain the context from the component and ensure that the return value of this.getUIContext().getHostContext() is UIAbilityContext. let context = this.getUIContext().getHostContext() as common.UIAbilityContext; let type...
application-dev\reference\apis-audio-kit\js-apis-systemSoundManager-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; import { common } from '@kit.AbilityKit'; // Obtain the context from the component and ensure that the return value of this.getUIContext().getHostContext() is UIAbilityContext. let context = this.getUIContext().getHostContext() as common.UIAbilityContext; let type...
application-dev\reference\apis-audio-kit\js-apis-systemSoundManager-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; import { common } from '@kit.AbilityKit'; // Obtain the context from the component and ensure that the return value of this.getUIContext().getHostContext() is UIAbilityContext. let context = this.getUIContext().getHostContext() as common.UIAbilityContext; let uri ...
application-dev\reference\apis-audio-kit\js-apis-systemSoundManager-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; import { common } from '@kit.AbilityKit'; // Obtain the context from the component and ensure that the return value of this.getUIContext().getHostContext() is UIAbilityContext. let context = this.getUIContext().getHostContext() as common.UIAbilityContext; let type...
application-dev\reference\apis-audio-kit\js-apis-systemSoundManager-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; import { common } from '@kit.AbilityKit'; // Obtain the context from the component and ensure that the return value of this.getUIContext().getHostContext() is UIAbilityContext. let context = this.getUIContext().getHostContext() as common.UIAbilityContext; let type...
application-dev\reference\apis-audio-kit\js-apis-systemSoundManager-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; import { common } from '@kit.AbilityKit'; // Obtain the context from the component and ensure that the return value of this.getUIContext().getHostContext() is UIAbilityContext. let context = this.getUIContext().getHostContext() as common.UIAbilityContext; let uri ...
application-dev\reference\apis-audio-kit\js-apis-systemSoundManager-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; import { common } from '@kit.AbilityKit'; // Obtain the context from the component and ensure that the return value of this.getUIContext().getHostContext() is UIAbilityContext. let context = this.getUIContext().getHostContext() as common.UIAbilityContext; let type...
application-dev\reference\apis-audio-kit\js-apis-systemSoundManager-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; import { common } from '@kit.AbilityKit'; // Obtain the context from the component and ensure that the return value of this.getUIContext().getHostContext() is UIAbilityContext. let context = this.getUIContext().getHostContext() as common.UIAbilityContext; let type...
application-dev\reference\apis-audio-kit\js-apis-systemSoundManager-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; import { common } from '@kit.AbilityKit'; // Obtain the context from the component and ensure that the return value of this.getUIContext().getHostContext() is UIAbilityContext. let context = this.getUIContext().getHostContext() as common.UIAbilityContext; let type...
application-dev\reference\apis-audio-kit\js-apis-systemSoundManager-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; import { common } from '@kit.AbilityKit'; // Obtain the context from the component and ensure that the return value of this.getUIContext().getHostContext() is UIAbilityContext. let context = this.getUIContext().getHostContext() as common.UIAbilityContext; let type...
application-dev\reference\apis-audio-kit\js-apis-systemSoundManager-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; import { common } from '@kit.AbilityKit'; // Obtain the context from the component and ensure that the return value of this.getUIContext().getHostContext() is UIAbilityContext. let context = this.getUIContext().getHostContext() as common.UIAbilityContext; let type...
application-dev\reference\apis-audio-kit\js-apis-systemSoundManager-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; import { common } from '@kit.AbilityKit'; // Obtain the context from the component and ensure that the return value of this.getUIContext().getHostContext() is UIAbilityContext. let context = this.getUIContext().getHostContext() as common.UIAbilityContext; let type...
application-dev\reference\apis-audio-kit\js-apis-systemSoundManager-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; import { common } from '@kit.AbilityKit'; // Obtain the context from the component and ensure that the return value of this.getUIContext().getHostContext() is UIAbilityContext. let context = this.getUIContext().getHostContext() as common.UIAbilityContext; let sys...