Audio recording method and apparatus, device, and storage medium
By starting to write voice audio files at the first frame playback moment of background audio, the problem of misalignment of vocals and accompaniment is solved, and the audio-visual effect of recording audio files is improved.
Patent Information
- Application Number
- PCT/CN2024/116166
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-08-31
- Filing Date
- 2024-08-31
- Publication Date
- 2025-03-06
AI Technical Summary
When a user records a song through a singing application, due to interference such as acquisition delay, startup delay, playback delay and playback start delay, the vocals and accompaniment are not aligned, affecting the audio-visual effect of the recorded audio file.
By detecting the first frame playback moment of the background audio, the file writing operation is performed on the collected voice audio starting from that moment to obtain the audio recording file.
Ensure that the recorded voice audio is synchronized with the background audio, and improve the audio-visual effect of the recorded audio files.
Smart Images

Figure CN2024116166_06032025_PF_FP_ABST
Abstract
Description
Audio recording method, device, equipment and storage medium
[0001] This application claims priority to the Chinese invention patent application with application number 202311119315.3 filed on August 31, 2023 and titled “Audio recording method, device, equipment and storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The embodiments of the present disclosure relate to the field of data processing technology, and in particular to an audio recording method, apparatus, device, and storage medium. Background Art
[0003] When a user records a song in a singing application (APP), the APP plays background music (also known as accompaniment). The user sings along with the background music, and the APP records the user's singing, creating a recorded audio file. Due to interference such as acquisition delay, acquisition start delay, playback delay, and playback start delay, the vocals and accompaniment may not align, resulting in poor audio-visual quality when the recorded audio file is played back.
[0004] Summary of the Invention
[0005] The embodiments of the present disclosure provide an audio recording method, apparatus, device, and storage medium, which synchronize recorded voice audio with background audio, thereby improving the audio-visual effect of the recorded audio file.
[0006] In a first aspect, an embodiment of the present disclosure provides an audio recording method, comprising: starting to collect voice audio in response to a triggered recording operation; detecting the first frame playback moment of the background audio; wherein the first frame playback moment is the moment when the first frame of the background audio is played; starting from the first frame playback moment, performing a file write operation on the collected voice audio to obtain an audio recording file.
[0007] In the second aspect, the embodiment of the present disclosure also provides an audio recording device, including: a voice audio acquisition start module, which is used to start the voice audio acquisition in response to a triggered recording operation; a first frame playback time detection module, which is used to detect the first frame playback time of the background audio; wherein the first frame playback time is the time when the first frame of the background audio is played; a file writing operation execution module, which is used to perform a file writing operation on the collected voice audio starting from the first frame playback time to obtain an audio recording file.
[0008] In a third aspect, an embodiment of the present disclosure further provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the audio recording method as described in the embodiment of the present disclosure.
[0009] In a fourth aspect, an embodiment of the present disclosure further provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to execute the audio recording method as described in the embodiment of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale.
[0011] FIG1 is a flow chart of an audio recording method provided by an embodiment of the present disclosure;
[0012] FIG2 is a timing diagram of an audio recording method provided by an embodiment of the present disclosure;
[0013] FIG3 is a schematic structural diagram of an audio recording device provided by an embodiment of the present disclosure;
[0014] FIG4 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0015] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.
[0016] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0017] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.
[0018] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0019] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".
[0020] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0021] It is understandable that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0022] For example, in response to a user's active request, a prompt message is sent to the user to clearly inform the user that the operation requested will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the electronic device, application, server, storage medium, or other software or hardware that performs the operations of the disclosed technical solution based on the prompt message.
[0023] As an optional but non-limiting implementation, in response to receiving a user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. Furthermore, the pop-up window may also contain a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.
[0024] It is understandable that the above notification and user authorization process are merely illustrative and do not limit the implementation of the present disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0025] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) must comply with the requirements of relevant laws, regulations and relevant provisions.
[0026] Figure 1 is a flow chart illustrating an audio recording method provided by an embodiment of the present disclosure. This embodiment of the present disclosure is applicable to audio recording scenarios. The method can be performed by an audio recording device, which can be implemented in software and / or hardware. Alternatively, the method can be implemented by an electronic device, such as a mobile terminal, a PC, or a server.
[0027] As shown in FIG1 , the method includes steps S110 , S120 and S130 .
[0028] S110 , in response to the triggered recording operation, start collecting voice audio.
[0029] In this application scenario, when a user records a song through a singing APP, the user selects the song to sing along and clicks the record button. The singing APP plays background music (also called accompaniment), and the user sings along with the background music. The APP collects and saves the sound of the user's singing, thereby obtaining a recorded audio file.
[0030] In some embodiments, starting to collect voice audio can be understood as starting the functional components required for collecting voice audio, so that the terminal can collect voice audio and obtain audio frames.
[0031] In this embodiment, after starting the audio collection and before detecting the time when the first frame of the background audio is played, the following steps are also included: when the number of frames of the collected voice audio reaches a set number and / or the duration of the collected voice audio reaches a set duration, starting to play the background audio.
[0032] In some embodiments, the set number and set duration may be determined by the performance of the capture device. In this application scenario, after the capture device is started, the first certain number of audio frames or the first certain duration of audio frames collected may be blank frames. In order to ensure the audio-visual effect of the recorded audio file, these blank frames need to be shielded. Therefore, when the number of captured audio frames reaches the set number and / or the duration of the captured voice audio reaches the set duration, the background audio is started.
[0033] In some embodiments, starting to play background audio can be understood as starting the functional components required for playing audio, so that the terminal device can play background audio.
[0034] S120: Detect the playing time of the first frame of the background audio.
[0035] In some embodiments, the first frame playing time can be understood as the time when the first frame of the background audio is played, that is, the time when the first frame of the background audio is decoded and played through the speaker.
[0036] In this embodiment, the process of detecting the time when the first frame of the background audio is played may be: detecting the time when the first frame of the background audio is played; and determining the time as the time when the first frame of the background audio is played.
[0037] In this application scenario, after the playback function is activated, there is a delay of tens to hundreds of milliseconds between the start of the playback function and the playback of the first frame of the background audio due to operations such as starting the functional components required for playback and decoding the background audio. Specifically, the time when the first frame of the background audio is played is detected in real time and determined as the playback time of the first frame of the background audio.
[0038] S130, starting from the first frame playback moment, performing a file write operation on the collected voice audio to obtain an audio recording file.
[0039] In some embodiments, performing a file write operation on the collected voice audio to obtain the audio recording file may be performed by writing the collected voice audio from memory to disk to obtain the audio recording file. In this embodiment, the terminal first stores the collected voice audio in memory and then writes the audio in memory to disk to obtain the audio recording file. If the audio in memory is not written to disk, the audio recording file cannot be obtained and the collected voice audio is released from memory.
[0040] In this embodiment, since there will be a delay of tens to hundreds of milliseconds between starting the playback and playing the first frame, in order to reduce the deviation between the recorded audio and the background audio, the collected voice audio is written from the memory to the disk starting from the moment corresponding to the first frame of the background audio, and the voice audio frames collected before this moment are discarded.
[0041] Optionally, after performing a write file operation on the collected voice audio and before obtaining the audio recording file, the following steps are also included: in response to a triggered stop recording operation, stopping playing the background audio and stopping collecting the voice audio.
[0042] When the user finishes singing a song or wants to stop recording, they trigger the Stop Recording button in the recording interface. Alternatively, when the accompaniment of a song finishes playing, the app proactively triggers the Stop Recording operation. When the Stop Recording operation is detected, the background audio playback and voice audio collection are stopped, that is, the playback and collection functions are disabled. After the recording stops, the recorded audio file is obtained.
[0043] Based on the above embodiments, Figure 2 is a timing diagram of an audio recording method in an embodiment of the present disclosure. As shown in Figure 2, the method includes the following steps in sequence: 1. Responding to a recording operation, starting to collect voice audio; 2. Waiting for the first frame to be collected; 3. Waiting for the number of frames of the collected voice audio to reach a set number or the duration to reach a set duration; 4. Starting to complete the collection; 5. Starting to play background audio; 6. Waiting until the first frame is played; 7. Returning to start the playback completion; 8. Starting to perform a file write operation on the collected voice audio; 9. Responding to the stop recording operation; 10. Stopping the collection and stopping the playback; 11. Recording is completed.
[0044] Optionally, after obtaining the audio recording file, the following steps are also included: aligning the first frame of the audio in the audio recording file with the first frame of the background audio; synthesizing the audio in the aligned audio recording file and the background audio to obtain the target audio file.
[0045] In some embodiments, aligning the first frame of audio in an audio recording file with the first frame of background audio can be understood as aligning the audio in an audio recording file with the background audio to ensure that the collected voice audio and background audio are synchronized when the target audio file is played.
[0046] Specifically, the first frame of the audio in the audio recording file is aligned with the first frame of the background audio by aligning the first frame of the voice audio in the audio recording file and the first frame of the background audio with the set time starting point.
[0047] In some embodiments, the set time starting point can be time 0, which is a relative time and a set starting point timestamp. In this embodiment, the first frame of the audio in the audio recording file is aligned with the set time starting point, and the first frame of the background audio is aligned with the set time starting point, thereby achieving the alignment of the first frame of the recorded audio with the first frame of the background audio. Optionally, the way to align the first frame of the audio in the audio recording file with the first frame of the background audio can also be: using the timestamp corresponding to the first frame of the audio in the audio recording file as the time starting point, and then aligning the first frame of the background audio with the time starting point, thereby achieving the alignment of the first frame of the recorded audio with the first frame of the background audio; or, using the timestamp corresponding to the first frame of the background audio as the time starting point, and then aligning the first frame of the audio in the audio recording file with the time starting point, thereby achieving the alignment of the first frame of the recorded audio with the first frame of the background audio. In this embodiment, aligning the first frame of the recorded audio with the first frame of the background audio based on the time starting point can ensure the accuracy of the alignment.
[0048] Optionally, in response to a triggered recording operation, starting to collect voice audio can be understood as: in response to a recording operation during the performance of a target song, starting to collect voice audio. Accordingly, detecting the first frame playback moment of the background audio can be understood as: detecting the first frame playback moment of the background audio of the target song. Accordingly, starting from the first frame playback moment, performing a file write operation on the collected voice audio to obtain an audio recording file includes: starting from the first frame playback moment, performing a file write operation on the collected voice audio to obtain an audio recording file corresponding to the performance.
[0049] The solution of this embodiment can be applied to the scenario where the user sings through a singing APP. The user first selects the target song, and then clicks the record button. The APP starts collecting voice audio. When the number of frames of the collected voice audio reaches the set number and / or the duration of the collected voice audio reaches the set duration, the background audio of the target song is started to play. When the first frame playback moment of the background audio of the target song is detected, starting from the first frame playback moment, a file write operation is performed on the collected voice audio to obtain the audio recording file corresponding to the singing. Finally, the first frame of the audio in the audio recording file is aligned with the first frame of the background audio, and the audio and background audio in the aligned audio recording file are synthesized to obtain the target audio file. The obtained target audio file contains the audio sung by the user and the background audio of the target song.
[0050] The technical solution of the embodiment of the present disclosure starts collecting voice audio in response to a triggered recording operation; detects the time when the first frame of background audio is played; and, starting from the time when the first frame is played, performs a file write operation on the collected voice audio to obtain an audio recording file. The audio recording method provided by the embodiment of the present disclosure writes the collected voice audio to a file starting from the time when the first frame of background audio is played to obtain an audio recording file, ensuring that the recorded audio is aligned with the background audio, thereby improving the audio-visual effect of the recorded audio file.
[0051] Figure 3 is a structural schematic diagram of an audio recording device provided by an embodiment of the present disclosure. As shown in Figure 3, the device includes: a voice audio acquisition start module 310, which is used to start the voice audio acquisition in response to a triggered recording operation; a first frame playback time detection module 320, which is used to detect the first frame playback time of the background audio; wherein the first frame playback time is the time when the first frame of the background audio is played; and a file writing operation execution module 330, which is used to perform a file writing operation on the collected voice audio starting from the first frame playback time to obtain an audio recording file.
[0052] Optionally, it also includes: a background audio playback start module, which is used to start playing background audio when the number of frames of the collected voice audio reaches a set number and / or the duration of the collected voice audio reaches a set duration.
[0053] Optionally, the file writing operation execution module 330 is further used to write the collected voice audio from the memory to the disk to obtain an audio recording file.
[0054] Optionally, it also includes: a stop recording module, which is used to: stop playing background audio and stop collecting voice audio in response to a triggered stop recording operation.
[0055] Optionally, it also includes: an alignment module, used to: align the first frame of the audio in the audio recording file with the first frame of the background audio; synthesize the audio in the aligned audio recording file and the background audio to obtain a target audio file.
[0056] Optionally, the alignment module is further used to align the first frame of the audio in the audio recording file and the first frame of the background audio with a set time starting point.
[0057] Optionally, the voice audio collection starting module 310 is further used to start collecting voice audio in response to a recording operation when singing a target song.
[0058] Optionally, the first frame playback time detection module 320 is further used to detect the first frame playback time of the background audio of the target song.
[0059] Optionally, the file writing operation execution module 330 is also used to: start from the first frame playback moment, perform a file writing operation on the collected voice audio, and obtain an audio recording file corresponding to the performance.
[0060] The audio recording device provided in the embodiments of the present disclosure can execute the audio recording method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0061] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as they can achieve the corresponding functions. In addition, the specific names of the functional units are only for the convenience of distinguishing each other and are not used to limit the scope of protection of the embodiments of the present disclosure.
[0062] FIG4 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Referring to FIG4 , a schematic diagram of the structure of an electronic device (such as a terminal device or server in FIG4 ) 500 suitable for implementing an embodiment of the present disclosure is shown below. The terminal device in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. The electronic device shown in FIG4 is merely an example and should not impose any limitations on the functions and scope of use of the embodiments of the present disclosure.
[0063] As shown in FIG4 , the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. Various programs and data required for the operation of the electronic device 500 are also stored in the RAM 503. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An edit / output (I / O) interface 505 is also connected to the bus 504.
[0064] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although FIG4 shows the electronic device 500 with various devices, it should be understood that not all of the devices shown are required to be implemented or present. More or fewer devices may alternatively be implemented or present.
[0065] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 509, or installed from the storage device 508, or installed from the ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0066] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0067] The electronic device provided in the embodiment of the present disclosure and the audio recording method provided in the above embodiment belong to the same inventive concept. For technical details not fully described in this embodiment, please refer to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0068] An embodiment of the present disclosure provides a computer storage medium on which a computer program is stored. When the program is executed by a processor, the audio recording method provided in the above embodiment is implemented.
[0069] The embodiments of the present disclosure disclose an audio recording method, apparatus, device and storage medium. In response to a triggered recording operation, the method starts collecting voice audio; detects the time when the first frame of background audio is played; wherein the time when the first frame is played is the time when the first frame of background audio is played; and starting from the time when the first frame is played, performs a file write operation on the collected voice audio to obtain an audio recording file. The audio recording method provided by the embodiments of the present disclosure performs a file write operation on the collected voice audio starting from the time when the first frame of background audio is played to obtain an audio recording file, ensures that the recorded audio and background audio can be aligned, and improves the audio-visual effect of the recorded audio file.
[0070] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0071] In some embodiments, the client and server can communicate using any currently known or later developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or later developed network.
[0072] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0073] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: starts collecting voice audio in response to a triggered recording operation; detects the first frame playback time of the background audio; and starting from the first frame playback time, performs a file write operation on the collected voice audio to obtain an audio recording file.
[0074] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0075] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0076] The units involved in the embodiments described in this disclosure may be implemented in software or hardware. In some cases, the name of a unit does not limit the unit itself. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses."
[0077] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0078] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0079] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
[0080] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0081] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. An audio recording method, comprising: In response to the triggered recording operation, start collecting voice audio; Detecting the first frame playback time of the background audio; wherein the first frame playback time is the time when the first frame of the background audio is played; Starting from the first frame playback moment, a file writing operation is performed on the collected voice audio to obtain an audio recording file.
2. The method according to claim 1, wherein: After starting to collect voice audio and before detecting the first frame playback time of background audio, it also includes: When the number of frames of the collected voice audio reaches a set number and / or the duration of the collected voice audio reaches a set duration, the background audio is started to be played.
3. The method according to claim 1, wherein: Write the collected audio to a file to obtain the audio recording file, including: Write the collected voice audio from memory to disk to obtain an audio recording file.
4. The method according to claim 2, wherein: After writing the collected voice audio to a file and before obtaining the audio recording file, the following steps are also included: In response to the triggered stop recording operation, the background audio is stopped from being played and the voice audio is stopped from being collected.
5. The method according to claim 1, wherein: After obtaining the audio recording file, it also includes: Aligning the first frame of the audio in the audio recording file with the first frame of the background audio; The audio in the aligned audio recording file and the background audio are synthesized to obtain a target audio file.
6. The method according to claim 5, wherein: Aligning the first frame of the audio in the audio recording file with the first frame of the background audio, including: The first frame of the audio in the audio recording file and the first frame of the background audio are both aligned with the set time starting point.
7. The method according to claim 1, wherein: In response to the triggered recording operation, the voice audio collection is started, including: In response to a recording operation during singing of a target song, starting to collect voice audio; Detect the first frame playback time of the background audio, including: Detecting the first frame playing time of the background audio of the target song; Starting from the first frame playback moment, a file writing operation is performed on the collected voice audio to obtain an audio recording file, including: Starting from the moment the first frame is played, a file writing operation is performed on the collected voice audio to obtain an audio recording file corresponding to the singing.
8. An audio recording device, comprising: A voice and audio collection start module is used to start collecting voice and audio in response to a triggered recording operation; A first frame playing time detection module is used to detect the first frame playing time of the background audio; wherein, the first frame playing time is the time when the first frame of the background audio is played; The file writing operation execution module is used to execute the file writing operation on the collected voice audio starting from the first frame playback moment to obtain the audio recording file.
9. An electronic device, comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the audio recording method as described in any one of claims 1-7.
10. A storage medium comprising computer executable instructions, wherein the computer executable instructions are used to perform the audio recording method according to any one of claims 1 to 7 when executed by a computer processor.
Citation Information
Patent Citations
Song recording method and device
CN106531201A
Method and device for converting voice into rap music, equipment and storage medium
CN111862913A
Audio processing method and device, electronic equipment and storage medium
CN112927666A
Audio data generation method and device, equipment and storage medium
CN116612772A