iphone:Using-sound
出自UXGuide.net
请帮助我们修订和更新本文的译文部分
本文的译文部分可能是由多个贡献者提供或从不同的渠道收集,未经过最终审阅和整理,请您帮助我们一起修订和更新本文的译文部分。
使用声音
Using Sound
Users expect great sound from iPhone OS–based devices, whether they’re hearing system sounds, such as ringtones and alert sounds, or application sounds, such as media playback, ambient sounds, and soundtracks. In addition, users expect sounds from their devices to obey both their preferences and their intentions.
用户期望从搭载 iPhone 操作系统的设备听到美妙的声音,无论他们在听系统声音,如铃声和提醒声音,或应用程序声音,如媒体播放,环境声音,以及音轨。此外,用户也希望设备发出的声音符合他们的预设和意愿。
Users decide how loud sounds should be and whether they want to hear them at all. Sometimes, however, users expect to hear certain sounds even when their current settings indicate that they prefer silence. For example, users always expect to hear alarms that they have set. Essentially, users want to hear sounds they ask for, but avoid hearing sounds they don’t ask for.
声音的大小与是否播放,完全是由用户决定的。但是,有的时候,尽管用户目前的设置说明他们更希望处于静音模式,但是用户还是希望听到某些声音。例如,用户总是希望听到他们设置的提醒声。从本质上讲,用户是想听到他们需要的声音,但不想听到他们不需要的声音。
To help you accommodate this, iPhone OS provides programming interfaces you can use to:
为了帮助你适应这种情况,iPhone操作系统提供了以下编程接口,你可以使用:
- Describe how your application’s sounds should fit in with other sounds on the device
- 描述你的应用程序的声音应该如何与设备上的其他声音相协调
- Ensure that your application’s sounds play according to users’ expectations
- 确保你的应用程序的声音是根据用户的期望在播放
Before you decide how to handle sound in your application, you need to understand how users expect applications and the device to behave when they adjust device controls and use external devices, such as headphones and headsets.
在你决定如何处理应用程序中的声音前,你需要了解,当用户在调整设备控制选项和外部设备的时候,他们是期望应用程序和设备应该如何表现他们的。调整控制和使用外部设备,如耳机和耳麦。
目录 |
铃声/静音开关——用户的期望 The Ring/Silent Switch—What Users Expect
Users use the Ring/Silent switch to silence their devices when they want to:
用户在他们的设备上使用铃声/静音开关时,他们想:
- Avoid being interrupted by unexpected sounds, such as Phone ringtones and incoming message sounds.
- 避免被不期望的声音打断,如“电话”铃声,信息到达音。
- Avoid hearing sounds that are the byproducts of user actions, such as keyboard or other feedback sounds, incidental sounds, or application startup sounds.
- 避免听到用户操作的附属声音,如键盘声音或其他反馈声音,偶然的声音,或应用程序启动声音。
- Avoid hearing game sounds, including incidental sounds and soundtracks, that are not essential to using the game.
- 避免听到游戏声音,包括附属声音和音轨,这是并不是玩游戏时必不可少的声音。
For example, in a theater users switch their devices to silent to avoid bothering other people in the theater. In this situation, users still want to be able to use applications on their devices, but they don’t want to be surprised by sounds they don’t expect or explicitly request, such as ringtones or new message sounds.
例如,在剧院的时候,用户把设备的设置为静音,是为了避免打扰在剧院的其他人。在这种情况下,用户仍然希望能够在他们的设备上使用应用程序,但他们不想听到那些他们不期望或未明确请求的声音,如铃声或信息到达音。那样会让他们感觉惊讶。
However, the Ring/Silent switch does not silence sounds that result from user actions that are solely and explicitly intended to produce sound. For example:
但是,铃声/静音开关不会关闭那些由用户单独且明确的操作引起的声音。例如:
- Media playback in a media-only application is not silenced by the Ring/Silent switch because the media playback was explicitly requested by the user.
- 在只播放媒体的应用程序中的媒体播放,不会因为铃声/静音开关而关闭,因为媒体播放是用户明确的请求。
- A Clock alarm is not silenced by the Ring/Silent switch because the alarm was explicitly set by the user.
- 闹铃是不会被铃声/静音开关关闭的,因为它是由用户明确设置过的。
- A sound clip in a language-learning application is not silenced by the Ring/Silent switch because the user took explicit action to hear it.
- 在语言学习应用程序中的声音片断是不会被铃声/静音开关关闭的,因为用户明确地想听到它。
- Conversation in an audio chat application is not silenced by the Ring/Silent switch because the user started such an application for the sole purpose of having an audio chat.
- 在音频聊天应用程序中,交谈的声音是不会被铃声/静音开关关闭的,因为用户打开这个应用程序的唯一目的就是语音聊天。
This behavior follows the principle of user control because it is up to the user, not the device, to decide whether it's appropriate to hear sounds the user explicitly requests.
此行为遵循用户控制的原则,因为它是由用户而不是设备,来决定听到用户明确要求的声音是否合理。
音量按钮——用户的期望 Volume Buttons—What Users Expect
Users use the device’s volume buttons to adjust the volume of all sounds their devices can play, including songs, application sounds, and device sounds. This means that users can always use the volume buttons to quiet any sound, regardless of the position of the Ring/Silent switch.
用户使用设备的音量按钮来调节设备所能播放的任何声音的音量,包括歌曲,应用程序声音和设备声音。这意味着用户可以使用音量按钮来调节任何声音至安静,而不用管铃声/静音开关的状况如何。
In some cases, it might be appropriate for an application to give users volume-setting capability in the application’s user interface. For example, YouTube displays a volume slider users can use to adjust the volume of the video they’re watching. While YouTube is running, users can use the slider and the volume buttons interchangeably to affect the video’s volume. This is because the slider acts as a proxy for the volume buttons while the application is running: The slider affects both the application’s volume and overall system volume, with the exception of the ringer volume.
在某些情况下,在应用程序的用户界面上提供音量设置的功能也是合适的。例如,YouTube为用户提供了一个音量滑块来调节他们正在观看的视频的音量。YouTube在运行的时候,用户可以使用音量滑块或者音量按钮交替着来调节视频的音量。这是因为当应用程序在运行的时候,音量滑块就相当于音量按钮的代理:调节滑块同时影响应用程序的音量和整个系统的音量,不过不会影响铃声音量。
If you need to display a volume slider, be sure to use the system-provided volume slider available when you use the MPVolumeView class. Note that when the currently active audio output device does not support volume control (such as an A2DP device), the volume slider is replaced by the appropriate device name.
如果你需要显示一个音量滑块,一定要使用系统提供的在 MPVolumeView 类里的音量滑块。注意如果当前的声音输出设备不支持音量控制(比如A2DP设备),音量滑块就不会显示,取而代之的是设备名称。
Using the volume buttons to adjust an application’s currently playing audio also adjusts the overall system volume, with the exception of the ringer volume. (Using the volume buttons when no audio is currently playing adjusts the ringer volume.)
用音量按钮来调节应用程序当前正在播放的音频的音量,同时也会更改整个系统的音量,不过这不会影响铃声音量。(假如当前没有播放任何音频,那么音量按钮调节的是铃声音量。)
This behavior follows the principle of user control because the user always decides how loud sounds from their device should be.
此行为遵循用户控制的原则,因为设备应该发出多大的声音应该是一直由用户决定的。
Sometimes, an application might need to adjust relative, independent volume levels to produce the best mix in its audio output. But the volume of the final audio output should always be governed by the system volume, whether it’s adjusted by the volume buttons or a volume slider. This means that control over the application’s audio output remains in users’ hands, where it belongs.
有些时候,应用程序可能需要调节相关的,或是独立的多个响度(volume level)来制造最好的混音输出效果。但是最终输出的音量始终应该是由系统音量管理的,无论是使用音量按钮还是音量滑块。这意味着应用程序音频输出的控制权在用户手里,这也是理所应当的。
耳麦和耳机——用户的期望 Headsets and Headphones—What Users Expect
Users plug in headsets and headphones to hear sounds privately and to free their hands. Users have different expectations for application behavior, depending on whether they’re plugging in or unplugging these accessories.
用户使用耳麦和耳机来获得私人的声音体验,并解放双手。在使用和不使用附件的情况下,用户对于应用程序的行为有不同的期望。
When users plug in a headset or headphones, they intend to continue listening to the current audio, but privately. For this reason, they expect an application that is currently playing audio to continue playing without pause.
当用户插上耳麦和耳机,他们是打算继续听当前的音频,但是是私人的。为此,他们期望应用程序继续播放当前音频,没有停顿。
When users unplug a headset or headphones, they don’t want to automatically share what they’ve been listening to with others. For this reason, they expect an application that is currently playing audio to pause, allowing them to explicitly restart playback when they’re ready.
当用户拔下耳麦和耳机,他们不希望应用程序自动把他们刚才听的与他人分享。为此,他们期望应用程序可以暂停当前正在播放的声音,允许他们在就绪之后再重新开始播放。
无线音频——用户的期望 Wireless Audio—What Users Expect
Users appreciate the convenience of wireless headsets, such as Bluetooth A2DP devices. People use wireless headsets and headphones for the same reasons they use wired headsets and headphones: they want to hear sounds privately and they want to free their hands.
用户很喜欢无线耳麦的便捷之处,比如蓝牙A2DP设备。人们使用无线耳麦和耳机的原因与使用有线的相同:希望获得私人的声音体验,并解放双手。
Users also have very similar expectations for the user experience of wireless headsets:
同样,对无线耳麦的用户体验的期望也很相似。
- When users connect to a wireless audio device, they intend to continue listening to the current audio, but privately. In this situation, they expect the audio to continue playing without pause.
- 当用户连接到无线音频设备,他们是打算继续听当前的音频,但是是私人的。为此,他们期望应用程序继续播放当前音频,没有停顿。
- When users disconnect from a wireless device (or the device goes out of range or turns off), they don’t want to automatically share what they’ve been listening to with others. In this situation, they expect currently playing audio to pause, allowing them to explicitly restart playback when they’re ready.
- 当用户断开与无线设备的连接(或者该设备超出了服务的范围,或者被关闭了),他们不希望应用程序自动把他们刚才听的与他人分享。为此,他们期望应用程序可以暂停当前正在播放的声音,允许他们在就绪之后再重新开始播放。
Even though people don’t physically plug in or unplug a wireless audio device, they still expect to be able to choose a different audio route. To handle this, iPhone OS automatically displays a control that allows users to pick an output audio route. Because choosing a different audio route is a user-initiated action, users expect currently playing audio to continue without pause.
虽然人们不会实际物理上的插上或者拔下无线音频设备,但是他们还是期望可以选择不同的音频路径。为了解决这一点,iPhone OS自动提供允许用户选择输出音频路径的控制界面。由于选择不同的音频路线是用户创建的操作,用户希望当前正在播放的声音继续播放,不要停止。
定义应用程序的声音行为 Defining the Audio Behavior of Your Application
If sound enhances or is essential to the user experience or functionality of your application, you need to decide how your audio should fit in with the audio environment of the device and how it should respond to user actions. For example, you need to decide whether:
如果声音用于加强你应用程序的用户体验或者功能,抑或是,它对于这两方面来说是必不可少的,你就需要考虑你的音频如何与设备的音频环境饱和协调,并用户的操作提供反馈。举例来说,你需要决定这些方面:
- Your audio should continue playing when the device locks or is switched to silent
- 当设备被锁定或者被切换到静音,你的音频是否应该继续播放
- Your audio should mix with other audio that is currently playing (such as a song in iPod)
- 你的音频是否应该和正在播放的其它音频混合(比如iPod里的歌曲)
- Your application needs to handle both audio input and output, either sequentially or simultaneously
- 你的应用程序是否需要兼顾处理音频的输入和输出,不管是按顺序的处理还是同时处理
- Your audio should automatically resume playing after an interruption
- 你的音频是否应该在被中断之后自动恢复播放
To influence how your application’s audio should behave in situations such as these, use Audio Session Services or the AVAudioSession class. These programming interfaces do not produce sound; instead, they help you express how your audio should interact with audio on the device and respond to interruptions and changes in device configuration. Audio Session Services governs sound produced using technologies such as the AV Foundation framework, Audio Queue Services, OpenAL, and the I/O audio unit.
关于如何支配你的应用程序的音频应在上诉情况下如何表现,使用音频会话服务(Audio Session Services)或者AVAudioSession 类。这些编程接口并不创建声音;而是帮助你表现你的音频应该如何同设备上的音频相互作用,应该如何对中断和配置选项的改变作出响应。音频会话服务(Audio Session Services)控制由 AV Foundation 框架,Audio Queue Services,OpenAL 和输入输出音频单元等创建的声音。
Note: If your application produces only user-interface sound effects that are incidental to its functionality, you can use System Sound Services. System Sound Services is the iPhone OS technology that produces alerts and user-interface sounds and invokes vibration; it is unsuitable for any other purpose and the sounds it produces are not governed by Audio Session Services. See the SysSound sample project for an example of using this technology.
注:如果你的应用程序只是创建与功能相对应的附属用户界面音效,你可以使用系统声音服务(System Sound Services)。系统声音服务(System Sound Services)是iPhone 操作系统中,用于创建提醒音、用户界面声和振动的技术;它不适合任何其它的用途,并且它创建的声音不受音频会话服务(Audio Session Services)控制。关于使用这项技术的例子,参见示范项目SysSound。
Important: No matter what technology you use to produce audio or how you define its behavior, the phone can always interrupt the currently running application. This is because no application should prevent users from receiving an incoming call.
重要:无论你使用何种程序来创建声音,或是你怎样定义声音的行为,来电能在任何时候打断当前运行的应用程序。这是因为任何应用程序都不应该阻止用户接听来电。
The audio session is an intermediary for audio between your application and the system. From a user-experience perspective, the most important facet of the audio session is the category that defines the audio behavior of your application.
音频会话是应用程序和系统之间的音频中介。站在用户体验的角度上来看,音频会话最重要是定义了应用程序音频行为的类别。
To provide a great audio user experience, select the category that best describes the audio in your application. Be sure to make your choice based on the semantic meaning of a category, not its precise set of behaviors. This ensures that your application behaves according to users’ expectations. In addition, it gives your application the best chance of working properly if the exact set of behaviors is refined in the future.
为了提供极好的音频用户体验,您需选择对你应用程序音频的最佳诠释的类别。请确保您的选择是基于类别的语义,而不是基于其明确的行为集合。这保证了你的应用程序的行为符合用户的期望。此外,即使以后对确切的行为集合进行了再优化,它可让你的应用程序依然正常工作。
In rare cases, you might need to enhance or refine a category’s standard behavior by adding a property to the audio session. For example, you can add the kAudioSessionProperty_OtherMixableAudioShouldDuck property to make sure your application’s audio is louder than all other audio (except phone audio). You might do this if it’s important for the user to hear the audio from your application while other audio is playing. However, you should be aware that a category’s standard behavior represents what most users expect, so you should consider carefully before you add a property to refine that behavior. To learn more about audio session properties, see “Fine-Tuning the Category” in Audio Session Programming Guide.
在极少数情况下,你可能需要通过给音频会话添加一个属性来加强或改进某个类别的标准行为。例如,你可以添加 kAudioSessionProperty_OtherMixableAudioShouldDuck 属性来使你的应用程序的音频比其它音频都大声(来电铃声除外)。如果你认为当用户在播放其他音频时,让其听到你的应用程序的音频是至关重要的,那么你就可以这么做。但是,你必须意识到一个类别的标准行为代表着绝大多数用户的期望,因此在添加属性,改进行为之前必须深思熟虑。参见音频会话编程向导的“微调类别”来了解更多有关音频会话属性的内容。
You can base your category selection on the current audio environment of the device. You might want to do this if, for example, users can use your application while listening to other audio instead of the soundtrack you provide. If this makes sense for your application, be sure to avoid forcing users to stop listening to their music or make an explicit soundtrack choice when your application starts. See Scenario 2 in [[#puttingItAllTogether|“Putting it All Together”] to learn how to do this.
你可以基于当前设备的音频环境来选择类别。举例来说,你可能会想让用户在使用你的应用程序时,可听取其他音频,不一定非得是你应用程序提供的。如果对于你的应用程序来说这是合理的,那就一定要在启动你的应用程序之时,避免强迫用户停止听音乐,或者是让他们选择明确的音轨。参见“整合”中的情景二来学习应该怎么做。
It’s also possible to change categories while your application is running, although this is seldom necessary. The primary reason for doing this is when an application needs to support recording and playback at different times. In such an application, it can be better to switch between the Record category and the Playback category as needed, than to choose the Play and Record category. This is because choosing the Record category ensures that no alerts (such as an incoming text message alert) will sound while the recording is in progress. 当应用程序运行时,改变类别也是可能的,尽管很少必需这么做。这么做的首要原因是某些应用程序需要支持在不同的时间录音和回放。对于这样的应用程序,让其根据需要在录音(Record)与回放(Playback)类别之间进行切换,要比直接选择录音(Record)与回放(Playback)类别类别更好。这是因为选择录音(Record)类别能够保证在录音时,设备将屏蔽提醒音(比如短信到达提醒音)。
Table 4-1 lists the audio session categories you can use. iPhone OS assigns the Solo Ambient category to an audio session by default.
表4-1列出了你可以使用的音频会话类别。iPhone 操作系统将“独占环境”(Solo Ambient)分配为音频会话的默认类别。
Note: In the interest of space, Table 4-1 displays only the last part of each category name. The actual symbol name of each category begins with AVAudioSessionCategory. The actual symbol name of the MixWithOthers property is kAudioSessionProperty_OverrideCategoryMixWithOthers.
注:为了节省空间,表4-1只显示了每个类别名的最后部分。类别实际的名字由 AVAudioSessionCategory 开头。如MixWithOthers 属性的实际名称是 kAudioSessionProperty_OverrideCategoryMixWithOthers。
| Category 类别 | Meaning 意义 | Silenced by Ring/Silent switch and locking 支持铃声/静音开关与锁定切换至静音 | Mixes with other audio 和其它音频混合 |
|---|---|---|---|
SoloAmbient独占环境 | Sounds enhance application functionality, and should silence other audio 声音用于提高应用程序功能性,并且它在播放时其它声音都转为静音 | Yes 是 | No 否 |
Ambient环境 | Sounds enhance application functionality, but should not silence other audio 声音用于提高应用程序功能性,它在播放时不会使其它声音转为静音 | Yes 是 | Yes 是 |
Playback回放 | Sounds are essential to application functionality, and might mix with other audio 声音对于应用程序功能性至关重要,并且可以与其它音频混合 | No 否 | No (default) 否(默认)
|
Record录音 | Audio is user-recorded 用户录音 | No 否 | No 否 |
PlayAndRecord播放与录音 | Sounds represent audio input and output, sequentially or simultaneously 声音代表着音频的输入和输出,按顺序的(音频的输入和输出)或者是同时的 | No 否 | No (default) 否(默认) Yes (when the MixWithOthers property is added)是(当添加了 MixWithOthers 属性时)
|
AudioProcessing音频处理 | Application performs hardware-assisted audio encoding (it does not play or record) 执行硬件辅助的音频编码(不录也不播音)的应用程序 | - | No 否 |
整合 Putting it All Together
Here are some scenarios that illustrate how to choose the audio session category that provides an audio experience users appreciate.
下面的几个情景阐明了如何选择音频会话类别来提供令用户满意的声音体验。
Scenario 1. Imagine that you’re developing an educational application that helps people learn a new language. You provide feedback sounds that play when users tap specific controls and recordings of words and phrases that play when users want to hear examples of correct pronunciation.
情景1 想象一下你正在开发一个帮助人们学习一门新语言的教育应用程序。当用户敲击特定的控件时,你要提供反馈的声音;当用户想要听正确发音的例子时,你要提供单词和词组的发音。
In this application, sound is essential to the primary functionality. People use this application to hear words and phrases in the language they’re learning, so the sound should play even when the Ring/Silent switch is set to silent or the device locks. Because users need to hear the sounds clearly, they expect other audio they might be playing to be silenced.
对于此应用程序里,声音对其的首要功能性是至关重要的。人们使用这个应用程序来听他们要学习的语言里的单词和词组发音,因此,就算设备被设置为静音或者锁定,应用程序的声音仍然应该播放。由于用户需要清楚地听到声音,他们可能期望正在播放的其它音频转为静音。
To produce the audio experience users expect for this application, you would use the Playback category. Although this category can be refined to allow mixing with other audio (as described in Table 4-1), this application should use the default behavior to ensure that other audio does not compete with the educational content the user has explicitly chosen to hear.
为了提供用户对这种应用程序所期望的声音体验,你要使用“回放”(Playback)类别。虽然这个类别可以重新定义来允许和其它音频混合(如表4-1所述),该应用程序必须使用其默认行为,确保其它音频不会和用户选择收听的学习内容冲突。
Scenario 2. Imagine that you’re developing a game that allows users to guide an on screen character through many different tasks. You provide various gameplay sound effects and a musical soundtrack.
情景2 想象一下你正在开发一个游戏, 游戏里用户需要指引屏幕上的人物完成许多不同的任务。你提供各种游戏音效和一段音乐音轨。
In this application, sound greatly enhances the user experience, but is not essential to the main task. Also, users are likely to appreciate being able to play the game silently or while listening to songs in their music library instead of to the game soundtrack.
在这个应用程序里,声音能极大地增强了用户体验,但是对于首要任务来说并不是必需的。而且,用户可能喜欢在没有声音的状态下玩游戏,或者在玩游戏的同时听他们自己曲库里的音乐。
The best strategy is to find out if users are listening to other audio when your application starts. Don’t ask users to choose whether they want to listen to other audio or listen to your soundtrack. Instead, use the Audio Session Services function AudioSessionGetProperty to query the state of the kAudioSessionProperty_OtherAudioIsPlaying property. Based on the answer to this query, you can choose either the Ambient or Solo Ambient categories (both categories allow users to play the game silently):
最佳策略是在你的应用程序启动的时候查明用户是否在收听其它的音频。不要让用户来选择是收听其它的音频还是你游戏的音轨。相反地,使用音频会话服务功能 AudioSessionGetProperty 来查询 kAudioSessionProperty_OtherAudioIsPlaying 属性的状态。根据查询的结果,你可以选择“环境”(Ambient)或者“独占环境”(Solo Ambient)类别(两种类别都允许用户在无声状态下玩游戏)。
- If users are listening to other audio, you should assume that they’d like to continue listening and would not appreciate being forced to listen to the game soundtrack instead. In this situation, you would choose the Ambient category.
- 如果用户正在听其它音频,你应该假设他们想继续听正在听的音频,而不希望被迫去听游戏的音轨。在这种情况下,应该选择“环境”(Ambient)类别。
- If users are not listening to any other audio when your application starts, choose the Solo Ambient category.
- 如果当你的应用程序启动的时候,用户没有在听任何其它音频,选择“独占环境”(Solo Ambient)类别。
Scenario 3. Imagine that you’re developing an application that provides precise, real-time navigation instructions to the user’s chosen destination. You provide spoken directions for every step of the journey and a few feedback sounds. In addition, you think people would appreciate being able to listen to their own audio while they use your application.
情景3 想象一下你正在开发一个为用户前往目的地提供精确的,实时的导航指引的应用程序。针对行程的每一步提供语音指示,还有一些反馈的声音。此外,你认为人们希望在使用你的应用程序仍然可以听取听取其他音频。
In this application, the spoken navigation instructions represent the primary task. For this reason, you would use the Playback category, which allows your audio to play when the device is locked or the Ring/Silent switch is set to silent.
在这个应用程序里,语音的导航指引属于主要任务。为此,你要使用“回放”(Playback)类别,允许音频在设备被锁定或者静音的时候也能播放。
To allow people to listen to other audio while they use your application, you can add the kAudioSessionProperty_OverrideCategoryMixWithOthers property. However, you also want to make sure that users can hear the spoken instructions above the audio they’re currently playing. To do this, you can apply the kAudioSessionProperty_OtherMixableAudioShouldDuck property to the audio session. This ensures that your audio is louder than all currently playing audio (except phone audio).
你可以添加 kAudioSessionProperty_OverrideCategoryMixWithOthers 属性,来允许人们在使用你的应用程序时可以听其它的音频。但是,你也想要保证语音指引在其他播放的音频至上,这利于用户收听。你可以把 kAudioSessionProperty_OtherMixableAudioShouldDuck 属性运用到音频会话上。这保证你的音频会比其它所有正在播放的音频大声(除了来电铃声)。
Scenario 4. Imagine that you’re developing a blogging application that allows users to upload their text and graphics to a central website. You might have a short startup sound file, various short sound effects that accompany user actions (such as a sound that plays when a post has been uploaded), and an alert sound that plays when a posting fails.
情景4 想象一下你正在开发一个允许用户向中心网站上传文本和图形的博客应用程序。你的应用程序可能会包含一个短暂的启动声音,多种不同的短暂的用于附和用户操作的声音效果(比如说文件上传完毕时播放的声音),和一个表示博客发布失败的提醒声音。
In this application, sound enhances the user experience, but it is incidental. The main task has nothing to do with audio and users do not need to hear any sounds to successfully use the application. In this scenario, you would use System Sound Services to produce sound. This is because the audio context of all sound in the application conforms to the intended purpose of this technology, which is to produce user interface sound effects and alert sounds that obey device locking and the Ring/Silent switch as users expect.
在这个应用程序里,声音增强了用户体验,但这是非主要的。主要任务与声音无关,且用户并不需要听到任何声音就可成功地操作。在这个情景里,你要使用“系统声音服务”(System Sound Service)来制造声音。这是因为这个应用程序里的所有声音都符合这项技术的预期目的:生成符合用户期望的用户界面声音效果和提醒声音,且在设备被锁定和静音状态下,保持静音。