iOS-HIG 用戶交互-音頻

Audio

Whether sound is a primary aspect of your app’s experience or an embellishment, you need to know how people expect sound to behave and meet those expectations.

無(wú)論聲音是否是你app的主要體驗(yàn)方面或只是一個(gè)裝飾准谚,你都需要知道用戶怎么期望聲音的表現(xiàn)并滿足這些期望螟左。

Users manipulate sound through the volume buttons, silence switch, headphone controls, and the onscreen volume slider. Many third-party accessories include sound controls too. Audio can be output through internal or external speakers, headphones, and even wirelessly through an AirPlay-enabled or Bluetooth device.

用戶通過(guò)音量按鈕蜈项、靜音轉(zhuǎn)化、耳機(jī)控制蛤高、屏幕上的音量滑塊來(lái)操作聲音。許多第三方的輔助程序也包含音量控制。音頻可以被內(nèi)置或外置的揚(yáng)聲器钓株、耳機(jī)、甚至無(wú)線的支持AirPlay或藍(lán)牙的設(shè)備輸出陌僵。

Silence.People switch their device to silent to avoid being interrupted by unexpected sounds, such as ringtones and incoming message sounds. They also want nonessential sounds disabled, including keyboard sounds, sound effects, game soundtracks, and other audible feedback. When the device is set to silent, only explicitly initiated sounds should occur, such as audio during media playback, alarms, and audio/video messaging.

靜音轴合。用戶轉(zhuǎn)換他們的設(shè)備到靜音狀態(tài)以避免被不期望的聲音打擾,例如鈴聲和消息提示聲碗短。他們也需要禁用那些不重要的聲音受葛,包括鍵盤聲、聲音效果偎谁、游戲原聲总滩、或者其他聲音反饋。當(dāng)設(shè)備設(shè)置為靜音巡雨,只有明確設(shè)置的聲音的能被聽(tīng)到闰渔,例如電影播放聲音、鬧鐘和語(yǔ)音視頻信息铐望。

Volume.Whether using physical device buttons or an onscreen slider, people expect changes in volume to affect all sound systemwide, including music and in-app sound effects. The only exception is the ringer volume, which is always adjusted separately when audio isn’t actively playing.

音量冈涧。無(wú)論是使用物理設(shè)備按鈕還是屏幕滑塊向挖,用戶希望改變的音量是系統(tǒng)范圍的所有聲音,包括音樂(lè)和app聲音效果炕舵。唯一例外是鈴聲音量何之,被單獨(dú)調(diào)整。

Headphones.People use headphones to hear sound privately and to free their hands. When plugging in headphones, users expect sound to reroute automatically without interruption. When unplugging headphones, they expect playback to pause immediately.

耳機(jī)咽筋。用戶使用耳機(jī)來(lái)獨(dú)自聽(tīng)聲音同時(shí)釋放他們的雙手溶推。當(dāng)插入耳機(jī)時(shí),用戶期望在不打斷的情況下聲音自動(dòng)改道奸攻。當(dāng)拔出耳機(jī)時(shí)蒜危,他們希望播放馬上停止播放。

Adjust levels automatically when necessary, but not the overall volume.Your app can adjust relative, independent volume levels to achieve a great mix of audio. However, the final output should always be governed by the system volume.

必要時(shí)自動(dòng)調(diào)整等級(jí)睹耐,但不是所有音量辐赞。你的app可以做相對(duì)調(diào)整,獨(dú)立的音量等級(jí)來(lái)獲得最棒的混音效果硝训。然而响委,最終輸出需要被系統(tǒng)音量管理。

Permit rerouting of audio when appropriate.People often want to select a different audio output device. For example, they may want to listen to music through their living room stereo, car radio, or Apple TV. Support this capability unless there’s a compelling reason not to.

合適時(shí)允許音頻改道窖梁。用戶經(jīng)常想選擇一個(gè)不同的音頻輸出設(shè)備赘风。例如,他們想在他們的家庭影院,車載音響, or Apple TV聽(tīng)歌纵刘。支持這個(gè)特性除非有特別強(qiáng)烈的理由不這么做邀窃。

Use the system-provided volume view to allow audio adjustments.The best way to provide interface controls for adjusting audio is to use a volume view. This view is customizable, includes a volume-level slider, and even includes a control for rerouting audio output. For developer guidance, seeMPVolumeView.

