Method and device for realizing directional recording, electronic equipment and storage medium
By using a preset camera in the recording device to identify the outdoor environment type and adjust the recording mode, the problem of the inability to optimize recording for different environments in the prior art is solved, and the recording quality is improved.
Patent Information
- Application Number
- CN202411469047.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2025-02-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing recording equipment cannot be optimized for different outdoor environments, resulting in poor recording quality.
The preset camera obtains the environment image of the outdoor environment where the user is located, recognizes the environment type, and obtains the corresponding target recording mode in the preset recording mode database, and adjusts the audio parameters to adapt to different environments.
It realizes recording of different recording modes according to the different outdoor environments where the user is located, and improves the recording quality.
Smart Images

Figure CN119446201A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of recording equipment, and in particular to a method, device, electronic device and storage medium for implementing directional recording. Background Art
[0002] Recording equipment is a device used to capture sound and convert it into electrical signals. They typically include a microphone, pre-processing circuitry, and converters to convert the sound signal to digital or analog. Recording equipment can range from professional-grade studio equipment to portable personal recording devices like smartphones or voice recorders.
[0003] Existing recording equipment already has environmental adaptability features, such as automatic gain control (AGC) to adjust volume, noise suppression algorithms to reduce background noise, and reverberation cancellation technology to handle echoes. However, these features may not be precise enough. When users record outdoors, they may record in a variety of different outdoor environments, such as forests, beaches, or city streets. Using these methods alone cannot optimize recording for different specific environments, resulting in poor recording quality.
[0004] Therefore, there is an urgent need for a method, device, electronic device and storage medium for achieving directional recording. Summary of the Invention
[0005] The present application provides a method, device, electronic device and storage medium for implementing directional recording, which solves the problem of poor recording quality caused by the inability to optimize recording for different specific environments.
[0006] In a first aspect of the present application, a method for implementing directional recording is provided, the method comprising: in response to a user's recording operation, obtaining an environmental image corresponding to the user's outdoor environment through a preset camera; obtaining a target environment type corresponding to the outdoor environment based on the environmental image; obtaining a target recording mode corresponding to the target environment type in a preset recording mode database, the preset recording mode database being used to store the correspondence between the target environment type and the target recording mode; obtaining a first audio, and performing an audio parameter adjustment operation on the first audio according to the target recording mode to obtain a second audio; and saving the second audio to complete the recording operation.
[0007] By adopting the above technical solution, when the user performs a recording operation, an environmental image corresponding to the outdoor environment in which the user is located is obtained through a preset camera, and based on the environmental image, a target environment type corresponding to the outdoor environment is obtained, and then a target recording mode corresponding to the target environment type is obtained in a preset recording mode database. The preset recording mode database is used to store the correspondence between the target environment type and the target recording mode, obtain a first audio, and adjust the audio parameters of the first audio according to the target recording mode to obtain a second audio, and save the second audio to complete the recording operation, so that different recording modes are recorded according to the different outdoor environments in which the user is located, and the parameters of the obtained audio file are adjusted according to different recording modes, so as to solve the problem that the recording cannot be optimized for different specific environments, and thus there will be poor recording quality.
[0008] Optionally, based on the environmental image, the target environment type corresponding to the outdoor environment is obtained, specifically including: obtaining multiple environmental features in the environmental image, the multiple environmental features including scenery type features, color features and terrain features; based on the multiple environmental features, obtaining the target environment type corresponding to the outdoor environment.
[0009] By adopting the above technical solution, multiple environmental features in the environmental image are obtained, and the multiple environmental features include scene type features, color features and terrain features, so that the target environment type corresponding to the outdoor environment can be obtained based on the multiple environmental features, and then the target recording mode corresponding to the target environment type is obtained in the preset recording mode database.
[0010] Optionally, in the preset recording mode database, before obtaining the target recording mode corresponding to the target environment type, a preset recording mode database is constructed, specifically including: obtaining multiple preset outdoor environment types, the multiple preset outdoor environment types include urban environment types, woodland environment types and coastal environment types, and the multiple preset outdoor environment types include the target environment type; setting multiple preset recording modes corresponding to the multiple preset outdoor environment types, one preset outdoor environment corresponds to one preset recording mode, and the multiple preset recording modes include the target recording mode; storing the correspondence between the multiple preset outdoor environment types and the multiple preset recording modes in the preset recording mode database.
[0011] By adopting the above technical solution, multiple preset outdoor environment types are obtained, and the multiple preset outdoor environment types include urban environment types, forest environment types and coastal environment types. The multiple preset outdoor environment types include target environment types, so that multiple preset recording modes corresponding to the multiple preset outdoor environment types are set, one preset outdoor environment corresponds to one preset recording mode, and the multiple preset recording modes include target recording modes. The correspondence between the multiple preset outdoor environment types and the multiple preset recording modes is stored in a preset recording mode database, so that when the target environment type corresponding to the outdoor environment is obtained, the target recording mode corresponding to the target environment type can be obtained according to the correspondence in the preset recording mode database.
[0012] Optionally, obtaining the first audio specifically includes: obtaining first user audio, where the first user audio is the sound emitted by the user; obtaining first environmental audio, where the first environmental audio is the sound in the outdoor environment where the user is located; and using the first user audio and the first environmental audio as the first audio.
[0013] By adopting the above technical solution, the first user audio is obtained, which is the sound emitted by the user, and the first environmental audio is obtained, which is the sound in the outdoor environment where the user is located, so that the first user audio and the first environmental audio are used as the first audio.
[0014] Optionally, an audio parameter adjustment operation is performed on the first audio according to the target recording mode to obtain the second audio, specifically including: performing an audio parameter adjustment operation on the first user audio according to the user audio parameter adjustment model and the target recording mode to obtain the second user audio, performing an audio parameter adjustment operation on the first environment audio according to the environment audio parameter adjustment model and the target recording mode to obtain the second environment audio; and using the second user audio and the second environment audio as the second audio.
[0015] By adopting the above-mentioned technical solution, an audio parameter adjustment operation is performed on the first user audio according to the user audio parameter adjustment model and the target recording mode to obtain the second user audio, and an audio parameter adjustment operation is performed on the first environment audio according to the environment audio parameter adjustment model and the target recording mode to obtain the second environment audio, so as to use the second user audio and the second environment audio as the second audio.
[0016] Optionally, obtaining the first user audio specifically includes: determining whether the user is within the shooting range of a preset camera; if the user is within the shooting range of the preset camera, obtaining the corresponding lip movement features of the user according to the preset camera; obtaining the target user audio to be confirmed in the first audio, the target user audio to be confirmed is any audio segment in the first audio; obtaining the matching value between the lip movement features and the target user audio to be confirmed; if the matching value is greater than the preset matching value, confirming that the target user audio to be confirmed is the first user audio.
[0017] By adopting the above technical solution, it is determined whether the user is within the shooting range of the preset camera. If the user is within the shooting range of the preset camera, the lip movement features corresponding to the user are obtained according to the preset camera, and the target user audio to be confirmed is obtained in the first audio. The target user audio to be confirmed is any audio segment in the first audio, so that according to the matching value between the obtained lip movement features and the target user audio to be confirmed, when the matching value is greater than the preset matching value, the target user audio to be confirmed is confirmed to be the first user audio.
[0018] Optionally, after determining whether the user is within the shooting range of the camera, the method also includes: if the user is not within the shooting range of the preset camera, obtaining the target sound feature corresponding to the user in the preset sound source database, the preset sound source database is used to save the correspondence between the user and the target sound feature; obtaining the similarity value between the target sound feature and the target user audio to be confirmed; if it is determined that the similarity value is greater than the preset similarity value, confirming that the target user audio to be confirmed is the first user audio.
[0019] By adopting the above technical solution, if the user is not within the shooting range of the preset camera, the target sound feature corresponding to the user is obtained in the preset sound source database. The preset sound source database is used to save the correspondence between the user and the target sound feature, so that after obtaining the similarity value between the target sound feature and the target user audio to be confirmed, if it is judged that the similarity value is greater than the preset similarity value, the target user audio to be confirmed is confirmed to be the first user audio.
[0020] In a second aspect of the present application, a device for implementing directional recording is provided, the device comprising an acquisition module and a processing module, wherein: The acquisition module is used to respond to the user's recording operation and obtain the environmental image corresponding to the user's outdoor environment through a preset camera; based on the environmental image, obtain the target environment type corresponding to the outdoor environment; and obtain the target recording mode corresponding to the target environment type from the preset recording mode database. The preset recording mode database is used to store the correspondence between the target environment type and the target recording mode.
[0021] The processing module is used to obtain the first audio, and adjust the audio parameters of the first audio according to the target recording mode to obtain the second audio; and save the second audio to complete the recording operation.
[0022] In the third aspect of the present application, an electronic device is provided, including a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device performs any of the methods described above.
[0023] In a fourth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to perform any of the above methods.
[0024] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages: 1. When the user performs a recording operation, an environmental image corresponding to the outdoor environment in which the user is located is obtained through a preset camera, and based on the environmental image, a target environment type corresponding to the outdoor environment is obtained, and then a target recording mode corresponding to the target environment type is obtained in a preset recording mode database. The preset recording mode database is used to store the correspondence between the target environment type and the target recording mode, obtain a first audio, and adjust the audio parameters of the first audio according to the target recording mode to obtain a second audio, and save the second audio to complete the recording operation, so as to perform recordings in different recording modes according to the different outdoor environments in which the user is located, and adjust the parameters of the obtained audio file according to different recording modes, so as to solve the problem that the recording cannot be optimized for different specific environments, and thus there will be poor recording quality.
[0025] 2. According to the user audio parameter adjustment model and the target recording mode, perform an audio parameter adjustment operation on the first user audio to obtain the second user audio, and according to the environmental audio parameter adjustment model and the target recording mode, perform an audio parameter adjustment operation on the first environmental audio to obtain the second environmental audio, so as to use the second user audio and the second environmental audio as the second audio.
[0026] 3. Determine whether the user is within the shooting range of the preset camera. If the user is within the shooting range of the preset camera, obtain the user's corresponding lip movement features based on the preset camera, and obtain the target user audio to be confirmed in the first audio. The target user audio to be confirmed is any audio segment in the first audio, so as to obtain a matching value between the obtained lip movement features and the target user audio to be confirmed. When the matching value is greater than the preset matching value, the target user audio to be confirmed is confirmed to be the first user audio. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 This is a flow chart of a method for implementing directional recording provided by an embodiment of the present application; Figure 2 This is a schematic diagram of a module of a device for implementing directional recording provided by an embodiment of the present application; Figure 3 This is a structural diagram of an electronic device provided in an embodiment of the present application.
[0028] Explanation of the reference numerals: 21, acquisition module; 22, processing module; 301, processor; 302, communication bus; 303, user interface; 304, network interface; 305, memory. DETAILED DESCRIPTION
[0029] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.
[0030] The terms used in the following examples of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the specification of the present application, the singular expressions "a", "an", "said", "above", "the", and "this" are intended to include plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in the present application refers to and includes any or all possible combinations of one or more of the listed items.
[0031] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to imply or suggest relative importance or implicitly indicate the number of the technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of this application, unless otherwise specified, "plurality" means two or more.
[0032] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings.
[0033] Recording equipment is a device used to capture sound and convert it into electrical signals. They typically include a microphone, pre-processing circuitry, and converters to convert the sound signal to digital or analog. Recording equipment can range from professional-grade studio equipment to portable personal recording devices like smartphones or voice recorders.
[0034] Existing recording equipment already has environmental adaptability features, such as automatic gain control (AGC) to adjust volume, noise suppression algorithms to reduce background noise, and reverberation cancellation technology to handle echoes. However, these features may not be precise enough. When users record outdoors, they may record in a variety of different outdoor environments, such as forests, beaches, or city streets. Using these methods alone cannot optimize recording for different specific environments, resulting in poor recording quality.
[0035] Therefore, there is an urgent need for a method, device, electronic device and storage medium for achieving directional recording.
[0036] Please refer to Figure 1 , which shows a flow chart of a method for implementing directional recording provided by an embodiment of the present application. The method is applied to a recording device, and the flow chart mainly includes the following steps: S101 to S105.
[0037] Step S101 , in response to a user's recording operation, an environmental image corresponding to the user's outdoor environment is acquired through a preset camera.
[0038] Specifically, when the user is recording or broadcasting outdoors, the user needs to perform recording operations through a recording device. At this time, the recording device responds to the user's recording operation and obtains the environmental image corresponding to the outdoor environment around the user. The recording device comes with a preset camera and can obtain the environmental image around the user through the preset camera. When the user is recording or broadcasting, if the user is within the capture range of the preset camera, the preset camera can also obtain the user's facial features in real time, thereby obtaining the corresponding lip movement features based on the user's facial features.
[0039] Step S102: acquiring a target environment type corresponding to the outdoor environment according to the environment image.
[0040] Specifically, the recording device performs an image recognition operation on the environmental image corresponding to the outdoor environment surrounding the user obtained by a preset camera, and obtains the target environment type corresponding to the outdoor environment surrounding the user.
[0041] In a possible implementation, step S102 further includes: acquiring multiple environmental features in the environmental image, the multiple environmental features including scene type features, color features, and terrain features; and acquiring a target environment type corresponding to the outdoor environment based on the multiple environmental features.
[0042] Specifically, the recording device can pre-build an image recognition model to determine the target environment type corresponding to an outdoor environment. The recording device then uses the image recognition model and image processing techniques to extract multiple environmental features from the environmental image. These features are then fed into a classification algorithm, including but not limited to support vector machines (SVMs) and random forests, to determine the target environment type. The multiple features that can be extracted from the image include but are not limited to scene type features, color features, and terrain features. Scene type features identify the primary scene types in the image, such as trees, buildings, vehicles, people, and water bodies; color features analyze the primary color distribution in the image, for example, green represents vegetation, gray represents urban buildings, and blue represents sky or water bodies; and terrain features identify topographic features in the image, such as hills, plains, roads, and rivers. The recording device then uses the image recognition model to perform a comprehensive analysis of multiple environmental features to determine the target environment type. When the image recognition model determines the target environment type, it calculates the proportion of each environmental feature in the image. For example, the image recognition model calculates the pixel proportion of features such as green vegetation, buildings, and roads in an image. The image recognition model then makes decisions based on the proportion of each environmental feature. Features with a higher proportion play a greater role in determining the final environment type. In the above method, the image recognition model assigns a weight to each environmental feature. For example, the scenery type feature has the highest weight because it directly reflects the specific objects and structures in the environment, such as trees, buildings, and vehicles. These features are crucial for determining the environment type. Color features have a higher weight because they intuitively reflect the overall hue of the environment. For example, green typically represents vegetation, gray represents urban buildings, and blue represents the sky or water. Terrain features have the lowest weight because, while terrain provides information about the spatial layout of the environment, in most cases, it changes more slowly and is not as direct and obvious as scenery type and color features. Based on the feature proportions and preset weights, the image recognition model calculates a score for each possible environment type and selects the environment type with the highest score as the target environment type.
[0043] Step S103: Obtain the target recording mode corresponding to the target environment type from a preset recording mode database. The preset recording mode database is used to store the correspondence between the target environment type and the target recording mode.
[0044] Specifically, the target environment type is obtained through the image recognition model, and the recording device obtains the target recording mode corresponding to the target environment type in the preset recording mode database. The preset recording mode database is used to store the correspondence between the target environment type and the target recording mode. The target recording mode may include various audio parameter settings, such as microphone gain, noise filtering level, echo cancellation settings, etc., to adapt to the recording requirements under the target environment type.
[0045] In a possible implementation, step S103 also includes obtaining multiple preset outdoor environment types, the multiple preset outdoor environment types include urban environment types, forest environment types, and coastal environment types, and the multiple preset outdoor environment types include a target environment type; setting multiple preset recording modes corresponding to the multiple preset outdoor environment types, one preset outdoor environment corresponds to one preset recording mode, and the multiple preset recording modes include a target recording mode; and storing the correspondence between the multiple preset outdoor environment types and the multiple preset recording modes in a preset recording mode database.
[0046] Specifically, the preset recording mode database is a pre-built database used to store a large number of preset outdoor environments and a large number of preset recording modes, wherein each preset outdoor environment corresponds to a preset recording mode. The preset outdoor environments stored in the preset recording mode database are all types of outdoor environments that can be recognized by the image recognition model in step S102 above, and the preset recording modes corresponding to the preset outdoor environments are the preset recording modes that are determined through evaluation to be most suitable for the preset outdoor environments. For example, there is a preset recording mode corresponding to an urban environment type, a preset recording mode corresponding to a woodland environment type, and a preset recording mode corresponding to a coastal environment type. Moreover, in this embodiment, the preset recording modes corresponding to different preset outdoor environments can be evaluated and set in a variety of ways, including but not limited to: expert evaluation, learning model evaluation, etc., wherein, expert evaluation: audio experts evaluate based on years of experience and the sound characteristics of different environments, determine the most suitable recording mode for each preset outdoor environment, and store the correspondence between the evaluated preset recording mode and the preset outdoor environment in the preset recording mode database for easy retrieval; learning model evaluation: using a machine learning model, through training with a large amount of environmental recording data, automatically evaluate and determine the best recording mode, and store the correspondence between the evaluated preset recording mode and the preset outdoor environment in the preset recording mode database for easy retrieval.
[0047] Step S104: Acquire the first audio, and perform an audio parameter adjustment operation on the first audio according to the target recording mode to obtain the second audio.
[0048] Specifically, after the recording device determines the target recording mode to be used, the recording device is ready to start recording, obtains the first audio, and adjusts the audio parameters of the first audio according to the target recording mode, thereby obtaining the first audio after the parameters are adjusted, i.e., the second audio. In this embodiment, the timing at which the recording device starts recording can also be set. For example, after the recording device determines the target recording mode to be used, a "Start" button can pop up on the real device, and the user clicks the "Start" button to start recording; the user can input a voice command to make the recording device start recording, and the voice command input by the user can be any voice command containing a start recording signal.
[0049] In one possible implementation, step S104 also includes: obtaining first user audio, where the first user audio is the sound emitted by the user; obtaining first environmental audio, where the first environmental audio is the sound in the outdoor environment where the user is located; and using the first user audio and the first environmental audio as the first audio.
[0050] Specifically, when the recording device starts recording, it will perform corresponding processing on the first recording, that is, distinguishing the first user audio and the first environmental audio in the first recording. The first user audio is the sound emitted by the user in the first audio, and the first environmental audio is the sound in the outdoor environment where the user is located. It should be noted that in order for the recording device to be able to process the recorded audio generated by the user in real time when recording, a preset time period is set in the recording device. After each preset time period, the recording device performs corresponding processing on the recorded audio within the time period. The preset time period is 3s, 5s, 10s, etc. This embodiment does not limit the setting of the preset time period, and the first recording is the recorded audio of the user in any preset time period after the start of recording.
[0051] In a possible implementation, step S104 also includes: performing an audio parameter adjustment operation on the first user audio according to the user audio parameter adjustment model and the target recording mode to obtain the second user audio, and performing an audio parameter adjustment operation on the first environment audio according to the environment audio parameter adjustment model and the target recording mode to obtain the second environment audio; and using the second user audio and the second environment audio as the second audio.
[0052] Specifically, a user audio parameter adjustment model is obtained, and an audio parameter adjustment operation is performed on the first user audio according to the target recording mode to obtain the second user audio, and an environmental audio parameter adjustment model is used to adjust the audio parameters of the first environmental audio to obtain the second environmental audio, and the adjusted second user audio and second environmental audio are used as the second audio. In the process of the user audio parameter adjustment model and the environmental audio parameter adjustment model adjusting the first user audio and the first environmental audio respectively, it is also necessary to adjust in combination with the target recording mode. The steps of performing an audio parameter adjustment operation on the first user audio according to the user audio parameter adjustment model and the target recording mode are as follows: a user audio parameter adjustment model is pre-built and trained, which can be optimized and adjusted according to different recording environments and user voice characteristics. The first user audio obtained from the recording device is input into the user audio parameter adjustment model. The target recording mode obtained from the preset recording mode database includes the optimal audio parameter settings for the current environment (such as gain, filtering, compression, etc.). The first user audio is adjusted according to the parameters of the target recording mode. Specific adjustment operations may include: gain adjustment: adjusting the audio gain according to the ambient noise level and the user's voice intensity to ensure that the sound is clear and not over-amplified; noise filtering: applying a noise filtering algorithm to reduce the interference of background noise on the user's audio; compression processing: compressing the audio signal, balancing the volume dynamic range, and ensuring a smooth sound; equalization processing: adjusting the gain of different frequencies to optimize the clarity and naturalness of the sound. Through the above operations, the adjusted second user audio is obtained; according to the ambient audio parameter adjustment model and the target recording mode, the steps for adjusting the audio parameters of the first ambient audio are as follows: a pre-built and trained ambient audio parameter adjustment model is specially used to optimize the adjustment of ambient noise and background sound effects. The first ambient audio obtained from the recording device is input into the ambient audio parameter adjustment model. The target recording mode obtained from the preset recording mode database contains the optimal audio parameter settings for the current environment (such as background sound processing, noise filtering, etc.). The first ambient audio is adjusted according to the parameters of the target recording mode. Specific adjustments may include: Background noise processing: Using noise suppression technology to reduce unnecessary noise in the ambient audio; Echo cancellation: Applying an echo cancellation algorithm to reduce echo and reverberation in the recording environment; Spatial optimization: Adjusting the spatial sense of the audio to make the background sound more natural and layered; Frequency equalization: Based on the characteristics of the ambient audio, adjusting the gain of different frequencies to highlight important background sounds and suppress unnecessary noise. Through these operations, the adjusted second ambient audio is obtained. The adjusted second user audio and the second ambient audio are merged to ensure volume balance and frequency consistency. Mixing technology can be applied to place the user audio in the foreground and the ambient audio in the background, making the overall sound natural and harmonious.
[0053] In a possible implementation, step S104 also includes: determining whether the user is within the shooting range of a preset camera; if the user is within the shooting range of the preset camera, obtaining the corresponding lip movement features of the user according to the preset camera; obtaining the target user audio to be confirmed in the first audio, where the target user audio to be confirmed is any audio segment in the first audio; obtaining the matching value between the lip movement features and the target user audio to be confirmed; if the matching value is greater than the preset matching value, confirming that the target user audio to be confirmed is the first user audio.
[0054] Specifically, when the recording device obtains the first user audio and the first environmental audio in the first audio respectively, it can obtain the first user audio in the following manner and use the audio other than the first user audio as the first environmental audio: when the recording device is recording, the recording device uses a preset camera to determine in real time whether the user is within the shooting range of the preset camera. If the user is within the shooting range of the preset camera, the lip movement features corresponding to the user are obtained in real time according to the preset camera. The lip movement features include but are not limited to: lip shape, movement trajectory, opening and closing frequency, etc., and in the first audio recorded by the recording device, several audio segments are randomly selected or identified as the target user audio to be confirmed, and the lip movement features of the user are synchronized with the target user audio to be confirmed by using an audio and video synchronization algorithm: the target user audio to be confirmed is processed to extract audio features, such as speech spectrum, phoneme timing, etc. The user's lip movement video is processed to extract lip movement features, such as lip displacement, opening and closing degree change, etc., and dynamic time warping (DTW) or hidden Markov model (Hidden Markov Model, The method uses a synchronization algorithm such as HMM to calculate the matching value between the audio features and the video features, and sets a preset matching value threshold, i.e., the preset matching value. If the calculated matching value is greater than the preset matching value, the target user audio to be confirmed is confirmed as the first user audio. The same operation is then performed on all audio segments in the first audio except the target audio, thereby confirming all first user audio in the first audio and treating all audio segments except the first user audio as the first ambient audio. It should be noted that the preset matching value can be set based on actual recording requirements, and this embodiment does not limit the setting of the preset matching value.
[0055] In a possible implementation, step S104 also includes: if the user is not within the shooting range of the preset camera, obtaining the target sound feature corresponding to the user in the preset sound source database, the preset sound source database is used to save the correspondence between the user and the target sound feature; obtaining the similarity value between the target sound feature and the target user audio to be confirmed; if it is judged that the similarity value is greater than the preset similarity value, confirming that the target user audio to be confirmed is the first user audio.
[0056] Specifically, a real-time determination is made as to whether the user is within the shooting range of a preset camera. If the user is not within the shooting range of the preset camera, the target sound features corresponding to the user are obtained from a preset sound source database. In this case, the user needs to store their own sound features in the preset sound source database in advance, so that after the recording device confirms the user, the target sound features corresponding to the user are obtained from the preset sound source database, and the first user audio in the first audio is determined based on the target sound features. At this time, the recording device also obtains the target user audio to be confirmed and obtains multiple audio features in the target user audio to be confirmed, such as speech spectrum, phoneme timing, etc., and then calculates the similarity between the multiple audio features in the target user audio to be confirmed and the target sound features corresponding to the user. If the calculated similarity value is greater than the preset similarity value, the target user audio to be confirmed is confirmed as the first user audio. Subsequently, the same operation is performed on all audio segments in the first audio except the target audio, thereby confirming all first user audio in the first audio and treating the other audio segments except the first user audio as the first ambient audio. It should be noted that the preset similarity value can be set according to actual recording requirements, and this embodiment does not limit the setting of the preset similarity value.
[0057] Step S105: Save the second audio to complete the recording operation.
[0058] Specifically, the recording device saves the adjusted second audio file locally to complete the recording process. Based on user requirements or system presets, the recording device can select an appropriate audio file format, such as WAV, MP3, or FLAC, to ensure compatibility and sound quality across different platforms. The recording device also automatically sets a file naming convention and storage path to ensure easy file discovery and management. The naming convention can include information such as the recording date, time, and environment type, such as "20240514-parkrecording.wav." Users can modify the saved audio file, or the second audio file, after saving it. The recording tool provides audio editing tools or interfaces that allow users to perform operations such as editing, adjusting volume, and adding special effects. When saving an audio file, the recording device can also save associated metadata, including the recording time, location, environment type, and recording mode parameters. This metadata facilitates subsequent audio management and retrieval. Metadata can be embedded in the audio file's tags or saved as a separate text file or database record.
[0059] The present application adopts the above method. When the user performs a recording operation, the environmental image corresponding to the outdoor environment in which the user is located is obtained through a preset camera, and based on the environmental image, the target environment type corresponding to the outdoor environment is obtained, and then the target recording mode corresponding to the target environment type is obtained in the preset recording mode database. The preset recording mode database is used to store the correspondence between the target environment type and the target recording mode, obtain the first audio, and adjust the audio parameters of the first audio according to the target recording mode to obtain the second audio, and save the second audio to complete the recording operation, so as to perform recording in different recording modes according to the different outdoor environments in which the user is located, and adjust the parameters of the obtained audio file according to the different recording modes, so as to solve the problem that the recording cannot be optimized for different specific environments, and thus there will be poor recording quality.
[0060] Please refer to Figure 2 , which shows a module schematic diagram of a device for implementing directional recording provided by an embodiment of the present application, the device is a recording device, and the recording device includes an acquisition module 21 and a processing module 22, wherein, The acquisition module 21 is used to obtain an environmental image corresponding to the outdoor environment in which the user is located through a preset camera in response to the user's recording operation; obtain the target environment type corresponding to the outdoor environment based on the environmental image; obtain the target recording mode corresponding to the target environment type from the preset recording mode database, which is used to store the correspondence between the target environment type and the target recording mode.
[0061] The processing module 22 is configured to obtain a first audio, and perform an audio parameter adjustment operation on the first audio according to a target recording mode to obtain a second audio; and save the second audio to complete the recording operation.
[0062] In one possible implementation, the acquisition module 21 is used to obtain the target environment type corresponding to the outdoor environment based on the environmental image, specifically including: obtaining multiple environmental features in the environmental image, the multiple environmental features including scenery type features, color features, and terrain features; and obtaining the target environment type corresponding to the outdoor environment based on the multiple environmental features.
[0063] In a possible embodiment, the acquisition module 21 is used to construct a preset recording mode database before obtaining the target recording mode corresponding to the target environment type in the preset recording mode database, specifically including: obtaining multiple preset outdoor environment types, the multiple preset outdoor environment types include urban environment types, forest environment types and coastal environment types, and the multiple preset outdoor environment types include the target environment type; setting multiple preset recording modes corresponding to the multiple preset outdoor environment types, one preset outdoor environment corresponds to one preset recording mode, and the multiple preset recording modes include the target recording mode; storing the correspondence between the multiple preset outdoor environment types and the multiple preset recording modes in the preset recording mode database.
[0064] In a possible implementation, the processing module 22 is used to obtain the first audio, specifically including: obtaining the first user audio, which is the sound emitted by the user; obtaining the first environmental audio, which is the sound in the outdoor environment where the user is located; and using the first user audio and the first environmental audio as the first audio.
[0065] In a possible implementation, the processing module 22 is used to perform an audio parameter adjustment operation on the first audio according to the target recording mode to obtain the second audio, specifically including: performing an audio parameter adjustment operation on the first user audio according to the user audio parameter adjustment model and the target recording mode to obtain the second user audio, performing an audio parameter adjustment operation on the first environment audio according to the environment audio parameter adjustment model and the target recording mode to obtain the second environment audio; and using the second user audio and the second environment audio as the second audio.
[0066] In one possible implementation, the processing module 22 is used to obtain the first user audio, specifically including: determining whether the user is within the shooting range of a preset camera; if the user is within the shooting range of the preset camera, obtaining the corresponding lip movement features of the user according to the preset camera; obtaining the target user audio to be confirmed in the first audio, where the target user audio to be confirmed is any audio segment in the first audio; obtaining the matching value between the lip movement features and the target user audio to be confirmed; if the matching value is greater than the preset matching value, confirming that the target user audio to be confirmed is the first user audio.
[0067] In one possible embodiment, the processing module 22 is used to determine whether the user is within the shooting range of the camera. The method also includes: if the user is not within the shooting range of the preset camera, obtaining the target sound feature corresponding to the user in the preset sound source database, and the preset sound source database is used to save the correspondence between the user and the target sound feature; obtaining the similarity value between the target sound feature and the target user audio to be confirmed; if it is determined that the similarity value is greater than the preset similarity value, confirming that the target user audio to be confirmed is the first user audio.
[0068] It should be noted that the above embodiments provide devices that implement their functions using only the division of the above functional modules as examples. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiments are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0069] This application also provides an electronic device. Figure 3 , Figure 3 3 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. The electronic device may include: at least one processor 301, at least one communication bus 302, a user interface 303, at least one network interface 304, and a memory 305.
[0070] The communication bus 302 is used to implement the connection and communication between these components.
[0071] The user interface 303 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 303 may also include a standard wired interface and a wireless interface.
[0072] The network interface 304 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0073] The processor 301 may include one or more processing cores. Using various interfaces and circuits, the processor 301 connects to various components within the recording device. It executes instructions, programs, code sets, or instruction sets stored in the memory 305, as well as accesses data stored in the memory 305, to perform various functions of the recording device and process data. Optionally, the processor 301 may be implemented using at least one of the following hardware forms: a digital signal processing (DSP), a field-programmable gate array (FPGA), or a programmable logic array (PLA). The processor 301 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU primarily handles the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing content displayed on the display; and the modem handles wireless communications. It is understood that the modem may also be implemented independently of the processor 301 and implemented on a separate chip.
[0074] Among them, the memory 305 may include a random access memory (RAM) or a read-only memory (Read-Only Memory). Optionally, the memory 305 includes a non-transitory computer-readable storage medium. The memory 305 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 305 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 305 may also optionally be at least one storage device located away from the aforementioned processor 301. Refer to Figure 3 , as a computer storage medium, the memory 305 may include an operating system, a network communication module, a user interface module, and an application for implementing directional recording.
[0075] exist Figure 3In the electronic device shown, the user interface 303 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 301 can be used to call the application program for implementing directional recording stored in the memory 305. When executed by one or more processors 301, the electronic device executes one or more of the methods described in the above embodiments. It should be noted that for the aforementioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should know that this application is not limited to the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for this application.
[0076] The present application also provides a computer-readable storage medium storing instructions, which, when executed by one or more processors, enable an electronic device to execute one or more of the methods described in the above embodiments.
[0077] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0078] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are merely schematic, such as the division of units, which is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interface, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0079] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0080] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0081] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of this application, or the portion that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions for causing a computer device (which can be a personal computer, recording device, or network device, etc.) to execute all or part of the steps of the various embodiments of the method of this application. The aforementioned memory includes various media that can store program code, such as USB flash drives, mobile hard drives, magnetic disks, or optical disks.
[0082] The foregoing description is merely an exemplary embodiment of the present disclosure and does not limit the scope of the present disclosure. In other words, any equivalent variations and modifications made based on the teachings of the present disclosure are still within the scope of the present disclosure. Those skilled in the art will readily conceive of other embodiments of the present disclosure after considering the disclosure and practical experience.
[0083] This application is intended to cover any modifications, uses or adaptations disclosed in this application, which follow the general principles disclosed in this application and include common knowledge or customary technical means in the technical field not disclosed in this application.
Claims
1. A method for implementing directional recording, characterized in that: The method comprises: In response to a recording operation of the user, acquiring an environmental image corresponding to the outdoor environment where the user is located through a preset camera; According to the environmental image, obtaining a target environment type corresponding to the outdoor environment; Obtaining a target recording mode corresponding to the target environment type in a preset recording mode database, wherein the preset recording mode database is used to store a correspondence between the target environment type and the target recording mode; Acquire a first audio, and perform an audio parameter adjustment operation on the first audio according to the target recording mode to obtain a second audio; The second audio is saved to complete the recording operation.
2. The method according to claim 1, characterized in that The acquiring, according to the environment image, a target environment type corresponding to the outdoor environment specifically includes: Acquire a plurality of environmental features in the environmental image, wherein the plurality of environmental features include scene type features, color features, and terrain features; According to the plurality of environmental features, a target environment type corresponding to the outdoor environment is acquired.
3. The method according to claim 1, characterized in that Before obtaining the target recording mode corresponding to the target environment type in the preset recording mode database, constructing the preset recording mode database specifically includes: Acquire a plurality of preset outdoor environment types, wherein the plurality of preset outdoor environment types include an urban environment type, a woodland environment type, and a coastal environment type, and the plurality of preset outdoor environment types include the target environment type; Setting a plurality of preset recording modes corresponding to a plurality of the preset outdoor environment types, wherein one of the preset outdoor environments corresponds to one of the preset recording modes, and the plurality of preset recording modes include the target recording mode; The correspondence between the plurality of preset outdoor environment types and the plurality of preset recording modes is stored in the preset recording mode database.
4. The method according to claim 1, characterized in that The obtaining of the first audio specifically includes: Acquire a first user audio, where the first user audio is a sound emitted by the user; Acquire a first ambient audio, where the first ambient audio is the sound of the user in the outdoor environment; The first user audio and the first environment audio are used as the first audio.
5. The method according to claim 4, characterized in that The performing an audio parameter adjustment operation on the first audio according to the target recording mode to obtain the second audio specifically includes: According to the user audio parameter adjustment model and the target recording mode, an audio parameter adjustment operation is performed on the first user audio to obtain a second user audio, and according to the environment audio parameter adjustment model and the target recording mode, an audio parameter adjustment operation is performed on the first environment audio to obtain a second environment audio; The second user audio and the second environment audio are used as the second audio.
6. The method according to claim 4, characterized in that The obtaining of the first user audio specifically includes: Determining whether the user is within the shooting range of the preset camera; If the user is within the shooting range of the preset camera, acquiring the lip movement features corresponding to the user according to the preset camera; Acquire a target user audio to be confirmed from the first audio, where the target user audio to be confirmed is any audio segment in the first audio; Obtaining a matching value between the lip movement feature and the target user audio to be confirmed; If it is confirmed that the matching value is greater than the preset matching value, the target user audio to be confirmed is confirmed to be the first user audio.
7. The method according to claim 6, characterized in that After determining whether the user is within the shooting range of the camera, the method further includes: If the user is not within the shooting range of the preset camera, obtaining the target sound feature corresponding to the user from a preset sound source database, where the preset sound source database is used to store the corresponding relationship between the user and the target sound feature; Obtaining a similarity value between the target sound feature and the target to-be-confirmed user audio; If it is determined that the similarity value is greater than the preset similarity value, the target user audio to be confirmed is confirmed as the first user audio.
8. A device for implementing directional recording, characterized in that: The device comprises an acquisition module (21) and a processing module (22), wherein: The acquisition module (21) is used to respond to the user's recording operation and acquire an environmental image corresponding to the outdoor environment where the user is located through a preset camera; According to the environment image, a target environment type corresponding to the outdoor environment is obtained; in a preset recording mode database, a target recording mode corresponding to the target environment type is obtained, and the preset recording mode database is used to store the corresponding relationship between the target environment type and the target recording mode; The processing module (22) is used to obtain a first audio, and perform an audio parameter adjustment operation on the first audio according to the target recording mode to obtain a second audio; and save the second audio to complete the recording operation.
9. An electronic device, characterized in that: The electronic device comprises a processor (301), a communication bus (302), a user interface (303), a network interface (304) and a memory (305), wherein the memory (305) is used to store instructions, the user interface (303) and the network interface (304) are used to communicate with other devices, and the processor (301) is used to execute the instructions stored in the memory (305) so that the electronic device executes the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed, the method according to any one of claims 1 to 7 is performed.