क्या आपको पता है कि मैं आईओएस सिस्टम ध्वनियों को इंगित करने वाले स्थिरांक की सूची कहां प्राप्त कर सकता हूं, जिससे मुझे ऑडियो सर्विसेज क्रिएट सिस्टम सिस्टम को प्रदान करने में सक्षम बनाया जा सके?आईफोन - सिस्टम कोड संहिता
5
A
उत्तर
1
यह AudioServices.h
से है:
//==================================================================================================
#pragma mark AudioServices Constants
/*!
@enum AudioServices constants
@abstract Constants for use with System Sound portion of the AudioServices APIs.
@constant kSystemSoundID_UserPreferredAlert
Use this constant with the play sound APIs to
playback the alert sound selected by the User in System Preferences.
@constant kSystemSoundID_Vibrate
Use this constant with the play sound APIs to vibrate the device
- iPhone only
- on a device with no vibration capability (like iPod Touch) this will
do nothing
@constant kSystemSoundID_FlashScreen
Use this constant with the play sound APIs to flash the screen
- Desktop systems only
*/
enum
{
#if TARGET_OS_IPHONE
kSystemSoundID_Vibrate = 0x00000FFF
#else
kSystemSoundID_UserPreferredAlert = 0x00001000,
kSystemSoundID_FlashScreen = 0x00000FFE,
// this has been renamed to be consistent
kUserPreferredAlert = kSystemSoundID_UserPreferredAlert
#endif
};
आशा इस मदद करता है।
0
केवल एक जिसे मैं जानता हूं kSystemSoundID_Vibrate
है, ऑडियोटूलबॉक्स/AudioServices.h में।
धन्यवाद, लेकिन इन सभी नामों के बारे में हम वेब पर दिखाए गए उदाहरणों में क्या पा सकते हैं, जैसे: https://developer.apple.com/library/ios/#samplecode/SysSound/Listings/Classes_SysSoundViewController_m.html # // apple_ref/doc/uid/DTS40008018-Classes_SysSoundViewController_m-DontLinkElementID_6 – Oliver
आप किस नाम का जिक्र कर रहे हैं? – Viraj
"टीएपी" -> एनएसआरएल * टैपसाउंड = [[एनएसबंडल मेनबंडल] URLForResource: @ "टैप करें" एक्सटेंशन के साथ: @ "aif"]; // URL को CFURLRef उदाहरण self.soundFileURLRef = (CFURLRef) के रूप में स्टोर करें [टैपसाउंड बनाए रखें]; // ध्वनि फ़ाइल का प्रतिनिधित्व करने वाला सिस्टम ध्वनि ऑब्जेक्ट बनाएं। AudioServicesCreateSystemSoundID ( soundFileURLRef, और soundFileObject ); मैंने वेब उदाहरणों पर कई अन्य पाया – Oliver