使用系統(tǒng)提供的音量視圖來(lái)做語(yǔ)音調(diào)整。提供調(diào)整音頻控制的最好界面是使用音量視圖假哎。這個(gè)視圖是可定制的瞬捕,包括音量等級(jí)滑塊,甚至包括音頻輸出改道控制舵抹。對(duì)于開發(fā)者指導(dǎo), seeMPVolumeView.

Use the system’s sound services for short sounds and vibrations.For developer guidance, seeSystem Sound Services.

對(duì)于短音效和震動(dòng)使用系統(tǒng)提供的聲音服務(wù)肪虎。對(duì)于開發(fā)者指導(dǎo),seeSystem Sound Services.

Categorize your audio if sound is essential to your app.Different audio categories allow sounds to be silenced by the silence switch, to mix with other audio, or to play while your app is in the background. Pick a category based on its meaning and the current audio state of the device, and assign it to your audio sessions. For example, don’t make people stop listening to music from another app if you don’t need to. In general, it’s best to avoid changing the category while your app is running, with the exception of apps that record and playback audio at different times. For developer guidance, seeAudio Session Programming Guide.

如果聲音對(duì)于你的app是必要的,分類你的音頻掏父。不同的音頻分類允許聲音被靜音用靜音按鈕笋轨,混合其他音頻,或者當(dāng)你的app隱藏在后臺(tái)時(shí)仍然播放赊淑【粽基于它的意義和當(dāng)前音頻狀態(tài)選擇一個(gè)分類,然后把它分配到你的音頻會(huì)話中陶缺。例如钾挟,如果你不想要讓用戶從其他app停止聽(tīng)音樂(lè)”グ叮基本上掺出,當(dāng)你app在運(yùn)行時(shí)最好避免改變分類徽千,除了那些錄音和播放音頻在不同時(shí)間的app。For developer guidance, seeAudio Session Programming Guide.

Resume audio playback when appropriate after an interruption occurs.Sometimes, currently playing audio is interrupted by audio from a different app. Temporary interruptions such as incoming phone calls are considered resumable. Permanent interruptions, such as a music playlist initiated by Siri, are considered nonresumable. When a resumable interruption occurs, your app should resume playback when the interruption ends if audio was actively playing when the interruption started. For example, a game playing a soundtrack and a media app in the process of playing audio should both resume.

在一個(gè)打斷之后汤锨,當(dāng)合適時(shí)繼續(xù)重放音頻双抽。有時(shí)候,現(xiàn)在播放的音頻被另一個(gè)app的音頻打斷闲礼。臨時(shí)打斷例如來(lái)電可以被認(rèn)為是可重啟的牍汹。永久打斷,例如一個(gè)被Siri啟動(dòng)的音樂(lè)播放列表柬泽,被認(rèn)為不可重啟的慎菲。一個(gè)可重啟的打斷發(fā)生,當(dāng)打斷開始的時(shí)候如果該音頻正在播放锨并,當(dāng)打斷結(jié)束后你的app應(yīng)該重新播放該音頻露该。

Let other apps know when your app finishes playing temporary audio.If your app might temporarily interrupt the audio of other apps, it should flag audio sessions appropriately so other apps get notified when it’s safe to resume. For developer guidance, see theAVAudioSessionSetActiveOptionNotifyOthersOnDeactivationconstant inAVFoundation.

當(dāng)你的app完成播放臨時(shí)音頻時(shí)讓其他app知道。如果你的app會(huì)臨時(shí)打斷其他app的音頻第煮,它應(yīng)該標(biāo)記相應(yīng)的音頻會(huì)話解幼,這樣當(dāng)可以重新播放時(shí)其他app會(huì)得到通知。For developer guidance, see theAVAudioSessionSetActiveOptionNotifyOthersOnDeactivationconstant inAVFoundation.

Respond to audio controls only when it makes sense.People can control audio playback from outside of your app’s interface, such as in Control Center or with controls on their headphones, regardless of whether your app is in the foreground or background. If your app is actively playing audio, in a clear audio-related context, or connected to an AirPlay-enabeld device, it’s fine to respond to audio controls. Otherwise, your app shouldn't halt another app’s audio that may be playing when a control is activated.

