Voice processing for common iPhone man-machine interface tasks (3)

Source: Internet
Author: User

IPhoneCommon man-machine interface task processing methods are described in this article. If you have experience using desktop or portable computer applications, you will find thatIPhoneApplications process many common tasks in different ways.

This section describes these common tasks from the perspective of human-machine interfaces. For more information about code implementation, see the iPhone application programming guide. Continue to the previous section on how to handle common tasks of the iPhone man-machine interface 2.

Use sound

User expectationIPhoneOS device has a wonderfulSound, Regardless of the operating system'sSoundSuch as ringtones and alerts), or applicationsSoundFor example, media playback and EnvironmentSoundAnd music ). In addition, the user also wants the device to sendSoundAbility to follow their preferences and goals.

The user decides the volume of the sound and whether they want to hear the sound. However, sometimes, even if the current settings indicate that users prefer to mute, they still want to hear some sound. For example, users always expect to hear the alerts they set. In essence, users want to hear what they expect, rather than what they don't expect.

To help you meet such requirements,IPhoneThe OS provides some programming interfaces that you can use:

Describes how the sound of your application should be consistent with other sounds on the device.

Ensure that the application sound can be played as expected.

When you decide how to handleSoundPreviously, you need to understand how users expect applications and devices to operate when adjusting device controls and using external devices such as headphones and headsets.

Ringing/mute switching-user expectations

If users want to do the following, they can use the "ring/mute" switch to mute their devices:

Avoid unexpected sound interruptions, such as phone calls and letter prompts.

Avoid the sound that comes with user operations, such as the keyboard or other feedback, accidental sound, or application startup sound.

Avoid hearing the sounds of the game, including the accompanying sounds and music, which are not necessary to use the game program.

For example, in a theater, users change their devices to mute to avoid disturbing others in the theater. In this case, users still want to use applications on their devices, but they do not want to be scared by unwanted or unspecified sounds, such as ringtones or new message prompts.

However,SoundUser action, the "ring/mute" switch will not eliminate the sound they produce. For example:

In a media application, media playback is not switched to mute by "ringing/muting", because media playback is explicitly requested by the user.

The alarm of the clock application is not switched to mute by "ringing/muting", because the alarm is explicitly set by the user.

The audio material in the language learning program will not be switched to mute by "ringing/muting", because the user wants to hear it by taking explicit actions.

The sessions in the voice chat program will not be switched to mute by "ringing/muting", because the only purpose of the user to start such applications is to conduct voice chat.

This behavior follows the principle of user control, because it is determined by the user rather than the device) to hear the user's explicit request.SoundIs it appropriate.

Volume button-user expectation

The user uses the volume button of the device to adjust the volume of all sounds played by the device, including songs, app sounds and device sounds. This means that you can use the volume button to turn off any sound at any time, regardless of the current status of the "ringtone/mute" switch.

In some cases, the application is suitable for providing the volume setting function on its interface. For example, YouTube displays a volume slider that allows you to adjust the volume of the video being watched. Although YouTube is running, you can use this slider and volume button to adjust the video volume. This is because when the application is running, the slider acts as the volume button Proxy: the slider simultaneously acts on the application's volume and the volume of the entire system's volume ringtones ).

If you need to display the volume slider when you use

 
 
  1. MPVolumeView 

You must use the slide provided by the system. Note that if the currently activatedAudioThe output device does not support volume control, such as A2DP devices), and the volume slide will be replaced by the corresponding device name.

Use the volume button to adjust the currently playedAudioThe system will also adjust the volume of the entire system.Sound). NoAudioUse the volume button to adjust the volume of the ringtone .)

This behavior follows the principle of user control, because the user can decide at any time the device sendsSoundHow big it should be.

Sometimes, applications may need to adjust the relative and absolute volume levels in orderAudioThe output produces the best mix. However, the finalAudioThe output volume should always be controlled by the system volume, whether it is adjusted by the volume button or the volume slider. This means thatAudioThe output control is still in the hands of the users it belongs.

Headphones and headsets-user expectations

Users can insert headphones and headsets to enjoy a private voice experience and free their hands. When attachments are used and not used, the user has different expectations for the behavior of the application.

When users insert headphones and headsets, they intend to continue to listen to the currentSoundTo private listening. Therefore, they want to play the video.AudioThe application continues playing thisAudio.

When you unplug the headset and headset, they do not want to automatically share the content they are listening. Therefore, they want the application that is currently playing the audio to pause the playing, so that they can prepare it and start playing again explicitly.

