SOUND EFFECT PLAYBACK METHOD AND APPARATUS
FIELD OF THE TECHNOLOGY
The present disclosure relates to the field of
Internet technologies, and in particular to a sound effect playback method and
apparatus.
BACKGROUND OF THE DISCLOSURE
With development of Internet technologies,
Internet-type applications become increasingly more. In order to attract more
users to use Internet-type applications, a sound effect is often played while
an Internet-type application is used. The played sound effect is an important
reference for a user to judge pros and cons of an Internet-type application,
and therefore, in order to satisfy demands of the user, and increase the number
of users of Internet-type applications, how to play a sound effect becomes a
problem to which persons skilled in the art pay attention.
When a related technology is used to play a sound
effect, in a situation in which a current implementation environment is formed
by superposing multiple materials, if a manner of playing a sound effect
corresponding to one of the materials is used, because the played sound effect
cannot accurately embody the current implementation environment, the sound
effect played by using the related technology is lack of timeliness. However,
if a manner of adding a sound effect corresponding to a new material into a
system resource pack is used, because the added sound effect corresponding to
the new material increases an occupation amount of the system resource pack,
resource consumption is large when the related technology is used to play the
sound effect.
SUMMARY
In view of the above, embodiments of the present
invention provide a sound effect playback method and apparatus. The technical
solutions are as follows:
According to an aspect, provided is a sound effect
playback method, run in a terminal device, the terminal device including a
memory, one or more processors, and program instructions stored in the memory
and executed by the one or more processors, and the method including: obtaining
location information of a current implementation environment, and determining,
according to the location information of the current implementation
environment, each material for forming the current implementation environment
and a proportion occupied by each material; obtaining an initial sound effect
value corresponding to each material for forming the current implementation
environment, and adjusting the initial sound effect value corresponding to each
material according to the proportion occupied by each material, to obtain an
adjusted sound effect value of each material; and combining adjusted sound
effect values of all materials, and playing a combined sound effect.
According to another aspect, provided is a sound
effect playback apparatus, the apparatus including:
a memory;
one or more processors; and
one or more program modules, stored in the memory,
and executed by the one or more processors, the one or more program modules
including:
a first obtaining module, configured to obtain
location information of a current implementation environment; a first
determining module, configured to determine, according to the location
information of the current implementation environment, each material for
forming the current implementation environment and a proportion occupied by
each material; a second obtaining module, configured to obtain an initial sound
effect value corresponding to each material for forming the current
implementation environment; an adjusting module, configured to adjust the
initial sound effect value corresponding to each material according to the
proportion occupied by each material, to obtain an adjusted sound effect value
of each material; a combining module, configured to combine adjusted sound
effect values of all materials; and a playback module, configured to play a
combined sound effect.
According to another aspect, provided is a
non-transitory computer readable storage medium having stored therein one or
more instructions, which, when executed by a terminal device, cause the
terminal device to: obtain location information of a current implementation
environment, and determine, according to the location information of the
current implementation environment, each material for forming the current
implementation environment and a proportion occupied by each material; obtain
an initial sound effect value corresponding to each material for forming the
current implementation environment, and adjust the initial sound effect value
corresponding to each material according to the proportion occupied by each
material, to obtain an adjusted sound effect value of each material; and
combine adjusted sound effect values of all materials, and play a combined
sound effect.
Each material for forming a current implementation
environment and a proportion occupied by each material are determined according
to location information of the current implementation environment, and an
initial sound effect value corresponding to each material for forming the
current implementation environment is obtained; then the initial sound effect
value corresponding to each material according to the proportion occupied by
each material is adjusted, and adjusted sound effect values of all materials
are combined and then a combined sound effect is played, so that the current
implementation environment can be accurately embodied without the need of
adding a system resource pack, and therefore the played sound effect is more
timely.
BRIEF DESCRIPTION OF THE DRAWINGS
To describe the technical solutions of the
embodiments of the present invention more clearly, the accompanying drawings
for illustrating the embodiments will be introduced briefly in the following.
Apparently, the drawings in the following description are only some embodiments
of the present invention, and a person of ordinary skill in the art may obtain
other drawings based on these accompanying drawings without creative
efforts.
FIG. 1 is a flowchart of a sound effect playback
method according to an embodiment of the present invention;
FIG. 2 is a flowchart of a sound effect playback
method according to another embodiment of the present invention;
FIG. 3 is a schematic diagram of a preset
implementation environment according to another embodiment of the present
invention;
FIG. 4 is a schematic structural diagram of a sound
effect playback apparatus according to another embodiment of the present
invention;
FIG. 5 is a schematic structural diagram of a first
determining module according to another embodiment of the present
invention;
FIG. 6 is a schematic structural diagram of a sound
effect playback apparatus according to another embodiment of the present
invention;
FIG. 7 is a schematic structural diagram of another
sound effect playback apparatus according to another embodiment of the present
invention;
FIG. 8 is a schematic structural diagram of an
adjusting module according to another embodiment of the present invention;
and
FIG. 9 is a schematic structural diagram of a
terminal device according to another embodiment of the present invention.
DESCRIPTION OF EMBODIMENTS
Currently, when a related technology is used to play
a sound effect, the following manner is used: first, a material of a current
implementation environment is determined, where each material of the
implementation environment is corresponding to a sound effect; then, a
corresponding sound effect is played according to the material of the current
implementation environment. Specifically, if the material of the current
implementation environment is soil, a sound effect corresponding to the soil is
played according to the current implementation environment; if the material of
the current implementation environment is grassland, a sound effect
corresponding to the grassland is played according to the current
implementation environment. Moreover, in a situation in which the current
implementation environment is formed by superposing multiple materials, such as
formed by superposing grassland and soil, a related technology is used to play
a sound effect corresponding to one of the materials, or a sound effect
corresponding to a new material is added into a system resource pack, and then
the sound effect corresponding to the original material and the added sound
effect corresponding to the new material are played.
To make the objectives, technical solutions, and
advantages of the present disclosure more comprehensible, the following further
describes the embodiments of the present invention in detail with reference to
the accompanying drawings.
With development of Internet technologies, both types
and the quantity of Internet-type applications become increasingly more. In
order to satisfy abundant demands of users for played sound effects, an
embodiment of the present invention provides a sound effect playback method.
Referring to FIG. 1, the process of the method provided in this embodiment
includes:
101: Obtain location information of a current
implementation environment, and determine, according to the location
information of the current implementation environment, each material for
forming the current implementation environment and a proportion occupied by
each material.
102: Obtain an initial sound effect value
corresponding to each material for forming the current implementation
environment, and adjust the initial sound effect value corresponding to each
material according to the proportion occupied by each material, to obtain an
adjusted sound effect value of each material.
103: Combine adjusted sound effect values of all
materials, and play a combined sound effect. Combining herein may also be
understood as mixing, that is, various demodulated voices are superposed
together and played, and a total sum of volumes is controlled to be at a peak
value.
As an optional embodiment, the determining, according
to the location information of the current implementation environment, each
material for forming the current implementation environment and a proportion
occupied by each material includes:
determining location units in a preset implementation
environment corresponding to the current implementation environment according
to the location information of the current implementation environment, any
location unit in the preset implementation environment having material data
formed by each material in the any location unit and a proportion occupied by
each material; and
extracting the material data had by the location unit
corresponding to the current implementation environment, and determining,
according to the extracted material data, each material for forming the current
implementation environment and the proportion occupied by each material.
As an optional embodiment, before the extracting the
material data had by the location unit corresponding to the current
implementation environment, the method further includes:
obtaining different materials, and combining the
different materials according to different proportions to obtain a preset
implementation environment;
dividing the preset implementation environment into
different location units, and setting location information for each location
unit, each location unit being corresponding to at least one material;
determining a proportion occupied by each material
corresponding to each location unit, and forming material data by each material
corresponding to each location unit and the proportion occupied by each
material, to obtain the material data of each location unit; and
storing the material data and the location
information of each location unit of the preset implementation environment.
The determining location units in a preset
implementation environment corresponding to the current implementation
environment according to the location information of the current implementation
environment includes:
searching for location information matching the
location information of the current implementation environment among stored
location information of location units of the preset implementation
environment, and using a location unit corresponding to the found location
information as a location unit in the preset implementation environment
corresponding to the current implementation environment.
As an optional embodiment, before the obtaining an
initial sound effect value corresponding to each material for forming the
current implementation environment, the method further includes:
setting an initial sound effect value for each
material, and storing the initial sound effect value of each material.
The obtaining an initial sound effect value
corresponding to each material for forming the current implementation
environment includes:
searching for the initial sound effect value
corresponding to each material for forming the current implementation
environment among stored initial sound effect values of all material.
As an optional embodiment, the adjusting the initial
sound effect value corresponding to each material according to the proportion
occupied by each material includes:
determining, according to the proportion occupied by
each material, a volume for playing each material; and
adjusting the initial sound effect value
corresponding to each material according to the determined volume for playing
each material.
This embodiment of the present invention provides a
sound effect playback method, and the method is applied to a network
application having an implementation environment. The implementation
environment is information about a terrestrial material in a current scenario
in the network application. If the current scenario in the network application
is soil, the current implementation environment is soil; if the current
scenario of the network application is a land of aquatic weed, the current
implementation environment is aquatic weed, and the current implementation
environment is not specifically limited in any one of the embodiments of the
present invention. For convenience of understanding, the sound effect playback
method provided in the embodiment of the present invention is explained and
described in detail currently with reference to the content of the foregoing
embodiment. Referring to FIG. 2, the process of the method provided in this
embodiment includes:
201: Obtain location information of a current
implementation environment.
The implementation environment includes but is not
limited to a terrestrial material and the like, and the implementation
environment is not specifically limited in this embodiment. The location
information of the current implementation environment includes but is not
limited to coordinate information of the current implementation environment and
the like, and the coordinate information of the current implementation
environment is not specifically limited in this embodiment. In order that the
sound effect can be played according to the current implementation environment,
and meanwhile the played sound effect is more timely, when the method provided
in this embodiment is used to play the sound effect, the location information
of the current implementation environment needs to be obtained first.
The manner of obtaining the location information of
the current implementation environment is not specifically limited in this
implementation. During specific implementation, the following manner may be
used: an execution body in a current implementation environment in an
application program is first determined, then information about a location at
which the execution body in the current implementation environment in the
application program is located is obtained, and the obtained information about
the location at which the execution body in the current implementation
environment in the application program is located is used as the obtained
location information of the current implementation environment. For example, if
the current implementation environment in the application program is grassland,
and the execution body in the current implementation environment in the
application program is a person carrying a knapsack on the back, information
about a location of the person carrying the knapsack on the back on the
grassland in the application program may be used as the location information of
the current implementation environment.
202: Determine each material for forming the current
implementation environment and a proportion occupied by each material according
to the location information of the current implementation environment.
Implementation environments required in different
application scenarios in an application program are different, and
implementation environments obtained according to different materials are also
different, and therefore, in order to satisfy demands of different scenarios,
in the method provided in this embodiment, before a sound effect is played, a
preset implementation environment may be configured, and the specific
configuration process includes but is not limited to: obtaining different
materials for forming a preset implementation environment, and combining the
different materials according to different proportions to obtain the preset
implementation environment. For example, that the configured preset
implementation environment is grassland is used as an example, and different
materials for forming the grassland are separately mud, grass and the like, and
therefore the materials such as mud and grass are combined according to
different proportions to obtain the preset implementation environment.
Optionally, the preset implementation environment is
obtained by combining different materials according to different proportions,
proportions occupied by materials on different locations in the implementation
environment are different, and the different proportions occupied by the
materials make sound effects played in subsequent steps different, and
therefore, in order to enable the played sound effect to be more approximate to
the current implementation environment, and meanwhile for convenience of
determining each material for forming the current implementation environment
and a proportion occupied by each material in the subsequent process, in the
method provided in this embodiment, after the preset implementation environment
is obtained, a step of dividing the preset implementation environment into
different location units is further executed. Specifically, the manner of
dividing the preset implementation environment into different location units is
not specifically limited in this embodiment. During specific implementation,
the preset implementation environment may be divided into location units having
a same area, and the preset implementation environment may also be divided into
location units having different areas. However, no matter which manner is used,
in this embodiment, a combining proportion of a material in each location unit
obtained by means of dividing is set to be the same, that is, a proportion
occupied by each material in each location unit is unique. The preset
implementation environment is divided into location units of different
quantities, which may be 8, 9, 16 and the like, and the different quantities of
the location units obtained by dividing the preset implementation environment
are not specifically limited in this embodiment.
After the preset implementation environment is
divided into different location units, in the method provided in this
embodiment, location information is further set for each location unit. The
manner of setting location information for each location unit includes but is
not limited to the following manner:
First step, a coordinate system is established on the
basis of the preset implementation environment, and a corresponding coordinate
of each location unit in the preset implementation environment in the
coordinate system is determined.
Second step, the corresponding coordinate of each
location unit in the coordinate system is used as the location information set
for each location unit.
The proportion occupied by each material
corresponding to each location unit has an important effect on a sound effect
played in a subsequent step, and therefore, for convenience of playing the
sound effect according to the proportion occupied by each material
corresponding to each location unit in the subsequent step, in the method
provided in this embodiment, the proportion occupied by each material
corresponding to each location unit needs to be determined, and each material
and the proportion occupied by each material corresponding to each location
unit are formed into material data, thereby obtaining the material data of each
location unit.
Material data and location information of each
location unit of the preconfigured preset implementation environment continue
to be applied in the subsequent sound effect playback process, and therefore,
in the method provided in this embodiment, a step of storing the material data
and the location information of each location unit of the preset implementation
environment is further executed. The manner of storing the material data and
the location information of each location unit of the preset implementation
environment includes but is not limited to: first, denoting material data and
location information of each material according to the proportion occupied by
each material and the length of the preset implementation environment in a
coordinate system by using a hexadecimal number; secondly, denoting the
material data and the location information of each material denoted by using
the hexadecimal number by using a double-word value; and thirdly, storing the
obtained double-word value in a corresponding storage medium.
For convenience of understanding, the foregoing
process of storing material data and location information of each location unit
of the preset implementation environment is explained and described in detail
below by using a specific example.
For example, the length of the preset implementation
environment in the coordinate system is set to 255. A location unit A in the
preset implementation environment is used as an example. If materials
corresponding to the location unit A in the preset implementation environment
include grass, soil, sand, and water, where a proportion occupied by grass is
10%, a proportion occupied by soil is 50%, a proportion occupied by sand is
35%, a proportion occupied by water is 5%, a specific calculating process of
denoting material data and location information of each material by using a
hexadecimal number is:
grass=0.10*255=25=0*19;
soil=0.50*255=127=0*7F;
sand=0.35*255=89=0*59; and
water=0.05*255=12=0*0C,
where 0* is a denoting method for a hexadecimal
number.
After material data and location information of each
material denoted by using a hexadecimal number are obtained, the material data
and the location information of each material denoted by using a hexadecimal
number may be denoted by using a double-word value 0*197F590C, and the obtained
double-word value is stored in a corresponding storage medium.
In the sound effect playback method provided in this
embodiment, when a sound effect is played, the sound effect is played mainly
according to each material of the current implementation environment and a
proportion occupied by each material, and different location information of the
current implementation environment makes materials of the current
implementation environment and proportions occupied by the materials different,
and therefore, in order that the sound effect can be played according to each
material of the current implementation environment and a proportion occupied by
each material, in the method provided in this embodiment, each material for
forming the current implementation environment and a proportion occupied by
each material need to be determined according to the location information of
the current implementation environment. Specifically, the determining,
according to the location information of the current implementation
environment, each material for forming the current implementation environment
and a proportion occupied by each material includes but is not limited to the
following steps:
First: Determine location units in a preset
implementation environment corresponding to the current implementation
environment according to the location information of the current implementation
environment,
where any location unit in the preset implementation
environment has material data formed by each material in the any location unit
and a proportion occupied by each material; the manner of determining location
units in a preset implementation environment corresponding to the current
implementation environment according to the location information of the current
implementation environment includes but is not limited to:
searching for location information matching the
location information of the current implementation environment among stored
location information of location units of the preset implementation
environment, and using a location unit corresponding to the found location
information as a location unit in the preset implementation environment
corresponding to the current implementation environment.
Second: Extract the material data had by the location
unit corresponding to the current implementation environment, and determine,
according to the extracted material data, each material for forming the current
implementation environment and the proportion occupied by each material.
For convenience of understanding, the foregoing
process is explained and described in detail below by using a specific
example.
FIG. 3 shows a preset implementation environment
obtained by combining several materials such as grass, water, and soil
according to different combining proportions. The preset implementation
environment is divided into 4 location units, which are separately a location
unit 1, a location unit 2, a location unit 3 and a location unit 4. In the
location unit 1, a proportion occupied by grass is 30%, a proportion occupied
by water is 20%, and a proportion occupied by soil is 50%; in the location unit
2, a proportion occupied by grass is 50%, a proportion occupied by water is
40%, and a proportion occupied by soil is 10%; in the location unit 3, a
proportion occupied by grass is 20%, a proportion occupied by water is 30%, and
a proportion occupied by soil is 50%; in the location unit 4, a proportion
occupied by grass is 20%, a proportion occupied by water is 60%, and a
proportion occupied by soil is 20%. A coordinate system is established
according to the preset implementation environment, and location information
corresponding to each location unit may be obtained. If the location
information of the current implementation environment is (4, 12), it can be
determined that the location unit in the preset implementation environment
corresponding to the current implementation environment is the location unit 1,
then material data had by the location unit 1 corresponding to the current
implementation environment is extracted, and it is determined according to the
extracted material data that each material for forming the current
implementation environment and a proportion occupied by each material are: a
proportion occupied by grass is 30%, a proportion occupied by water is 20%, and
a proportion occupied by soil is 50%.
203: Obtain an initial sound effect value
corresponding to each material for forming the current implementation
environment.
The initial sound effect corresponding to each
material includes but is not limited to sound quality of each material and an
initial volume for playing each material. In this embodiment, initial volumes
for playing all materials are set to a same magnitude.
In order that an initial sound effect value
corresponding to each material for forming the current implementation
environment can be obtained, in the method provided in this embodiment, before
the initial sound effect value corresponding to each material for forming the
current implementation environment is obtained, the initial sound effect value
needs to be preset for each material. The manner of presetting the initial
sound effect value for each material is not specifically limited in this
embodiment.
The initial sound effect value preset for each
material continues to be applied in the subsequent sound effect playback
process, and therefore, in the method provided in this embodiment, after the
initial sound effect value is preset for each material, the step of storing the
initial sound effect value of each material is further executed. The manner of
storing the initial sound effect value of each material includes but is not
limited to storing the initial sound effect value of each material in a
corresponding storage medium.
Further, after the initial sound effect value of each
material is stored in the corresponding storage medium, when the initial sound
effect value corresponding to each material for forming the current
implementation environment is obtained, the initial sound effect value
corresponding to each material for forming the current implementation
environment may be searched for among stored initial sound effect values of all
materials.
204: Adjust the initial sound effect value
corresponding to each material according to the proportion occupied by each
material, to obtain an adjusted sound effect value of each material.
The proportion occupied by each material for forming
the current implementation environment is already determined according to the
location information of the current implementation environment in step 202, and
the initial sound effect value corresponding to each material for forming the
current implementation environment is obtained in step 203, and therefore, in
this step, the initial sound effect value corresponding to each material may be
adjusted according to the proportion occupied by each material for forming the
current implementation environment and determined in step 202. Specifically,
the adjusting the initial sound effect value corresponding to each material
according to the proportion occupied by each material includes but is not
limited to the following steps:
First step: Determine, according to the proportion
occupied by each material, a volume for playing each material.
Specifically, after the proportion occupied by each
material is determined, a proportion occupied by the volume for playing each
material in the initial volume of each material may be set to be the same as
the proportion occupied by each material.
For convenience of understanding, the foregoing
process is explained and described in detail below by using a specific
example.
For example, it is determined according to the
location information of the current implementation environment that materials
for forming the current implementation environment are grass, soil, sand and
water, where a proportion occupied by grass in the current implementation
environment is 10%, a proportion occupied by soil in the current implementation
environment is 50%, a proportion occupied by sand in the current implementation
environment is 20%, and a proportion occupied by water in the current
implementation environment is 20%. The determining, according to the proportion
occupied by each material, a volume for playing each material is that: the
volume for playing grass is 10% of the initial volume of grass, the volume for
playing soil is 50% of the initial volume of soil, the volume for playing sand
is 20% of the initial volume of sand, and the volume for playing water is 20%
of the initial volume of water. If the initial volume of grass, soil, sand and
water is 100 decibel, the volume for playing grass is 10 decibel, the volume
for playing soil is 50 decibel, the volume for playing sand is 20 decibel, and
the volume for playing water is 20 decibel.
Second step: Adjust the initial sound effect value
corresponding to each material according to the determined volume for playing
each material.
After the volume for playing each material is
determined, the volume in the initial sound effect value of each material may
be adjusted according to the determined volume for playing each material. By
adjusting the sound effect value corresponding to each material, an adjusted
sound effect value of each material may be obtained.
205: Combine adjusted sound effect values of all
materials, and play a combined sound effect.
In order to make the played sound effect have
timeliness, in the method provided in this embodiment, when the sound effect is
played, adjusted sound effect values of all materials need to be combined, and
then a combined sound effect is played. The combined sound effect includes
adjusted sound effects of all materials, and therefore, the played sound effect
can accurately reflect the current implementation environment, thereby enabling
a user to obtain better audiovisual experience.
Specifically, when adjusted sound effect values of
all materials are combined, that materials for forming the current
implementation environment are: grass, water, and soil is used as an example,
and if initial sound effect values corresponding to grass, water, and soil are
adjusted according to proportions occupied by grass, water, and soil, to obtain
adjusted sound effect values of grass, water, and soil, the adjusted sound
effect values of grass, water, and soil may be combined, to obtain a combined
sound effect. The materials for forming the current implementation environment
include grass, water and soil, and the combined sound effect not only includes
a sound effect of grass, but also includes sound effects of water and soil, and
therefore, the combined sound effect can better embody the current
implementation environment, and is more timely.
Referring to FIG. 4, an embodiment of the present
invention provides a sound effect playback apparatus, including:
a first obtaining module 401, configured to obtain
location information of a current implementation environment;
a first determining module 402, configured to
determine, according to the location information of the current implementation
environment, each material for forming the current implementation environment
and a proportion occupied by each material;
a second obtaining module 403, configured to obtain
an initial sound effect value corresponding to each material for forming the
current implementation environment;
an adjusting module 404, configured to adjust the
initial sound effect value corresponding to each material according to the
proportion occupied by each material, to obtain an adjusted sound effect value
of each material;
a combining module 405, configured to combine
adjusted sound effect values of all materials; and
a playback module 406, configured to play a combined
sound effect.
Referring to FIG. 5, the first determining module
402 includes:
a first determining unit 4021, configured to
determine location units in a preset implementation environment corresponding
to the current implementation environment according to the location information
of the current implementation environment, any location unit in the preset
implementation environment having material data formed by each material in the
any location unit and a proportion occupied by each material;
an extracting unit 4022, configured to extract the
material data had by the location unit corresponding to the current
implementation environment; and
a second determining unit 4023, configured to
determine, according to the extracted material data, each material for forming
the current implementation environment and the proportion occupied by each
material.
Referring to FIG. 6, the apparatus further
includes:
a third obtaining module 407, configured to obtain
different materials, and combine the different materials according to different
proportions to obtain a preset implementation environment;
a dividing module 408, configured to divide the
preset implementation environment into different location units;
a setting module 409, configured to set location
information for each location unit, each location unit being corresponding to
at least one material
a second determining module 410, configured to
determine a proportion occupied by each material corresponding to each location
unit;
a forming module 411, configured to form material
data by each material corresponding to each location unit and the proportion
occupied by each material, to obtain the material data of each location unit;
and
a storage module 412, configured to store the
material data and the location information of each location unit of the preset
implementation environment, where
the first determining unit 4021 is configured to
search for location information matching the location information of the
current implementation environment among stored location information of
location units of the preset implementation environment, and use a location
unit corresponding to the found location information as a location unit in the
preset implementation environment corresponding to the current implementation
environment.
Referring to FIG. 7, the apparatus further
includes:
a processing module 413, configured to set an
initial sound effect value for each material, and store the initial sound
effect value of each material, where
the second obtaining module 403 is configured to
search for the initial sound effect value corresponding to each material for
forming the current implementation environment among stored initial sound
effect values of all material.
Referring to FIG. 8, the adjusting module 404
includes:
a determining unit 4041, configured to determine,
according to the proportion occupied by each material, a volume for playing
each material; and
an adjusting unit 4042, configured to adjust the
initial sound effect value corresponding to each material according to the
determined volume for playing each material.
Refer to FIG. 9, which is a schematic structural
diagram of a terminal device involved in an embodiment of the present
invention, and the terminal device can be configured to implement the sound
effect playback method provided in the foregoing embodiment. Specifically:
The terminal device 900 may include components such
as a radio frequency (RF) circuit 110, a memory 120 including one or more
computer readable storage media, an input unit 130, a display unit 140, a
processor 180 including one or more processing cores, and a power supply 190.
The terminal device 900 may further include a sensor 150, an audio circuit 160,
and a transmission module 170, such as a Wireless Fidelity (WiFi) module. A
person skilled in the art may understand that the structure of the terminal
device shown in FIG. 9 does not constitute a limitation to the terminal device,
and the terminal device may include more components or fewer components than
those shown in the figure, or some components may be combined, or a different
component deployment may be used.
The RF circuit 110 may be configured to receive and
send a signal during an information receiving and sending process or a
conversation process. Specifically, the RF circuit receives downlink
information from a base station, then delivers the downlink information to one
or more processors 180 for processing, and sends related uplink data to the
base station. Generally, the RF circuit 110 includes, but is not limited to, an
antenna, at least one amplifier, a tuner, one or more oscillators, a subscriber
identity module (SIM) card, a transceiver, a coupler, a low noise amplifier
(LNA), and a duplexer. In addition, the RF circuit 110 may also communicate
with a network and another device by wireless communication. The wireless
communication may use any communications standard or protocol, which includes,
but is not limited to, Global System for Mobile communications (GSM), General
Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband
Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), e-mail, Short
Messaging Service (SMS), and the like.
The memory 120 may be configured to store a software
program and module. The processor 180 runs the software program and module
stored in the memory 120, to implement various functional applications and data
processing. The memory 120 may mainly include a program storage area and a data
storage area. The program storage area may store an operating system, an
application program required by at least one function (such as a sound playback
function and an image display function), and the like. The data storage area
may store data (such as audio data and an address book) created according to
use of the terminal device 900, and the like. In addition, the memory 120 may
include a high speed random access memory, and may also include a non-volatile
memory, such as at least one magnetic disk storage device, a flash memory, or
another volatile solid storage device. Accordingly, the memory 120 may further
include a memory controller, so that the processor 180 and the input unit 130
access the memory 120.
The input unit 130 may be configured to receive
input digit or character information, and generate keyboard, mouse, joystick,
optical, or track ball signal input related to the user setting and function
control. Specifically, the input unit 130 may include a touch-sensitive surface
131 and another input device 132. The touch-sensitive surface 131 may also be
referred to as a touch display screen or a touch panel, and may collect a touch
operation of a user on or near the touch-sensitive surface (such as an
operation of a user on or near the touch-sensitive surface 131 by using any
suitable object or attachment, such as a finger or a touch pen), and drive a
corresponding connection apparatus according to a preset program. Optionally,
the touch-sensitive surface 131 may include two parts: a touch detection
apparatus and a touch controller. The touch detection apparatus detects a touch
position of the user, detects a signal generated by the touch operation, and
transfers the signal to the touch controller. The touch controller receives the
touch information from the touch detection apparatus, converts the touch
information into touch point coordinates, and sends the touch point coordinates
to the processor 180. Moreover, the touch controller can receive and execute a
command sent from the processor 180. In addition, the touch-sensitive surface
131 may be implemented by using various types, such as a resistive type, a
capacitance type, an infrared type, and a surface sound wave type. In addition
to the touch-sensitive surface 131, the input unit 130 may further include the
another input device 132. Specifically, the another input device 132 may
include, but is not limited to, one or more of a physical keyboard, a
functional key (such as a volume control key or a switch key), a track ball, a
mouse, a joystick, and the like.
The display unit 140 may be configured to display
information input by the user or information provided for the user, and various
graphical user interfaces of the terminal device 900. The graphical user
interfaces may be formed by a graph, a text, an icon, a video, and any
combination thereof. The display unit 140 may include a display panel 141.
Optionally, the display panel 141 may be configured by using a liquid crystal
display (LCD), an organic light-emitting diode (OLED), or the like. Further,
the touch-sensitive surface 131 may cover the display panel 141. After
detecting a touch operation on or near the touch-sensitive surface 131, the
touch-sensitive surface 131 transfers the touch operation to the processor 180,
so as to determine a type of a touch event. Then, the processor 180 provides
corresponding visual output on the display panel 141 according to the type of
the touch event. Although, in FIG. 9, the touch-sensitive surface 131 and the
display panel 141 are used as two separate parts to implement input and output
functions, in some embodiments, the touch-sensitive surface 131 and the display
panel 141 may be integrated to implement the input and output functions.
The terminal device 900 may further include at least
one sensor 150, such as an optical sensor, a motion sensor, and other sensors.
Specifically, the optical sensor may include an ambient light sensor and a
proximity sensor. The ambient light sensor may adjust luminance of the display
panel 141 according to brightness of the ambient light. The proximity sensor
may switch off the display panel 141 and/or backlight when the terminal device
900 is moved to the ear. As one type of motion sensor, a gravity acceleration
sensor may detect magnitude of accelerations at various directions (which
generally are triaxial), may detect magnitude and a direction of the gravity
when static, and may be configured to identify an application of a mobile phone
gesture (such as switchover between horizontal and vertical screens, a related
game, and gesture calibration of a magnetometer), a related function of
vibration identification (such as a pedometer and a knock). Other sensors, such
as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared
sensor, which may be configured in the terminal device 900 are not further
described herein.
The audio circuit 160, a loudspeaker 161, and a
microphone 162 may provide audio interfaces between the user and the terminal
device 900. The audio circuit 160 may transmit, to the loudspeaker 161, an
electric signal converted from received audio data. The loudspeaker 161
converts the electric signal into a sound signal for output. On the other hand,
the microphone 162 converts a collected sound signal into an electric signal.
The audio circuit 160 receives the electric signal and converts the electric
signal into audio data, and outputs the audio data to the processor 180 for
processing. Then, the processor 180 sends the audio data to, for example,
another terminal device by using the RF circuit 110, or outputs the audio data
to the memory 120 for further processing. The audio circuit 160 may further
include an earplug jack, so as to provide communication between a peripheral
earphone and the terminal device 900.
WiFi belongs to a short distance wireless
transmission technology. The terminal device 900 may help, by using the WiFi
module 170, a user to receive and send an e-mail, browse a webpage, access
stream media, and the like, which provides wireless broadband Internet access
for the user. Although FIG. 9 shows the WiFi module 170, it may be understood
that, the WiFi module 170 does not belong to a necessary constitution of the
terminal device 900, and can be ignored according to demands without changing
the scope of the essence of the present disclosure.
The processor 180 is a control center of the
terminal device 900, and connects to various parts of the entire mobile phone
by using various interfaces and lines. By running or executing the software
program and/or module stored in the memory 120, and invoking data stored in the
memory 120, the processor 180 performs various functions and data processing of
the terminal device 900, thereby performing overall monitoring on the mobile
phone. Optionally, the processor 180 may include one or more processing cores.
Optionally, the processor 180 may integrate an application processor and a
modem. The application processor mainly processes an operating system, a user
interface, an application program, and the like. The modem mainly processes
wireless communication. It may be understood that, the foregoing modem may also
not be integrated into the processor 180.
The terminal device 900 further includes the power
supply 190 (such as a battery) for supplying power to the components.
Preferably, the power supply may logically connect to the processor 180 by
using a power supply management system, thereby implementing functions, such as
charging, discharging, and power consumption management, by using the power
supply management system. The power supply 190 may further include any
component, such as one or more direct current or alternate current power
supplies, a re-charging system, a power supply fault detection circuit, a power
supply converter or an inverter, and a power supply state indicator.
Although not shown in the figure, the terminal
device 900 may further include a camera, a Bluetooth module, and the like,
which are not further described herein. Specifically, in this embodiment, the
display unit of the terminal device 900 is a touch screen display, and the
terminal device 900 further includes a memory and one or more programs. The one
or more programs are stored in the memory and configured to be executed by one
or more processors. The one or more programs are configured to execute the
method shown in FIG. 1 and FIG. 2.
An embodiment of the present invention further
provides a computer readable storage medium, and the computer readable storage
medium may be the computer readable storage medium included in the memory in
the foregoing embodiment; and may also a computer readable storage medium
existing individually and not installed in the terminal device. The computer
readable storage medium stores one or more programs, and the one or more
programs are used by one or more processors to execute the sound effect
playback method.
An embodiment of the present invention provides a
graphical user interface, the graphical user interface is used on a display
terminal device for playing a sound effect, and the confirming terminal device
for executing an operation includes a touch screen display, a memory and one or
more processors configured to execute one or more programs; the graphical user
interface includes:
obtaining location information of a current
implementation environment, and determining, according to the location
information of the current implementation environment, each material for
forming the current implementation environment and a proportion occupied by
each material;
obtaining an initial sound effect value
corresponding to each material for forming the current implementation
environment, and adjusting the initial sound effect value corresponding to each
material according to the proportion occupied by each material, to obtain an
adjusted sound effect value of each material; and
combining adjusted sound effect values of all
materials, and playing a combined sound effect.
In the graphical user interface provided in this
embodiment of the present invention, each material for forming a current
implementation environment and a proportion occupied by each material are
determined according to location information of the current implementation
environment, and an initial sound effect value corresponding to each material
for forming the current implementation environment is obtained; then the
initial sound effect value corresponding to each material according to the
proportion occupied by each material is adjusted, and adjusted sound effect
values of all materials are combined and then a combined sound effect is
played, so that the current implementation environment can be accurately
embodied without the need of adding a system resource pack, and therefore the
played sound effect is more timely.
It should be noted that when the sound effect
playback apparatus provided by the embodiment plays a sound effect, description
is made only through examples of division of the functional modules. In an
actual application, the functions may be assigned according to needs to be
implemented by different functional modules, that is, the internal structure of
the sound effect playback apparatus is divided into different functional
modules, so as to implement all or a part of the functions described above.
Furthermore, the embodiment of the sound effect playback apparatus provided by
the embodiments belongs to the same idea as the embodiment of the sound effect
playback method, and the method embodiment may serve as a reference for details
of a specific implementation process thereof, which are not repeated
herein.
The sequence numbers of the preceding embodiments of
the present invention are merely for description purpose but do not indicate
the preference of the embodiments.
Persons of ordinary skill in the art may understand
that all or a part of the steps of the foregoing embodiments may be implemented
through hardware, or may be implemented by a program instructing relevant
hardware. The program may be stored in a computer readable storage medium. The
storage medium may be a read-only memory, a magnetic disk, or an optical
disc.
The foregoing descriptions are merely exemplary
embodiments of the present invention, but are not intended to limit the present
disclosure. Any modification, equivalent replacement, or improvement derived
within the spirit and principle of the present disclosure shall fall within the
protection scope of the present disclosure.