當(dāng)有意義時(shí)相應(yīng)音頻控制空盼。用戶在你的app界面之外控制音頻播放书幕,例如在控制中心或者他們的耳機(jī)新荤,不過(guò)你的app在后臺(tái)還是前臺(tái)揽趾。如果你的app正在播放音頻,在一個(gè)明確的音頻相關(guān)環(huán)境苛骨,或者連接到一個(gè)支持AirPlay的設(shè)備篱瞎,響應(yīng)音頻控制是友好的。否則痒芝,當(dāng)一個(gè)控制被激活時(shí)你app不應(yīng)該停止其他app正在播放的音頻俐筋。

Don’t repurpose audio controls.People expect audio controls to behave consistently in all apps. Never redefine the meaning of an audio control. If your app doesn’t support certain controls, then it simply shouldn’t respond to them.

不要改變音頻控制的意圖。用戶期望音頻控制在app中保持一致性严衬。永遠(yuǎn)不要重新定義音頻控制澄者。如果你的app不支持相應(yīng)控制,只需要不回應(yīng)它們就行请琳。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末粱挡,一起剝皮案震驚了整個(gè)濱河市,隨后出現(xiàn)的幾起案子俄精,更是在濱河造成了極大的恐慌询筏,老刑警劉巖,帶你破解...
    沈念sama閱讀 222,252評(píng)論 6 516
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件竖慧,死亡現(xiàn)場(chǎng)離奇詭異嫌套,居然都是意外死亡逆屡,警方通過(guò)查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 94,886評(píng)論 3 399
  • 文/潘曉璐 我一進(jìn)店門踱讨,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)魏蔗,“玉大人,你說(shuō)我怎么就攤上這事痹筛∧穑” “怎么了?”我有些...
    開封第一講書人閱讀 168,814評(píng)論 0 361
  • 文/不壞的土叔 我叫張陵味混,是天一觀的道長(zhǎng)产雹。 經(jīng)常有香客問(wèn)我,道長(zhǎng)翁锡,這世上最難降的妖魔是什么蔓挖? 我笑而不...
    開封第一講書人閱讀 59,869評(píng)論 1 299
  • 正文 為了忘掉前任,我火速辦了婚禮馆衔,結(jié)果婚禮上瘟判,老公的妹妹穿的比我還像新娘。我一直安慰自己角溃,他們只是感情好拷获,可當(dāng)我...
    茶點(diǎn)故事閱讀 68,888評(píng)論 6 398
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著减细,像睡著了一般匆瓜。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上未蝌,一...
    開封第一講書人閱讀 52,475評(píng)論 1 312
  • 那天驮吱,我揣著相機(jī)與錄音,去河邊找鬼萧吠。 笑死左冬,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的纸型。 我是一名探鬼主播拇砰,決...
    沈念sama閱讀 41,010評(píng)論 3 422
  • 文/蒼蘭香墨 我猛地睜開眼,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼狰腌!你這毒婦竟也來(lái)了除破?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 39,924評(píng)論 0 277
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤癌别,失蹤者是張志新(化名)和其女友劉穎皂岔,沒(méi)想到半個(gè)月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體展姐,經(jīng)...
    沈念sama閱讀 46,469評(píng)論 1 319
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡躁垛,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 38,552評(píng)論 3 342
  • 正文 我和宋清朗相戀三年剖毯,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片教馆。...
    茶點(diǎn)故事閱讀 40,680評(píng)論 1 353
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡逊谋,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出土铺,到底是詐尸還是另有隱情胶滋,我是刑警寧澤,帶...
    沈念sama閱讀 36,362評(píng)論 5 351
  • 正文 年R本政府宣布悲敷,位于F島的核電站究恤,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏后德。R本人自食惡果不足惜部宿,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 42,037評(píng)論 3 335
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望瓢湃。 院中可真熱鬧理张,春花似錦、人聲如沸绵患。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,519評(píng)論 0 25
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)落蝙。三九已至织狐,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間掘殴,已是汗流浹背赚瘦。 一陣腳步聲響...
    開封第一講書人閱讀 33,621評(píng)論 1 274
  • 我被黑心中介騙來(lái)泰國(guó)打工, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留奏寨,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 49,099評(píng)論 3 378
  • 正文 我出身青樓鹰服,卻偏偏與公主長(zhǎng)得像病瞳,于是被迫代替她去往敵國(guó)和親。 傳聞我的和親對(duì)象是個(gè)殘疾皇子悲酷,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 45,691評(píng)論 2 361

推薦閱讀更多精彩內(nèi)容