Sound playing method, playing device, electronic device and readable storage medium
By adjusting the frequency and timbre of background sound according to user input in the virtual keyboard input method of mobile terminals such as smart phones, distinctive music is formed, which solves the problem of boring virtual keyboard input and improves the interest and fun of input.
Patent Information
- Application Number
- CN202210859439.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-21
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2042-07-21
AI Technical Summary
In the prior art, the background sound of keystrokes during input on a virtual keyboard of a mobile terminal such as a smart phone is dull and lacks entertainment.
By receiving input from the user input method control, the corresponding first sound frequency and target timbre parameters are determined, background sound that matches the preset background sound style is played, and the scale and pitch are randomly or continuously adjusted to form distinctive music.
It increases the fun and interest of input method input, and the background sound is connected into a harmonious and unique music.
Smart Images

Figure CN115220686B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of electronic equipment, and specifically relates to a sound playing method, a playing device, an electronic device and a readable storage medium. Background Art
[0002] In the related art, for mobile terminals such as smart phones and tablet computers, character input is generally achieved through a virtual keyboard, and the user simulates the keyboard input process by touching the virtual keys on the virtual keyboard.
[0003] During this process, in order to achieve touch feedback, a key background sound is generally set. When the user triggers a virtual key, the key background sound is played while entering text. This key background sound is played based on a preset fixed audio, which users may find boring and lacking in entertainment. Summary of the Invention
[0004] The purpose of the embodiments of the present application is to provide a sound playback method, device, electronic device and storage medium, which can enrich the background sound of the input method and improve the interest and fun of input through the input method.
[0005] In a first aspect, an embodiment of the present application provides a method for playing a sound, comprising:
[0006] Upon receiving a first input to the input method control, determining a first sound frequency and a target timbre parameter corresponding to the first input, wherein the target timbre parameter corresponds to a preset target background sound style;
[0007] In response to the first input, a corresponding sound is played based on the first sound frequency and the target timbre parameter.
[0008] In a second aspect, an embodiment of the present application provides a sound playback device, comprising:
[0009] a determination module, configured to, upon receiving a first input to the input method control, determine a first sound frequency and a target timbre parameter corresponding to the first input, wherein the target timbre parameter corresponds to a preset target background sound style;
[0010] The playing module is configured to play a corresponding sound in response to a first input based on a first sound frequency and a target timbre parameter.
[0011] In a third aspect, an embodiment of the present application provides an electronic device comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the method of the first aspect are implemented.
[0012] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method of the first aspect are implemented.
[0013] In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the steps of the method of the first aspect.
[0014] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method of the first aspect.
[0015] In an embodiment of the present application, when a first input for inputting text from a user is received for an input method control, a corresponding first sound frequency and a target timbre parameter are determined based on the first input. The first sound frequency is the sound frequency of the background sound, and the target timbre parameter is used to determine the timbre of the background sound. According to the first sound frequency and the target timbre parameter, audio data of the background sound is formed, and based on the audio data, the speaker of the electronic device is controlled to play the corresponding sound. When the user presses the virtual key multiple times, the sound frequency is determined based on each input. Therefore, each time a key input is performed, the background sound played is different, specifically, the scale, pitch, etc. are different, but a unified timbre style is maintained. Therefore, when the user inputs continuously, these background sounds are connected into a distinctive piece of music, which increases the interest and fun of input through the input method. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A flowchart of a method for playing sound according to an embodiment of the present application is shown;
[0017] Figure 2 A schematic diagram of an input method control according to an embodiment of the present application is shown;
[0018] Figure 3 A schematic diagram of a setting interface for a target background sound style according to an embodiment of the present application is shown;
[0019] Figure 4 A schematic diagram of scale fluctuation according to an embodiment of the present application is shown;
[0020] Figure 5 A schematic diagram of pitch fluctuation according to an embodiment of the present application is shown;
[0021] Figure 6 A structural block diagram of a sound playback device according to an embodiment of the present application is shown;
[0022] Figure 7shows a structural block diagram of an electronic device according to an embodiment of the present application;
[0023] Figure 8 A schematic diagram of the hardware structure of an electronic device implementing an embodiment of the present application. DETAILED DESCRIPTION
[0024] The following will be combined with the accompanying drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field are within the scope of protection of this application.
[0025] The terms "first," "second," and the like in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than that illustrated or described herein, and that the objects distinguished by "first," "second," and the like are generally of the same type, and do not limit the number of objects; for example, the first object can be one or more. In addition, the term "and / or" in the specification and claims refers to at least one of the connected objects, and the character " / " generally indicates that the objects connected are in an "or" relationship.
[0026] The following, in conjunction with the accompanying drawings, describes in detail the sound playback method, playback device, electronic device and readable storage medium provided by the embodiments of the present application through specific embodiments and their application scenarios.
[0027] In some embodiments of the present application, a method for playing sound is provided. Figure 1 A flow chart of a method for playing sound according to an embodiment of the present application is shown. Figure 1 As shown, the method includes:
[0028] Step 102: upon receiving a first input to the input method control, determining a first sound frequency and a target timbre parameter corresponding to the first input;
[0029] In step 102, the target timbre parameter and the first sound frequency are both corresponding to the first input, and the target timbre parameter corresponds to a preset target background sound style;
[0030] Step 104 : In response to the first input, play a corresponding sound based on the first sound frequency and the target timbre parameter.
[0031] In the embodiment of the present application, the first input refers to the user's input to the input method control. The first input can be the user touching, pressing, or other operations on the input method control. The input method control specifically includes a key in a virtual keyboard. Figure 2 A schematic diagram of an input method control according to an embodiment of the present application is shown. Figure 2 As shown, there are multiple virtual keys 202 corresponding to characters on the input method control 200. When the user touches a virtual key 202, the character corresponding to the virtual key 202 will be displayed in the corresponding text input box, eventually forming a word, text or symbol.
[0032] When the user's first input is received, the corresponding first sound frequency and target timbre parameters are first determined based on the first input, wherein the first sound frequency is the sound frequency of the background sound. Specifically, the sound frequency refers to the vibration frequency of the medium that causes the medium to vibrate and thus transmits the sound to the human ear. The higher the sound frequency, the higher the pitch and scale, and the lower the sound frequency, the lower the pitch and scale.
[0033] The target timbre parameters are timbre parameters that match the style of the first sound frequency. The user can set the style of the input method background sound in advance. The style of the background sound will affect the target timbre parameters and the first sound frequency, that is, it will affect the listening experience of the input method background sound. For example, when selecting the campus pop music style, the target timbre parameters are the timbre parameters of the guitar. When selecting the jazz style, the target timbre parameters are the timbre parameters of the saxophone or the timbre parameters of the piano.
[0034] The first sound frequency and the target timbre parameter are combined to generate audio data representing the background sound, and the audio data is played. Specifically, the sound can be represented by a sound wave, where the frequency of the sound wave is the first sound frequency, and the target timbre parameter is associated with the waveform of the sound wave. It is understood that the amplitude of the sound wave can represent the volume of the sound.
[0035] Therefore, after determining the first sound frequency and the target timbre parameter, the sound wave of the sound can be obtained, and the speaker of the electronic device can be controlled to operate according to the sound wave, so that the speaker can play the corresponding sound.
[0036] When the user continues to input, specifically by pressing a virtual key multiple times, the sound frequency is determined independently based on each input. Therefore, each time a key input is performed, the background sound played is different, specifically the scale, pitch, etc. are different, but the tone style is kept uniform. Therefore, when the user inputs continuously, these background sounds are connected into a distinctive piece of music, which increases the interest and fun of inputting through the input method.
[0037] In some embodiments of the present application, determining the first sound frequency corresponding to the first input includes:
[0038] When the first input is within a first preset duration and is a first input to the input method control, determining a first pitch within a preset pitch set and determining a first scale within a preset scale set;
[0039] A first sound frequency is determined based on the first pitch and the first scale.
[0040] In the embodiment of the present application, the pitch range of the keystroke background sound can be an octave pitch range, that is, there are a total of 8 pitch heights in the preset pitch set. The musical scale includes 7 basic notes, specifically: do, re, mi, fa, sol, la, ti (or si).
[0041] The final sound played is determined by the scale, pitch and timbre, among which the first sound frequency includes the scale attribute and the pitch attribute.
[0042] When the user presses the input method control, i.e., the virtual keyboard, for the first time within a first preset time length, a first pitch and a first scale are randomly selected from a preset pitch set and a preset scale set, and the first sound frequency is determined based on the randomly selected first pitch and first scale.
[0043] The first preset duration is used to determine the duration between user inputs. During normal input, users may pause for a short time to think or check text, and this pause is generally short. If the user does not input for a long period of time, the current input process is considered to have ended. If user input is received again thereafter, the input is considered to be the first input. The first preset duration is the duration of the interval used to determine whether an input is the first input.
[0044] Since the first scale and the first pitch are randomly selected within a preset range, the randomness of the background sound can be guaranteed while ensuring the harmony of the generated sound, thereby improving the fun of inputting characters through the input method.
[0045] In some embodiments of the present application, when the first input is the Nth input to the input method control within the second preset time length, the first sound frequency is determined based on the input information of the first input and the second sound frequency corresponding to the N-1th input to the input method control within the second preset time length, where N is an integer greater than 1.
[0046] In the embodiment of the present application, the second preset duration is a duration for determining whether the user input is a continuous character input. When receiving the user input, if it is determined that there was a previous input within the second preset duration before the input was received, then the current input is determined to be not the first input, but the Nth input.
[0047] When determining the sound frequency of the input background sound for the Nth input, the sound frequency of the background sound for this input is determined based on the second sound frequency of the background sound played during the previous input, that is, the N-1th input, so that the sound frequency between two consecutive inputs, including pitch and scale, is more coherent and continuous, so that the background sound inputted multiple times continuously maintains a harmonious melody, thereby forming these background sounds into harmonious, coherent, and unique music, thereby increasing the fun of input.
[0048] In some embodiments of the present application, before determining the first sound frequency corresponding to the first input, the playing method further includes:
[0049] receiving a second input;
[0050] In response to the second input, a target background sound style is determined.
[0051] In an embodiment of the present application, the user can select the style of background sound by setting the input method, such as jazz style, campus pop style, folk style, etc. These background sound styles will affect the timbre of the background sound, that is, the target timbre. For example, when selecting campus pop style, the target timbre of the background sound is the timbre of the guitar. When selecting jazz style, the target timbre of the background sound can be the timbre of the saxophone or the timbre of the piano, etc.
[0052] For example, Figure 3 A schematic diagram of the target background sound style setting interface according to an embodiment of the present application is shown. Figure 3 As shown, the user can select the target background music style he or she wants in the input method setting interface 300. Among them, the setting interface 300 can be automatically popped up when the user starts the input method for the first time, and the user can also call out the setting interface 300 by touching the setting switch of the input method.
[0053] At the same time, the background sound style will also affect the scale, pitch, etc. of adjacent background sounds during continuous input, thereby affecting the melody formed by continuous background sounds during continuous input, so that the melody formed by the background sound during continuous input matches the background sound style selected by the user.
[0054] In some embodiments of the present application, the input information includes input speed and input duration, and the second sound frequency is determined according to the second pitch and the second scale;
[0055] Determining the first sound frequency according to input information of the first input and a second sound frequency corresponding to the N-1th input of the input method control within a second preset time period includes:
[0056] Determine the third scale based on the second scale, input speed, input duration, and target background sound style;
[0057] Determine the third pitch based on the second pitch, input speed, input duration, and target background sound style;
[0058] Based on the third scale and the third pitch, the first sound frequency is determined.
[0059] In an embodiment of the present application, when continuous input from the user is detected, the first sound frequency of the background sound input for the Nth time is related to the second sound frequency of the background sound input for the previous time, that is, the N-1th time, so that adjacent background sounds form a melody that matches the style of the target background sound.
[0060] Specifically, the sound frequency of the background sound played during the N-1th input is specifically the second sound frequency, and the second sound frequency is determined by the second pitch M and the second scale E.
[0061] When determining the third scale of the currently input background sound, the third scale Fy can be generated based on the second scale E, the input duration T of the last input and the input speed S of the user input characters, combined with the music style D and melody B corresponding to the target background sound style.
[0062] The music style D and tune B are preset constants. For example, the music style D of campus pop music is 3, and the tune B is 2. Different target music styles correspond to different D and B values.
[0063] The input duration specifically refers to the time between the moment the user's finger touches the virtual button and the moment the user raises his hand.
[0064] The keystroke speed may be a preset fixed value, that is, the calculation is performed using the fixed value S. For example, for the second input, the fixed value S may be selected to participate in the calculation.
[0065] In some implementations, the actual input speed S may be obtained by dividing the total duration of N-1 inputs before the first input by the number of inputs N-1.
[0066] In some other implementations, the input speed S may be calculated by dividing the time from the receipt of the N-2th input to the end of the N-1th input by 2.
[0067] After obtaining the second scale E, the input duration T of the last input, the input speed S, the music style D and the melody B, the third scale Fy can be calculated through the function: fun(E, T, S, B, D).
[0068] For example, the above function fun(E, T, S, B, D) is specifically:
[0069]
[0070] Wherein, Fy is the third scale, S is the input speed, E is the second scale, and 1≤E≤7, T is the input duration, B is the melody, and B is a constant, and D is the music style, and D is a constant.
[0071] After Fy is calculated, if Fy is not an integer, rounding is performed, such as rounding up, rounding down, or rounding off.
[0072] Figure 4 FIG. 4 shows a schematic diagram of scale fluctuation according to an embodiment of the present application, as shown in FIG. Figure 4 As shown, the scale fluctuation range of the continuously input background sound is between 1 and 7.
[0073] Similarly, after obtaining the second pitch M, the input duration T of the last input, the input speed S, the music style D and the melody B, the third pitch Fx can be calculated through the function: fun(S, M, T, B, D).
[0074] For example, the above function fun(S, M, T, B, D) is specifically:
[0075]
[0076] Wherein, Fx is the third pitch, S is the input speed, M is the second pitch, and 1≤M≤8, T is the input duration, B is the melody, and B is a constant, and D is the music style, and D is a constant.
[0077] After Fx is calculated, if Fx is not an integer, rounding is also performed, such as rounding up, rounding down, or rounding off.
[0078] Figure 5 FIG. 4 shows a schematic diagram of pitch fluctuation according to an embodiment of the present application. Figure 5 As shown, the pitch fluctuation range of the continuous input background sound is between 1 and 8.
[0079] After obtaining the third pitch Fx and the third scale Fy, the first frequency can be calculated by using the function fun(x, y).
[0080] For example, the above function fun(x, y) is specifically:
[0081] F(x, y)=27.5×2 (x-1) ×1.05 (y-1) ;
[0082] Wherein, F(x, y) is the first frequency, x is the third pitch, and y is the third scale.
[0083] The sound frequency of the background sound during this input is determined based on the second sound frequency of the background sound played during the last input and the input parameters, so that the sound frequency between two consecutive inputs, including pitch and scale, is more coherent and continuous, so that the background sound inputted multiple times continuously maintains a harmonious melody, thereby forming these background sounds into harmonious, coherent, and unique music, thereby increasing the fun of input.
[0084] The sound playing method provided in the embodiment of the present application can be performed by a sound playing device. In the embodiment of the present application, the method for determining background sound performed by a sound playing device is taken as an example to illustrate the background sound determining device provided in the embodiment of the present application.
[0085] In some embodiments of the present application, a sound playing device is provided. Figure 6 FIG. 1 shows a structural block diagram of a sound playback device according to an embodiment of the present application, as shown in FIG. Figure 6 As shown, the sound playing device 600 includes:
[0086] A determination module 602 is configured to, upon receiving a first input to the input method control, determine a first sound frequency and a target timbre parameter corresponding to the first input, wherein the target timbre parameter corresponds to a preset target background sound style;
[0087] The playing module 604 is configured to play a corresponding sound in response to the first input based on the first sound frequency and the target timbre parameter.
[0088] In an embodiment of the present application, when a first input for inputting text from a user is received for an input method control, a corresponding first sound frequency and a target timbre parameter are determined based on the first input. The first sound frequency is the sound frequency of the background sound, and the target timbre parameter is used to determine the timbre of the background sound. According to the first sound frequency and the target timbre parameter, audio data of the background sound is formed, and based on the audio data, the speaker of the electronic device is controlled to play the corresponding sound. When the user presses the virtual key multiple times, the sound frequency is determined based on each input. Therefore, each time a key input is performed, the background sound played is different, specifically, the scale, pitch, etc. are different, but a unified timbre style is maintained. Therefore, when the user inputs continuously, these background sounds are connected into a distinctive piece of music, which increases the interest and fun of input through the input method.
[0089] In the embodiment of the present application, the determination module is further configured to:
[0090] When the first input is within a first preset duration and is a first input to the input method control, determining a first pitch within a preset pitch set and determining a first scale within a preset scale set;
[0091] A first sound frequency is determined based on the first pitch and the first scale.
[0092] In the embodiment of the present application, since the first scale and the first pitch are randomly selected within a preset range, the randomness of the background sound can be guaranteed while ensuring the harmony of the generated sound, thereby improving the fun of inputting characters through the input method.
[0093] In the embodiment of the present application, the determination module is further configured to:
[0094] When the first input is the Nth input to the input method control within the second preset time length, the first sound frequency is determined based on the input information of the first input and the second sound frequency corresponding to the N-1th input to the input method control within the second preset time length, where N is an integer greater than 1.
[0095] In an embodiment of the present application, the sound frequency of the background sound during this input is determined based on the second sound frequency of the background sound played during the last input, that is, the N-1th input, so that the sound frequency between two consecutive inputs, including the pitch and scale, is more coherent and continuous, so that the background sound of multiple consecutive inputs maintains a harmonious melody, thereby forming these background sounds into harmonious, coherent, and unique music, thereby increasing the fun of input.
[0096] In the embodiment of the present application, the playback device further includes:
[0097] A receiving module, configured to receive a second input;
[0098] The determination module is further configured to determine a target background sound style in response to a second input.
[0099] In an embodiment of the present application, the background sound style will also affect the scale, pitch, etc. of adjacent background sounds during continuous input, thereby affecting the melody formed by continuous background sounds during continuous input, so that the melody formed by the background sound during continuous input matches the background sound style selected by the user.
[0100] In some embodiments of the present application, the input information includes input speed and input duration, and the second sound frequency is determined according to the second pitch and the second scale;
[0101] Identify modules, also used for:
[0102] Determine the third scale based on the second scale, input speed, input duration, and target background sound style;
[0103] Determine the third pitch based on the second pitch, input speed, input duration, and target background sound style;
[0104] Based on the third scale and the third pitch, the first sound frequency is determined.
[0105] This application determines the sound frequency of the background sound during this input based on the second sound frequency of the background sound played during the previous input and the input parameters, so that the sound frequency between two consecutive inputs, including pitch and scale, is more coherent and continuous, so that the background sound inputted multiple times continuously maintains a harmonious melody, so that these background sounds form harmonious, coherent, and unique music, thereby increasing the fun of input.
[0106] The sound playback device in the embodiment of the present application can be an electronic device or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other device other than a terminal. For example, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a mobile Internet device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA), etc. It can also be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., and the embodiment of the present application does not specifically limit it.
[0107] The sound playback device in the embodiment of the present application can be a device having an operating system. The operating system can be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0108] The sound playback device provided in the embodiment of the present application can implement each process implemented in the above method embodiment. To avoid repetition, it will not be described here.
[0109] Optionally, an embodiment of the present application further provides an electronic device, Figure 7 FIG. 1 shows a structural block diagram of an electronic device according to an embodiment of the present application. Figure 7 As shown, the electronic device 700 includes a processor 702, a memory 704, and a program or instruction stored in the memory 704 and executable on the processor 702. When the program or instruction is executed by the processor 702, the various processes of the above-mentioned method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, they will not be described here.
[0110] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
[0111] Figure 8 A schematic diagram of the hardware structure of an electronic device implementing an embodiment of the present application.
[0112] The electronic device 800 includes but is not limited to: a radio frequency unit 801, a network module 802, an audio output unit 803, an input unit 804, a sensor 805, a display unit 806, a user input unit 807, an interface unit 808, a memory 809 and a processor 810.
[0113] Those skilled in the art will understand that the electronic device 800 may also include a power source (such as a battery) to power each component, and the power source may be logically connected to the processor 810 through a power management system, thereby implementing functions such as charging, discharging, and power consumption management through the power management system. Figure 8 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be repeated here.
[0114] Among them, the processor 810 is used to determine the first sound frequency and target timbre parameters corresponding to the first input when receiving the first input to the input method control, wherein the target timbre parameters correspond to the preset target background sound style; in response to the first input, play the corresponding sound based on the first sound frequency and the target timbre parameters.
[0115] In an embodiment of the present application, when a first input for inputting text from a user is received for an input method control, a corresponding first sound frequency and a target timbre parameter are determined based on the first input. The first sound frequency is the sound frequency of the background sound, and the target timbre parameter is used to determine the timbre of the background sound. According to the first sound frequency and the target timbre parameter, audio data of the background sound is formed, and based on the audio data, the speaker of the electronic device is controlled to play the corresponding sound. When the user presses the virtual key multiple times, the sound frequency is determined based on each input. Therefore, each time a key input is performed, the background sound played is different, specifically, the scale, pitch, etc. are different, but a unified timbre style is maintained. Therefore, when the user inputs continuously, these background sounds are connected into a distinctive piece of music, which increases the interest and fun of input through the input method.
[0116] Optionally, the processor 810 is also used to determine the first pitch within a preset pitch set and the first scale within a preset scale set for the first input of the input method control within a first preset duration; and determine the first sound frequency based on the first pitch and the first scale.
[0117] In the embodiment of the present application, since the first scale and the first pitch are randomly selected within a preset range, the randomness of the background sound can be guaranteed while ensuring the harmony of the generated sound, thereby improving the fun of inputting characters through the input method.
[0118] Optionally, the processor 810 is also used to determine the first sound frequency based on the input information of the first input and the second sound frequency corresponding to the N-1th input of the input method control within the second preset time length when the first input is the Nth input of the input method control within the second preset time length, where N is an integer greater than 1.
[0119] In an embodiment of the present application, the sound frequency of the background sound during this input is determined based on the second sound frequency of the background sound played during the last input, that is, the N-1th input, so that the sound frequency between two consecutive inputs, including the pitch and scale, is more coherent and continuous, so that the background sound of multiple consecutive inputs maintains a harmonious melody, thereby forming these background sounds into harmonious, coherent, and unique music, thereby increasing the fun of input.
[0120] Optionally, the user input unit 807 is used to receive a second input;
[0121] The processor 810 is further configured to determine a target background sound style in response to a second input.
[0122] In an embodiment of the present application, the background sound style will also affect the scale, pitch, etc. of adjacent background sounds during continuous input, thereby affecting the melody formed by continuous background sounds during continuous input, so that the melody formed by the background sound during continuous input matches the background sound style selected by the user.
[0123] Optionally, the input information includes input speed and input duration, and the second sound frequency is determined based on the second pitch and the second scale; the processor 810 is also used to determine the third scale based on the second scale, input speed, input duration and target background sound style; determine the third pitch based on the second pitch, input speed, input duration and target background sound style; determine the first sound frequency based on the third scale and the third pitch.
[0124] This application determines the sound frequency of the background sound during this input based on the second sound frequency of the background sound played during the previous input and the input parameters, so that the sound frequency between two consecutive inputs, including pitch and scale, is more coherent and continuous, so that the background sound inputted multiple times continuously maintains a harmonious melody, so that these background sounds form harmonious, coherent, and unique music, thereby increasing the fun of input.
[0125] It should be understood that in an embodiment of the present application, the input unit 804 may include a graphics processing unit (GPU) 8041 and a microphone 8042, and the graphics processor 8041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 806 may include a display panel 8061, and the display panel 8061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 807 includes a touch panel 8071 and at least one of other input devices 8072. The touch panel 8071 is also called a touch screen. The touch panel 8071 may include two parts: a touch detection device and a touch controller. Other input devices 8072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and an operating stick, which will not be repeated here.
[0126] The memory 809 can be used to store software programs and various data. The memory 809 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, applications or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 809 may include a volatile memory or a non-volatile memory, or the memory 809 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM). The memory 809 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0127] Processor 810 may include one or more processing units. Optionally, processor 810 integrates an application processor and a modem processor. The application processor primarily handles operations related to the operating system, user interface, and application programs, while the modem processor primarily processes wireless communication signals, such as a baseband processor. It is understood that the modem processor may not be integrated into processor 810.
[0128] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0129] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer-readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0130] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0131] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0132] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0133] It should be noted that, in this article, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element. In addition, it should be noted that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in the opposite order according to the functions involved. For example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0134] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0135] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are within the protection of this application.
Claims
1. A method for playing sound, characterized in that: include: Upon receiving a first input to the input method control, determining a first sound frequency and a target timbre parameter corresponding to the first input, wherein the target timbre parameter corresponds to a preset target background sound style; In response to the first input, playing a corresponding sound based on the first sound frequency and the target timbre parameter; The determining a first sound frequency corresponding to the first input includes: When the first input is the Nth input to the input method control within a second preset duration, determining the first sound frequency based on input information of the first input and a second sound frequency corresponding to the N-1th input to the input method control within the second preset duration, where N is an integer greater than 1; The input information includes input speed and input duration, and the second sound frequency is determined according to a second pitch and a second scale; The determining the first sound frequency according to the input information of the first input and the second sound frequency corresponding to the N-1th input of the input method control within the second preset time period includes: determining a third scale according to the second scale, the input speed, the input duration, and the target background sound style; determining a third pitch according to the second pitch, the input speed, the input duration, and the target background sound style; The first sound frequency is determined according to the third scale and the third pitch.
2. The playback method according to claim 1, wherein: The determining a first sound frequency corresponding to the first input includes: When the first input is within a first preset duration and is a first input to the input method control, determining a first pitch within a preset pitch set and determining a first scale within a preset scale set; The first sound frequency is determined according to the first pitch and the first scale.
3. The playback method according to claim 1, wherein: Before determining the first sound frequency corresponding to the first input, the playing method further includes: receiving a second input; In response to the second input, the target background sound style is determined.
4. A sound playing device, characterized in that: include: a determination module, configured to, upon receiving a first input to the input method control, determine a first sound frequency corresponding to the first input; a playing module, configured to play a corresponding sound in response to the first input and based on the first sound frequency and target timbre parameters; The determining module is further configured to: When the first input is the Nth input to the input method control within a second preset duration, determining the first sound frequency based on input information of the first input and a second sound frequency corresponding to the N-1th input to the input method control within the second preset duration, where N is an integer greater than 1; The input information includes input speed and input duration, and the second sound frequency is determined according to a second pitch and a second scale; The determining module is further configured to: determining a third scale according to the second scale, the input speed, the input duration, and the target background sound style; determining a third pitch according to the second pitch, the input speed, the input duration, and the target background sound style; The first sound frequency is determined according to the third scale and the third pitch.
5. The playback device according to claim 4, characterized in that The determining module is further configured to: When the first input is within a first preset duration and is a first input to the input method control, determining a first pitch within a preset pitch set and determining a first scale within a preset scale set; The first sound frequency is determined according to the first pitch and the first scale.
6. The playback device according to claim 4, characterized in that Also includes: A receiving module, configured to receive a second input; The determination module is further configured to determine a target background sound style in response to the second input, wherein the target timbre corresponds to the target background sound style.
7. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the sound playing method according to any one of claims 1 to 3 are implemented.
8. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the sound playing method according to any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Input method and apparatus
CN106445180A
Devices, methods, and graphical user interfaces for providing feedback during interaction with an intensity-sensitive button
EP3291076A1