Wireless Audio-user expectations

Users like wireless headsets very much, such as Bluetooth A2DP devices. People use wireless headsets and headsets for the same reason as wired headsets and headsets: they want to hear their voice in private and free their hands.

Users have similar expectations for the user experience of wireless headsets:

When a user connects to a wireless audio device, they intend to continue to hear the current sound, but to switch to private listening. In this case, they want the audio to continue playing.

When a user disconnects a wireless device or when the device is out of scope or off), they do not want to automatically share the content they are listening. In this case, they want to pause the audio being played and have them prepare it and start playing again explicitly.

Even if users do not actually insert or unplug wireless audio devices, they still want to be able to select a different audio channel. To solve this problem, the iPhone OS automatically displays a control that allows you to select the audio output route. Because different audio channels are the action initiated by the user, the user wishes to continue playing the audio being played.

Define the audio behavior of an application

If sound can enhance user experience or application functions, or is an essential part of user experience or application functions, you need to determine how your audio should be consistent with the device's audio environment, and how to respond to user actions. For example, you need to decide:

When the device is locked or switched to mute, whether or not your audio should continue playing.

Whether your audio should be mixed with other audio that is currently playing, such as a song in the iPod ).

Whether your application needs to process audio input and output in sequence or in parallel.

Whether or not your audio should be automatically resumed after interruption.

Use the "audio session service" or AVAudioSession class to control how the audio of an application is displayed in these cases. These programming interfaces do not produce sound; they help you describe how your audio should interact with the audio on the device, and how to respond to interruptions and changes in device configurations. Audio Session Service Management uses the basic AV framework, audio queue service, OpenAL and I/O audio units, and other technologies to produce sound.

NOTE: If your application only needs to generate user interface sound effects attached to the function, you can use "system sound service ". The system sound service is an iPhone OS technology used to generate audible alarms, user interface sound effects, and vibrations. It is not applicable for any other purpose and the sound produced by it is not managed by the "audio session service. For an example of using this technology, see the SysSound sample project.

Important: No matter what technology you use to produce audio, no matter how you define its behavior, the phone can interrupt the currently running application at any time. This is because no application should prevent users from answering incoming calls.

An audio session is an audio mediation between your application and the system. From the perspective of user experience, the most important aspect of audio sessions is to define the category of audio behavior of applications.

To provide a sound audio user experience, you should select the audio category that best describes the application. You must make choices based on the category semantics, rather than the exact set of behaviors. This ensures that your application runs as expected. In addition, if such behavior sets are revised in the future, it can also ensure that your application works properly to the maximum extent possible.

In rare cases, you may need to enhance or improve the standard behavior of a category by adding attributes to the audio session. For example, you can add

 
 
  1. kAudioSessionProperty_OtherMixableAudioShouldDuck 

Properties to ensure that the audio of your application is louder than that of all other audio phones. If it is important for users to hear the audio of your application while playing other audios, you can do so. However, you should note that the standard behavior of a category represents the expectations of most users, so you should carefully consider before adding attributes to improve this behavior. For more information about audio session attributes, see the fine-tuning category section in the audio session programming guide.

You canAudioSelect your category for the environment. For example, if you can listen to otherAudioYou may want to use your app at the same time. If this works for your application, do not force users to stop listening to their music, or force users to make clear music choices when your application starts. To learn how to do this, refer to scenario 2 in "summary.

When the application is running, you can also changeAudioSession category, though seldom necessary. The main reason for this is that the application needs to support recording and playing at different times. In such an application, it is better to switch between the Record category and Playback category as needed, rather than the Play and Record categories. This is because the selection of the Record category will cause a warning such as a letter warning) when the recording is in progress, noSound.

Table 4-1 lists the availableAudioSession type.IPhoneThe default OS isAudioSolo Ambient category is assigned to sessions.

Note: Due to limited space, Table 4-1 only displays the last part of each category name. The actual Symbol names of each category are

 
 
  1. AVAudioSessionCategory 

Start. For example,

 
 
  1. MixWithOthers 

The actual symbol name of the attribute is

 
 
  1. kAudioSessionProperty_OverrideCategoryMixWithOthers 

Table 4-1 can be used to defineSoundBehaviorAudioClick to enlarge the session category)

Summary:IPhoneHuman-Machine Interface common task processing method 3) the content is introduced, I hope this article will help you! For more information, see the following articles:

Troubleshooting of iPhone man-machine interface Common Tasks 1)

IPhone human-machine interface common task handling method 2)

IPhone man-machine interface common task handling method 4)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.