Ambient sound generation method, device and storage medium
By obtaining the synthesis coefficient and the ambient sound playback mode, and combining the real-time environmental status information for sound synthesis, the problem of natural environmental sound mismatch in the existing technology is solved, and the real-time generation of environmental sounds consistent with the user's current geographical location and time is achieved, simplifying Streamlined the acquisition process and improved the matching effect.
Patent Information
- Application Number
- CN202410738760.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-06-07
AI Technical Summary
Existing technology cannot output natural environment sounds that match the user's current geographical location and time in real time, resulting in cumbersome playback steps and mismatched sounds.
By obtaining the synthesis coefficient and the ambient sound playback mode, the target playback time is determined, real-time environmental status information is obtained when the real-time time reaches the target playback time, the corresponding target sound data is extracted and the sound is synthesized to generate the target environmental sound.
It realizes the real-time generation of environmental sounds that match the real-time environment without the user's active acquisition, simplifies the acquisition method, and ensures the matching effect of environmental sounds and real-life environmental sounds.
Smart Images

Figure CN118314875B
Abstract
Description
Technical Field
[0001] The present application relates to the field of audio processing, and in particular to an ambient sound generation method, device and storage medium. Background Art
[0002] With the development of society, people mainly live in cities, busy with affairs between home and company, which seriously reduces the time to contact and understand nature. When people are not exposed to the natural environment for a long time, they are prone to insomnia, oversleeping, irritability or confusion, which affect their physical and mental health. Considering that the natural sounds of nature have a certain regulating effect on people's adverse emotions, such as when irritable emotions appear, listening to the sound of natural flowing water can help soothe emotions, but due to the limitations of life scenes or environments, it is impossible to obtain natural environment sounds in real time, so it is impossible to output realistic ambient sounds. Summary of the invention
[0003] In order to solve the above technical problems, the present application provides an ambient sound generation method, device and storage medium.
[0004] In a first aspect, the present application provides a method for generating ambient sound, comprising:
[0005] Get the synthesis coefficient and ambient sound playback mode;
[0006] Determining a target playback time corresponding to the ambient sound playback mode;
[0007] When the real-time time reaches the target playback time, obtaining the real-time environment status information corresponding to the real-time time;
[0008] Extracting target sound data corresponding to the real-time environmental status information from a preset database;
[0009] The target sound data and the synthesis coefficient are used to perform sound synthesis to generate the target ambient sound.
[0010] Optionally, the preset database includes a first database and a second database, and extracting the target sound data corresponding to the real-time environmental status information from the preset database includes:
[0011] Extracting, from the first database, first sound data corresponding to the real-time environmental status information;
[0012] In the second database, extracting second sound data corresponding to the real-time environmental status information;
[0013] The first sound data and the second sound data are determined as the target sound data.
[0014] Optionally, the synthesis coefficient includes a first coefficient and a second coefficient, and the step of using the target sound data and the synthesis coefficient to perform sound synthesis to generate the target ambient sound includes:
[0015] Combining the first coefficient with the first sound data in the target sound data to obtain first sound data to be synthesized;
[0016] combining the second coefficient with the second sound data in the target sound data to obtain second sound data to be synthesized;
[0017] The first sound data to be synthesized and the second sound data to be synthesized are used to perform sound synthesis to generate target ambient sound.
[0018] Optionally, the using the target sound data and the synthesis coefficient to perform sound synthesis to generate the target ambient sound includes:
[0019] Get user input sound data;
[0020] The target sound data and the synthesis coefficient are used in combination with the user input sound data to perform sound synthesis to generate the target ambient sound.
[0021] Optionally, obtaining the ambient sound playback mode includes:
[0022] In response to the mode adjustment operation, generating mode adjustment information, wherein the mode adjustment information includes a mode identifier, play time adjustment information, and coefficient adjustment information;
[0023] Determine the playback mode to be adjusted corresponding to the mode identifier;
[0024] The play mode to be adjusted is adjusted based on the play time adjustment information and the coefficient adjustment information to obtain the ambient sound play mode.
[0025] Optionally, adjusting the to-be-adjusted play mode based on the play time adjustment information and the coefficient adjustment information to obtain the ambient sound play mode includes:
[0026] Determine the play time to be adjusted and the coefficient to be adjusted corresponding to the play mode to be adjusted;
[0027] Adjust the to-be-adjusted play time based on the play time adjustment information to obtain the target play time;
[0028] Adjust the coefficient to be adjusted based on the coefficient adjustment information to obtain the synthesis coefficient;
[0029] The ambient sound playback mode is determined according to the target playback time and the synthesis coefficient.
[0030] Optionally, the acquiring the real-time environment status information corresponding to the real-time time includes:
[0031] Determine the weather information corresponding to the real-time time, and obtain the location information;
[0032] The real-time time, the location information and the weather information are determined as the real-time environmental status information.
[0033] In a second aspect, the present application provides an ambient sound generating device, comprising:
[0034] An acquisition module is used to obtain a synthesis coefficient and an ambient sound playback mode;
[0035] A determination module, used to determine a target playback time corresponding to the ambient sound playback mode;
[0036] A real-time module, used for obtaining real-time environment status information corresponding to the real-time time when the real-time time reaches the target playback time;
[0037] An extraction module, used to extract target sound data corresponding to the real-time environmental status information from a preset database;
[0038] The synthesis module is used to use the target sound data and the synthesis coefficient to perform sound synthesis to generate the target ambient sound.
[0039] In a third aspect, an electronic device is provided, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0040] Memory, used to store computer programs;
[0041] The processor is used to implement the ambient sound generation method described in any one of the first aspects when executing the program stored in the memory.
[0042] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method for generating ambient sound as described in any one of the first aspects is implemented.
[0043] The embodiment of the present application obtains a synthesis coefficient and an ambient sound playback mode, and determines a target playback time corresponding to the ambient sound playback mode. When the real-time time reaches the target playback time, the real-time environmental status information corresponding to the real-time time is obtained, so as to extract the target sound data corresponding to the real-time environmental status information in a preset database, and then uses the target sound data and the synthesis coefficient to perform sound synthesis to generate the target ambient sound, so that the target ambient sound can be used to output the realistic ambient sound in the future, giving the user an experience of being in nature, thereby achieving the purpose of generating realistic ambient sound and solving the problem that the existing environment cannot output realistic ambient sound. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0046] Figure 1 A schematic diagram of a flow chart of an ambient sound generation method provided in an embodiment of the present application;
[0047] Figure 2 A schematic diagram of an application scenario of an ambient sound generation method provided in an embodiment of the present application;
[0048] Figure 3 A schematic diagram of another application scenario of an ambient sound generation method provided in an embodiment of the present application;
[0049] Figure 4 A schematic diagram of the structure of an ambient sound generating device provided in an embodiment of the present application;
[0050] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments 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 without making creative work are within the scope of protection of this application.
[0052] The sounds of the natural environment have the effect of soothing emotions. For example, when you are in an irritable mood, if you can listen to various natural environment sounds such as birds singing, water flowing, hawking, footsteps, insects chirping, wind, water drops, etc., it will have a soothing effect on your emotions. However, nowadays, people usually have fewer opportunities to come into contact with the natural environment, which means that adverse situations are prone to occur, especially before going to bed or when waking up, when emotions are difficult to control. In existing traditional technical means, usually only pre-recorded natural environment sounds can be played for users to select and listen to. Although this method can provide users with natural environment sounds, there are at least two problems. On the one hand, users are required to actively obtain them, such as downloading and playing, which means that there is a problem of cumbersome playing steps. On the other hand, different geographical locations and different dates and times will have different natural environment sounds. At this time, the pre-recorded natural environment sounds played will not correspond to the user's current geographical location or date and time, resulting in a mismatch between the natural environment sounds and the actual environment sounds.
[0053] In order to solve the problem that only pre-recorded natural environment sounds can be played in the prior art solutions, and there are cumbersome playback steps and the problem that the sound does not match the actual environment sound, the embodiments of the present application provide an environment sound generation method, device and storage medium, by obtaining a synthesis coefficient and an environment sound playback mode, and determining a target playback time corresponding to the environment sound playback mode, when the real-time time reaches the target playback time, the real-time environment status information corresponding to the real-time time is obtained, so as to extract the target sound data corresponding to the real-time environment status information in a preset database, and then use the target sound data and the synthesis coefficient to perform sound synthesis to generate the target environment sound, so that the target environment sound can be used to output the real-life environment sound in the future, giving the user an experience of being in nature, thereby achieving the purpose of generating the real-life environment sound, solving the problem that the real-life environment sound cannot be output in the prior art solutions; and there is no need for the user to actively obtain it, which simplifies the method of obtaining the target environment sound, and the target environment sound corresponds to the real-time environment status information, so as to achieve the effect of matching the target environment sound with the actual environment sound.
[0054] Figure 1 A flowchart of an ambient sound generation method provided in an embodiment of the present application.
[0055] like Figure 1 As shown, the present application discloses an embodiment, providing an ambient sound generation method, which may include the following steps:
[0056] Step S110: Obtain synthesis coefficient and ambient sound playback mode.
[0057] Specifically, the ambient sound generation method of this embodiment can be applied to subjects with audio output capabilities such as televisions, clients, television terminals, and audio playback devices, and the ambient sound playback mode is used to indicate that the subject currently with audio output capabilities turns on the ambient sound playback mode, and the playback mode can be a night sleep mode, a morning wake-up mode, a user manual setting mode, etc.; the synthesis coefficient represents the coefficient applied in the process of synthesizing ambient sound. Different ambient sound playback modes can correspond to the same or different synthesis coefficients, that is, the synthesis coefficient can be a one-to-one correspondence with the ambient sound playback mode, or each mode can adopt a unified ambient sound playback mode, or the ambient sound playback mode can be adaptively adjusted according to the specific application scenario. Of course, other methods can also be used, and this embodiment does not make specific limitations on this.
[0058] In one example, a television is used as an example for explanation. When the television is turned on, it can be detected whether the television currently has an on playback mode. If there is an on playback mode, the on playback mode is determined as the ambient sound playback mode. For example, the pre-configured playback modes of the television include a night sleep mode and a morning wake-up mode. At this time, it is detected that the currently on playback mode of the subject with audio output capability is the night sleep mode. At this time, the night sleep mode is determined as the ambient sound playback mode. Of course, other methods of obtaining the ambient sound playback mode of the subject with audio output capability can also be used, and this embodiment does not make specific limitations on this.
[0059] Step S120: Determine the target playback time corresponding to the ambient sound playback mode.
[0060] Specifically, after obtaining the ambient sound playback mode, the target playback time and synthesis coefficient corresponding to the ambient sound playback mode can be determined, where the target playback time represents the time for playing the ambient sound, and different ambient sound playback modes can correspond to the same or different target playback times; for example, the target playback time corresponding to ambient sound playback mode A is 8 o'clock, and the synthesis coefficients are K1, K2, and K3, while the target playback time corresponding to ambient sound playback mode B is 8 o'clock, and the synthesis coefficients are K1', K2', and K3'; the above is only an example for illustration and is not specifically limited in this embodiment.
[0061] Step S130: when the real time reaches the target playback time, real-time environment status information corresponding to the real time is obtained.
[0062] Specifically, after determining the target playback time corresponding to the ambient sound playback mode, the real-time time can be collected in real time. The real-time time represents the real-time time of the subject that currently has audio output capability, and it is judged whether the real-time time reaches the target playback time. If the real-time time does not reach the target playback time, it can be determined that the ambient sound does not need to be played at present, and the real-time time can continue to be collected for judgment. If the real-time time reaches the target playback time, it can be determined that the ambient sound needs to be played at present. At this time, the real-time environmental status information corresponding to the real-time time can be obtained. The real-time environmental status information represents the status information of the environment of the subject with audio output capability that is currently collected, such as time, date, geographic location and other information.
[0063] In one example, the status information type in the real-time environmental status information can be pre-configured. For example, the status information type in the pre-configured real-time environmental status information includes time and date type status information and geographic location type status information. When the real-time time of the subject with audio output capability reaches the target playback time, the time and date status information and geographic location status information of the environment in which the subject with audio output capability is located can be obtained, and the time and date status information and geographic location status information can be used as the real-time environmental status information. Of course, the status information in the real-time environmental status information can also be manually adjusted or adaptively automatically adjusted according to specific needs, and this embodiment does not make specific limitations on this.
[0064] Step S140: extracting target sound data corresponding to the real-time environmental status information from a preset database.
[0065] Specifically, after determining the real-time environmental status information, the target sound data corresponding to the real-time environmental status information can be extracted from the preset database, where the preset database represents one or more sound databases that are pre-configured and updated in real time, such as a climate sound library, a geographical terrain sound library, a cultural customs sound library, a species sound library, etc., that is, the preset database may contain one or more sound data; the target sound data represents the sound data that matches the real-time environmental status information in the preset database, that is, the process of extracting the target sound data may be to match the real-time environmental status information with the sound data in the preset database, and determine the sound data that matches the real-time environmental status information as the target sound data. It should be noted that the target sound data in this embodiment may include one or more sound data, and each sound data may be extracted from different preset data.
[0066] In one example, the sound data in the preset database includes an environment identifier, which is used to identify the environment corresponding to the sound data. For example, when the preset database is a climate sound library, the sound data in the climate sound library includes climate sounds and environment identifiers corresponding to the climate sounds. The environment identifier can be a date identifier and a location identifier. The date identifier is used to identify the date corresponding to the climate sound, and the location identifier is used to identify the location corresponding to the climate sound; and the environment identifier matches the real-time environmental status information. For example, when the real-time environmental status information includes time, date, and geographic location, the environment identifier includes a date identifier and a location identifier, so that the target sound data matching the real-time environmental status information can be extracted from the preset database based on the time, date, geographic location, and the matching relationship between the date identifier and the location identifier.
[0067] Step S150: Using the target sound data and the synthesis coefficient, perform sound synthesis to generate the target ambient sound.
[0068] Specifically, after determining the target sound data, the target sound data and the synthesis coefficient can be used to perform sound synthesis to generate the target ambient sound, wherein the sound synthesis method can be synthesized by using a pre-trained neural network model or a computing model; it should be noted that, in this embodiment, the number of sound data in the target sound data matches the number of coefficients in the synthesis coefficient, and the specific matching method can be a one-to-one matching method or a one-to-many matching method. Taking one-to-one matching as an example, the number of sound data in the target sound data is 3, including sound data A, sound data B, and sound data C, and the number of coefficients in the synthesis coefficient is also 3, including synthesis coefficient A', synthesis coefficient B', and synthesis coefficient C'. At this time, the sound data A can be combined with the synthesis coefficient A', the sound data B can be combined with the synthesis coefficient B', and the sound data C can be combined with the synthesis coefficient C'. The sound data and the synthesis coefficient are combined one by one to perform sound synthesis to generate the target ambient sound, and the target ambient sound can be played by a subject with audio output capability, thereby playing the target ambient sound at the target playback time.
[0069] This embodiment obtains the ambient sound playback mode and determines the target playback time corresponding to the synthesis coefficient and the ambient sound playback mode. When the real-time time reaches the target playback time, the real-time environmental status information corresponding to the real-time time is obtained, so as to extract the target sound data corresponding to the real-time environmental status information in the preset database. Since the extracted target sound data corresponds to the real-time environmental status information, the problem of the subsequently generated ambient sound not matching the real-time environment can be avoided, and the target sound data is matched with the real-time environmental status information. Subsequently, the target sound data and the synthesis coefficient are used to perform sound synthesis to generate the target ambient sound, so as to achieve the purpose of generating the target ambient sound corresponding to the real-time environmental status information in real time, so as to soothe the emotions and solve the problem of adverse emotions that are prone to occur when the user has not been in contact with nature for a long time or has not listened to the natural environmental sounds. Moreover, there is no need for the user to actively obtain the target ambient sound, which simplifies the method of obtaining the target ambient sound. In addition, the target ambient sound corresponds to the real-time environmental status information, so as to achieve the effect of matching the target ambient sound with the real-time environment.
[0070] In an optional embodiment of the present application, step S130 obtains the real-time environment status information corresponding to the real-time time, which may specifically include the following sub-steps: obtaining location information;
[0071] Generate real-time environmental status information based on real-time time and location information.
[0072] In this embodiment, when the real-time time reaches the target playback time, the position information can be obtained. The position information represents the information of the position of the subject with audio output capability, so that the real-time environmental status information can be generated based on the real-time time and the position information, so that the real-time environmental status information can be used to indicate the status information of the environment in which the subject with audio output capability is located, such as time, position, etc. The target environmental sound subsequently generated based on the real-time environmental status information can make the target environmental sound correspond to the real-time environmental status information, thereby achieving the effect of matching the target environmental sound with the actual environmental sound.
[0073] In an optional embodiment of the present application, generating real-time environmental status information based on real-time time and location information may specifically include the following sub-steps: determining weather information corresponding to the real-time time;
[0074] The real-time time, location information and weather information are determined as the real-time environmental status information.
[0075] In this embodiment, after obtaining the location information, the weather information corresponding to the real-time time can be determined, and the real-time time, location information and weather information can be determined as the real-time environmental status information, and then in the preset database, the target sound data corresponding to the real-time time, location information and weather information can be extracted, so that the target sound data is sound data closely related to the environment in which the subject with audio output capability is located, which can avoid the problem of subsequently generated environmental sounds not matching the real-time environment, and plays a role in pairing and matching the target sound data with the real-time environmental status information; then the target sound data and the synthesis coefficient are used to perform sound synthesis to generate the target environmental sound, so as to achieve the purpose of real-time generation of the target environmental sound corresponding to the real-time environmental status information, so as to soothe emotions and solve the problem of adverse emotions that are prone to occur when the user has not been in contact with nature for a long time or has not listened to the natural environment sounds; and there is no need for the user to actively obtain it, which simplifies the method of obtaining the target environmental sound, and the target environmental sound corresponds to the real-time environmental status information, thereby achieving the effect of matching the target environmental sound with the real-time environment.
[0076] In one example, a television is used as an example to illustrate that the ambient sound playback mode of the television is obtained as a night sleep mode. At this time, the target playback time corresponding to the night sleep mode is determined to be 22:00, and the synthesis coefficients are K1, K2....KM. When the real-time time of the television reaches 22:00, the real-time environmental status information corresponding to 22:00 is obtained, that is, the date Q, location information W and weather information E of the real-time time. In the preset database, the target sound data corresponding to the date Q, location information W and weather information E are extracted. For example, the climate sound data corresponding to the date Q, location information W and weather information E are extracted from the climate sound database, and the date Q, location information W and weather information E corresponding to the geographical terrain sound database are extracted. Geographical terrain sound data, using climate sound data and geographic terrain sound data, combined with synthesis coefficients K1 and K2, to perform sound synthesis and generate target ambient sound; thus, the target ambient sound corresponding to the real-time time, location information and weather information can be generated in real time, that is, the target ambient sound can match the specific environment of different time, different location and different weather in real time, and there is no need for users to actively obtain it, but it is generated in real time according to the ambient sound playback mode, thereby simplifying the acquisition method of the target ambient sound, and the target ambient sound corresponds to the real-time environmental status information, achieving the effect of matching the target ambient sound with the real-time environment; that is, the TV can generate and play the corresponding target ambient sound according to the actual external environment status of the local day. Among them, the target ambient sound can include various natural sounds such as bird sounds, water flow sounds, hawking sounds, footsteps, insect sounds, wind sounds, water drops, etc.; according to different ambient sound playback modes, at different target playback times, such as every morning or night, the local natural ecological target sound data of the day can be obtained through the preset database, and these target sound data are played after sound synthesis, so as to give users the experience of being in nature.
[0077] In an optional embodiment of the present application, the preset database includes a first database and a second database. Step S140 extracts target sound data corresponding to the real-time environmental status information in the preset database, which may specifically include the following sub-steps: in the first database, extracting the first sound data corresponding to the real-time environmental status information; in the second database, extracting the second sound data corresponding to the real-time environmental status information; and determining the first sound data and the second sound data as target sound data.
[0078] In this embodiment, the first database and the second database included in the preset database represent different sound databases, for example, the first database is a climate sound database, and the second database is a geographic terrain sound database; at this time, the specific method of extracting the target sound data corresponding to the real-time environmental status information may be to extract the first sound data corresponding to the real-time environmental status information in the first database, and to extract the second sound data corresponding to the real-time environmental status information in the second database, and determine the first sound data and the second sound data as target sound data. Of course, the preset database may also include three, four or more different sound databases, and the above-mentioned process of extracting sound data is performed for each sound data, and the sound data extracted from each sound data is used as the target sound data, that is, the target sound data may include multiple sound data.
[0079] In an optional embodiment of the present application, the synthesis coefficient includes a first coefficient and a second coefficient. Step S150 uses the target sound data and the synthesis coefficient to perform sound synthesis to generate the target ambient sound. Specifically, it may include the following sub-steps: combining the first coefficient with the first sound data in the target sound data to obtain the first sound data to be synthesized; combining the second coefficient with the second sound data in the target sound data to obtain the second sound data to be synthesized; using the first sound data to be synthesized and the second sound data to be synthesized to perform sound synthesis to generate the target ambient sound.
[0080] The first coefficient and the second coefficient included in the synthesis coefficient in this embodiment represent coefficients used to match different sound data, for example, the first coefficient is used to match the first sound data, and the second coefficient is used to match the second sound data; in the process of using the target sound data and the synthesis coefficient to perform sound synthesis, the first coefficient that matches each other can be combined with the first sound data in the target sound data to obtain the first sound data to be synthesized, and the second coefficient that matches each other can be combined with the second sound data in the target sound data to obtain the second sound data to be synthesized; then the first sound data to be synthesized and the second sound data to be synthesized are used to perform sound synthesis to generate the target ambient sound. Of course, the corresponding relationship between multiple sound data and multiple coefficients can also be used to combine and generate multiple sound data to be synthesized. The sound data and the coefficients can have a one-to-one correspondence, a one-to-many correspondence, a many-to-one correspondence, and the like; and the method of combining the coefficients with the sound data to obtain the sound data to be synthesized can be a linear combination or a formula combination, which is not specifically limited in this embodiment; and the method of synthesizing the first sound data to be synthesized and the second sound data to be synthesized to generate the target ambient sound can be synthesized by using a pre-trained neural network model or a calculation model.
[0081] In one example, the synthesis coefficient includes a first coefficient that is a climate coefficient and a second coefficient that is a geographic terrain coefficient. The target sound data includes first sound data that is climate sound data and second sound data that is geographic terrain sound data. The following formula can be used as reference: w represents the synthesis coefficient, x represents the target sound data, n represents the climate or geographic terrain, k and b are adjustment coefficients, and Y is the target ambient sound. That is, w1*x1 represents the first sound data to be synthesized obtained by multiplying the climate coefficient with the climate sound data, w2*x2 represents the second sound data to be synthesized obtained by multiplying the geographic terrain coefficient with the geographic terrain sound data, and Y represents the first sound data to be synthesized and the second sound data to be synthesized by linear addition to generate the target ambient sound. Of course, the specific implementation may include multiple sound data and multiple synthesis coefficients, such as Figure 3 As shown, the target sound data may include climate sound data X1, geographical terrain sound data X2, cultural customs sound data X3, species sound data X4, preset sound data X5, user feedback sound data X6, other sound data Xm, etc., and the synthesis coefficient may include W1, W2, .....Wm.
[0082] Y=k +b
[0083] In an optional embodiment of the present application, step S150 uses the target sound data and the synthesis coefficient to perform sound synthesis to generate the target ambient sound, which may specifically include the following sub-steps: obtaining the user input sound data; using the target sound data and the synthesis coefficient, combined with the user input sound data, to perform sound synthesis to generate the target ambient sound.
[0084] In this embodiment, in specific applications, due to the different sound requirements and usage scenarios of different users, there may be a situation where the user needs to add certain specific sound data in the process of generating the target ambient sound. At this time, it can be checked whether the user input sound data is received. The user input sound data represents the sound data input by the user. At this time, in the process of generating the target ambient sound, the target sound data and the synthesis coefficient can be used as the basis, and then combined with the user input sound data to perform sound synthesis to generate the target ambient sound, so that the generated target ambient sound can include the user input sound data, thereby meeting the scenarios where different users have specific sound data requirements.
[0085] In an optional embodiment of the present application, step S110 obtains the ambient sound playback mode, which may specifically include the following sub-steps: in response to the mode adjustment operation, generating mode adjustment information, the mode adjustment information including a mode identifier, playback time adjustment information, and coefficient adjustment information; determining the playback mode to be adjusted corresponding to the mode identifier; adjusting the playback mode to be adjusted based on the playback time adjustment information and the coefficient adjustment information to obtain the ambient sound playback mode.
[0086] In this embodiment, in specific applications, due to different sound requirements and usage scenarios of different users, there may be a need to adjust the playback mode, and the playback mode is a pre-configured mode; thus, it can be checked whether the mode adjustment operation input by the user is received, and the mode adjustment operation can be output on the preset operation interface, and the preset operation interface can be as follows Figure 2 As shown; in the case of receiving a mode adjustment operation, mode adjustment information can be generated in response to the mode adjustment operation, the mode adjustment information representing the information generated by the mode adjustment operation, the mode adjustment information including a mode identifier, playback time adjustment information and coefficient adjustment information, the mode identifier representing an identifier of the playback mode corresponding to the mode adjustment operation, the playback time adjustment information representing information of the adjustment time input for the mode adjustment operation, and the coefficient adjustment information representing information of the adjustment coefficient input for the mode adjustment operation, so that the playback mode corresponding to the mode identifier can be determined as the playback mode to be adjusted, and then the playback mode to be adjusted is adjusted based on the playback time adjustment information and the coefficient adjustment information to obtain the ambient sound playback mode, thereby playing a role in adjusting the preset playback mode, so that the user can adaptively adjust each playback mode.
[0087] In an optional embodiment of the present application, adjusting the to-be-adjusted playback mode based on the playback time adjustment information and the coefficient adjustment information to obtain the ambient sound playback mode may specifically include the following sub-steps:
[0088] Determine the playback time to be adjusted and the coefficient to be adjusted corresponding to the playback mode to be adjusted;
[0089] Adjusting the play time to be adjusted based on the play time adjustment information to obtain a target play time;
[0090] The coefficient to be adjusted is adjusted based on the coefficient adjustment information to obtain a synthesis coefficient;
[0091] Determine the ambient sound playback mode based on the target playback time and synthesis coefficient.
[0092] In this embodiment, after determining the playback mode to be adjusted, the playback time to be adjusted and the coefficient to be adjusted corresponding to the playback mode to be adjusted can be determined. The playback time to be adjusted represents the time for playing the target ambient sound in the playback mode to be adjusted, and the coefficient to be adjusted represents the coefficient that needs to be combined in the process of generating the target ambient sound. Thus, the playback time to be adjusted can be adjusted based on the playback time adjustment information to obtain the target playback time, and the coefficient to be adjusted can be adjusted based on the coefficient adjustment information to obtain the synthesis coefficient, which plays a role in adjusting the playback time to be adjusted corresponding to the playback mode to be adjusted. Subsequently, the ambient sound playback mode can be determined based on the target playback time and the synthesis coefficient.
[0093] In one example, a television is used as an example for explanation. The television is pre-configured with playback mode A and playback mode B. At this time, the user inputs a mode adjustment operation according to demand, thereby generating mode adjustment information in response to the mode adjustment operation. The mode adjustment information includes a mode identifier A, playback time adjustment information for adjusting the playback time from 9 o'clock to 8 o'clock, and coefficient adjustment information for adjusting the synthesis coefficient from n to m. At this time, playback mode A can be determined as the playback mode to be adjusted based on mode identifier A, and the playback time to be adjusted corresponding to playback mode A is determined to be 8 o'clock and the coefficient to be adjusted is n. Based on the playback time adjustment information and the coefficient adjustment information, the playback time to be adjusted 8 o'clock of playback mode A is adjusted to the target playback time 8 o'clock. Based on the coefficient adjustment information, the coefficient to be adjusted n is adjusted to obtain the synthesis coefficient m, and then the ambient sound playback mode is determined based on the target playback time 8 o'clock and the synthesis coefficient m. This plays a role in adjusting the pre-configured playback mode according to the mode adjustment operation, thereby improving the flexibility of the ambient sound playback mode.
[0094] like Figure 4 As shown, the present application also discloses an embodiment, providing an ambient sound generating device, including:
[0095] An acquisition module 410 is used to acquire a synthesis coefficient and an ambient sound playing mode;
[0096] A determination module 420 is used to determine a target playback time corresponding to the ambient sound playback mode;
[0097] The real-time module 430 is used to obtain the real-time environment status information corresponding to the real-time time when the real-time time reaches the target playback time;
[0098] An extraction module 430 is used to extract target sound data corresponding to the real-time environmental status information from a preset database;
[0099] The synthesis module 450 is used to use the target sound data and the synthesis coefficient to perform sound synthesis to generate the target ambient sound.
[0100] In an optional embodiment of the present application, the preset database includes a first database and a second database, and the extraction module 430 may include:
[0101] A first extraction unit, configured to extract first sound data corresponding to the real-time environmental status information from the first database;
[0102] A second extraction unit, configured to extract second sound data corresponding to the real-time environmental status information from the second database;
[0103] The first determining unit is configured to determine the first sound data and the second sound data as the target sound data.
[0104] In an optional embodiment of the present application, the synthesis coefficient includes a first coefficient and a second coefficient, and the synthesis module 450 may include:
[0105] a first combining unit, configured to combine the first coefficient with the first sound data in the target sound data to obtain first sound data to be synthesized;
[0106] a second combining unit, configured to combine the second coefficient with the second sound data in the target sound data to obtain second sound data to be synthesized;
[0107] The first synthesis unit is used to perform sound synthesis using the first sound data to be synthesized and the second sound data to be synthesized to generate target ambient sound.
[0108] In an optional embodiment of the present application, the synthesis module 450 may include:
[0109] A first acquisition unit, used to acquire user input sound data;
[0110] The third combining unit is used to use the target sound data and the synthesis coefficient, combined with the user input sound data, to perform sound synthesis to generate the target ambient sound.
[0111] In an optional embodiment of the present application, the acquisition module 410 may include:
[0112] A first response unit, configured to generate mode adjustment information in response to a mode adjustment operation, wherein the mode adjustment information includes a mode identifier, play time adjustment information, and coefficient adjustment information;
[0113] A second determining unit, configured to determine a playback mode to be adjusted corresponding to the mode identifier;
[0114] The first adjustment unit is used to adjust the to-be-adjusted playback mode based on the playback time adjustment information and the coefficient adjustment information to obtain the ambient sound playback mode.
[0115] In an optional embodiment of the present application, the first adjustment unit may include:
[0116] A first determining subunit is used to determine the to-be-adjusted play time and to-be-adjusted coefficient corresponding to the to-be-adjusted play mode;
[0117] A first adjusting subunit, configured to adjust the to-be-adjusted play time based on the play time adjustment information to obtain the target play time;
[0118] A second adjustment subunit, configured to adjust the coefficient to be adjusted based on the coefficient adjustment information to obtain the synthesis coefficient;
[0119] The second determining subunit is used to determine the ambient sound playback mode according to the target playback time and the synthesis coefficient.
[0120] In an optional embodiment of the present application, the real-time module 430 may include:
[0121] A third determining unit, used to determine the weather information corresponding to the real time and obtain location information;
[0122] The fourth determining unit is used to determine the real-time time, the location information and the weather information as the real-time environmental status information.
[0123] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.
[0124] like Figure 5 As shown, an embodiment of the present application provides an electronic device, including a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520, and the memory 530 communicate with each other through the communication bus 540;
[0125] Memory 530, for storing computer programs;
[0126] In one embodiment of the present application, the processor 510 is used to execute the program stored in the memory 530 to implement the ambient sound generation method provided by any of the aforementioned method embodiments, by obtaining the synthesis coefficient and the ambient sound playback mode, and determining the target playback time corresponding to the ambient sound playback mode. When the real-time time reaches the target playback time, the real-time environmental status information corresponding to the real-time time is obtained, so as to extract the target sound data corresponding to the real-time environmental status information from the preset database, and then use the target sound data and the synthesis coefficient to perform sound synthesis to generate the target ambient sound, so that the target ambient sound can be output through the target ambient sound to give the user an experience of being in nature, thereby achieving the purpose of generating realistic ambient sound, solving the problem that the existing technical solution cannot output realistic ambient sound; and there is no need for the user to actively obtain it, which simplifies the method of obtaining the target ambient sound, and the target ambient sound corresponds to the real-time environmental status information, achieving the effect of matching the target ambient sound with the real ambient sound.
[0127] The embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the ambient sound generation method provided by any of the aforementioned method embodiments is implemented, by obtaining a synthesis coefficient and an ambient sound playback mode, and determining a target playback time corresponding to the ambient sound playback mode, and when the real-time time reaches the target playback time, obtaining real-time environmental status information corresponding to the real-time time, so as to extract target sound data corresponding to the real-time environmental status information from a preset database, and then using the target sound data and the synthesis coefficient to perform sound synthesis to generate target ambient sound, so that the target ambient sound can be subsequently output to output a realistic ambient sound, giving the user an experience of being in nature, thereby achieving the purpose of generating realistic ambient sound, and solving the problem that the realistic ambient sound cannot be output in the prior art solution; and there is no need for the user to actively obtain it, which simplifies the method of obtaining the target ambient sound, and the target ambient sound corresponds to the real-time environmental status information, thereby achieving an effect of matching the target ambient sound with the realistic ambient sound.
[0128] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including 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, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0129] The above describes specific embodiments of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0130] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A method for generating ambient sound, It is characterized in that include: Get the synthesis coefficient and ambient sound playback mode; Determining a target playback time corresponding to the ambient sound playback mode; When the real-time time reaches the target playback time, obtaining the real-time environment status information corresponding to the real-time time; Extracting target sound data corresponding to the real-time environmental status information from a preset database; Using the target sound data and the synthesis coefficient, performing sound synthesis to generate target ambient sound; The obtaining of the ambient sound playing mode includes: In response to the mode adjustment operation, generating mode adjustment information, wherein the mode adjustment information includes a mode identifier, play time adjustment information, and coefficient adjustment information; Determine the playback mode to be adjusted corresponding to the mode identifier; The play mode to be adjusted is adjusted based on the play time adjustment information and the coefficient adjustment information to obtain the ambient sound play mode.
2. The method for generating ambient sound according to claim 1, It is characterized in that The obtaining of the real-time environment status information corresponding to the real-time time includes: Get location information; The real-time environment status information is generated according to the real-time time and the location information.
3. The method for generating ambient sound according to claim 2, It is characterized in that The generating the real-time environment status information according to the real-time time and the location information includes: Determining weather information corresponding to the real-time time; The real-time time, the location information and the weather information are determined as the real-time environmental status information.
4. The method for generating ambient sound according to claim 1, It is characterized in that The preset database includes a first database and a second database, and extracting target sound data corresponding to the real-time environmental status information from the preset database includes: Extracting, from the first database, first sound data corresponding to the real-time environmental status information; In the second database, extracting second sound data corresponding to the real-time environmental status information; The first sound data and the second sound data are determined as the target sound data.
5. The method for generating ambient sound according to claim 4, It is characterized in that The synthesis coefficient includes a first coefficient and a second coefficient, and the target sound data and the synthesis coefficient are used to perform sound synthesis to generate the target ambient sound, including: Combining the first coefficient with the first sound data in the target sound data to obtain first sound data to be synthesized; combining the second coefficient with the second sound data in the target sound data to obtain second sound data to be synthesized; The first sound data to be synthesized and the second sound data to be synthesized are used to perform sound synthesis to generate target ambient sound.
6. The method for generating ambient sound according to claim 1, It is characterized in that The step of using the target sound data and the synthesis coefficient to perform sound synthesis to generate the target ambient sound includes: Get user input sound data; The target sound data and the synthesis coefficient are used in combination with the user input sound data to perform sound synthesis to generate the target ambient sound.
7. The method for generating ambient sound according to claim 1, It is characterized in that The step of adjusting the to-be-adjusted play mode based on the play time adjustment information and the coefficient adjustment information to obtain the ambient sound play mode includes: Determine the play time to be adjusted and the coefficient to be adjusted corresponding to the play mode to be adjusted; Adjust the to-be-adjusted play time based on the play time adjustment information to obtain the target play time; Adjust the coefficient to be adjusted based on the coefficient adjustment information to obtain the synthesis coefficient; The ambient sound playback mode is determined according to the target playback time and the synthesis coefficient.
8. An ambient sound generating device, It is characterized in that include: An acquisition module is used to obtain a synthesis coefficient and an ambient sound playback mode; A determination module, used to determine a target playback time corresponding to the ambient sound playback mode; A real-time module, used for obtaining real-time environment status information corresponding to the real-time time when the real-time time reaches the target playback time; An extraction module, used to extract target sound data corresponding to the real-time environmental status information from a preset database; A synthesis module, used to perform sound synthesis using the target sound data and the synthesis coefficient to generate a target ambient sound; The acquisition modules include: A first response unit, configured to generate mode adjustment information in response to a mode adjustment operation, wherein the mode adjustment information includes a mode identifier, play time adjustment information, and coefficient adjustment information; A second determining unit, configured to determine a playback mode to be adjusted corresponding to the mode identifier; The first adjustment unit is used to adjust the to-be-adjusted playback mode based on the playback time adjustment information and the coefficient adjustment information to obtain the ambient sound playback mode.
9. An electronic device, It is characterized in that It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; The processor is used to implement the ambient sound generation method described in any one of claims 1-7 when executing the program stored in the memory.
