Method for playing audio data and electronic device

By identifying the breakpoints in the audio data and adjusting the playback position, the problem of inaccurate audio playback was solved, enabling more precise audio data manipulation and improving the user experience.

CN115604519BActive Publication Date: 2026-01-16LENOVO (BEIJING) LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211195642.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-28
Publication Date
2026-01-16
Estimated Expiration
2042-09-28

AI Technical Summary

Technical Problem

During audio playback, manual operation by the user can lead to inaccurate pause and restart positions, affecting the user experience. This is especially true in foreign language speaking practice scenarios, where pause and restart positions are often not between sentences or words, resulting in incomplete playback.

Method used

By determining the current playback position of the audio data, identifying breakpoints, and automatically adjusting the target playback position according to integrity conditions, the system ensures playback integrity by placing the target playback position between two sentences or between two words within a sentence.

Benefits of technology

It improves the user experience, ensures that audio data is accurately paused or played at the target position, avoids incomplete playback issues, and enhances the accuracy of audio data operations and user satisfaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115604519B_ABST
    Figure CN115604519B_ABST
Patent Text Reader

Abstract

The application discloses a playing method of audio data and an electronic device. The method comprises the following steps: in response to a first instruction for the audio data, determining a current playing position of the audio data; wherein the first instruction is used for indicating starting playing or pausing playing the audio data; determining a target playing position, the target playing position being between two sentences or between two words in a sentence; starting playing or pausing playing the audio data at the target playing position, so as to ensure that the sentences before and after the target playing position meet a completeness condition, thereby improving user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of audio playback control technology, and in particular to a method for playing audio data and an electronic device. Background Technology

[0002] In many audio playback scenarios, frequent pausing and restarting are necessary. For example, in foreign language speaking practice, for shorter sentences, the audio playback is usually paused after playing one or a few sentences so that the student can repeat after them. For longer sentences such as object clauses and relative clauses, a pause is usually needed in the middle of the sentence for the student to repeat after them. Then, the audio playback is restarted, and this process is repeated to facilitate speaking practice.

[0003] Normally, audio playback is started and stopped manually by the user. However, due to factors such as user operation speed and familiarity with the audio playback device, the pause and restart points are often not precisely between two sentences or two words. For example, when pausing, it's possible that an extra or missing segment of audio might be played, resulting in the pause being in the middle of a sentence or even within a single word. The same issue arises when resuming playback, thus impacting the user experience. Summary of the Invention

[0004] This application provides a method for playing audio data and an electronic device. The technical solution adopted in the embodiments of this application is as follows:

[0005] A method for playing audio data, comprising:

[0006] In response to a first instruction for the audio data, the current playback position of the audio data is determined; wherein the first instruction is used to indicate whether to start or pause playback of the audio data;

[0007] Determine the target playback position, which is located between two statements or between two words in a statement, and the statements before and after the target playback position satisfy the integrity condition;

[0008] Start or pause playback of the audio data at the target playback position.

[0009] In some embodiments, determining the target playback position includes:

[0010] Determine at least one breakpoint location, wherein the breakpoint location is the current playback position or a position before or after the current playback position;

[0011] The target playback position is determined from the at least one breakpoint position.

[0012] In some embodiments, the determining the at least one breakpoint position comprises:

[0013] determining one or more of the breakpoint positions within a target playback time from the current playback position.

[0014] In some embodiments, the breakpoint positions comprise a first breakpoint position and a second breakpoint position with a lower priority than the first breakpoint position; and the determining the target playback position from the at least one breakpoint position comprises:

[0015] in a case that the first breakpoint position is within the target playback time from the current playback position, determining the first breakpoint position as the target playback position.

[0016] in a case that the first breakpoint position is not within the target playback time from the current playback position and the second breakpoint position is within the target playback time from the current playback position, determining the second breakpoint position as the target playback position.

[0017] In some embodiments, the determining the at least one breakpoint position comprises:

[0018] in a case that the first instruction is used to instruct to pause playing the audio data, determining one or more breakpoint positions that overlap with or are after the current playback position.

[0019] In some embodiments, the determining the at least one breakpoint position comprises:

[0020] in a case that the first instruction is used to instruct to start playing the audio data, determining whether there is an invalid audio segment after the current playback position in the audio data;

[0021] if yes, determining a first breakpoint position after the invalid audio segment;

[0022] if no, determining one or more breakpoint positions that overlap with or are before the current playback position.

[0023] In some embodiments, the determining the target playback position comprises:

[0024] obtaining a punctuation mark used to identify a breakpoint position of the audio data;

[0025] based on the punctuation mark, determining a target playback position that is close to the current playback position and satisfies the integrity condition.

[0026] In some embodiments, the obtaining a punctuation mark used to identify a breakpoint position of the audio data comprises:

[0027] perform audio recognition on the audio data to obtain a punctuation mark of the audio data.

[0028] In some embodiments, the performing audio recognition on the audio data comprises:

[0029] performing speech recognition on the audio data to obtain corresponding text data;

[0030] determining a breakpoint position satisfying the completeness condition based on the text data; or

[0031] recognizing an invalid audio segment in the audio data, and determining an end of the invalid audio segment as the breakpoint position; or

[0032] performing audio recognition on the audio data by using an audio recognition model to determine the breakpoint position satisfying the completeness condition.

[0033] An electronic device comprises:

[0034] a response module configured to determine a current playback position of audio data in response to a first instruction for the audio data, wherein the first instruction is used to instruct to start playing or pause playing the audio data;

[0035] a determination module configured to determine a target playback position, the target playback position being between two sentences or between two words in a sentence, and sentences before and after the target playback position satisfying a completeness condition;

[0036] a playing module configured to start playing or pause playing the audio data at the target playback position.

[0037] The playing method of the audio data according to the embodiments of the present application obtains a first instruction used to instruct to start playing or pause playing the audio data, determines a current playback position of the audio data and a target playback position close to the current playback position, the target playback position being between two sentences or between two words in a sentence, and starts playing or pause playing the audio data at the target playback position, which can ensure that the sentences before and after the target playback position satisfy the completeness condition, thereby improving user experience. BRIEF DESCRIPTION OF DRAWINGS

[0038] Figure 1 A flowchart of the playing method of the audio data according to the first embodiment of the present application;

[0039] Figure 2 A flowchart of step S120 of the playing method of the audio data according to the first embodiment of the present application;

[0040] Figure 3 A speech spectrogram of the audio data;

[0041] Figure 4 Flowchart of a method for playing audio data according to a second embodiment of the present application;

[0042] Figure 5 Flowchart of a method for playing audio data according to a third embodiment of the present application;

[0043] Figure 6 Block diagram of an electronic device according to a fourth embodiment of the present application;

[0044] Figure 7 Block diagram of an electronic device according to a fifth embodiment of the present application. DETAILED DESCRIPTION

[0045] Various aspects and features of the present application are described herein with reference to the drawings.

[0046] It is to be understood that various alterations, modifications and improvements can be made to the embodiments of the application herein disclosed. Accordingly, it is intended to embrace all such alterations, modifications and improvements as fall within the scope and spirit of the application.

[0047] The accompanying drawings incorporated in and forming a part of the specification, illustrate embodiments of the present application and, together with the description given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.

[0048] These and other characteristics of the present application will become apparent upon consideration of the following detailed description taken in conjunction with the accompanying drawings.

[0049] It is also to be understood that even though a number of specific embodiments of the present application have been described herein, these are merely possible embodiments and that many others are possible which fall within the scope and spirit of the present application as defined by the following claims.

[0050] The above and other aspects, features and advantages of the present application will become apparent from the following detailed description, taken in conjunction with the accompanying drawings, which illustrate by way of non-limiting examples various embodiments of the present application.

[0051] Specific embodiments of the present application are described herein with reference to the accompanying drawings. However, it should be noted that the application is merely an example of the present application and can be implemented in various ways. Well-known and / or repetitive functions and structures are not described in detail to avoid unnecessary or redundant details that would obscure the present application. Therefore, the specific structural and functional details of the application described herein are not intended to limit, but merely as a basis for the claims and representative basis for teaching one skilled in the art to variously employ the present application in virtually any appropriate detailed structure.

[0052] The specification can use the phrases "in one embodiment," "in another embodiment," "in yet another embodiment," or "in other embodiments," which can refer to one or more embodiments according to the present application.

[0053] The embodiment of the present application provides a playing method of audio data, comprising:

[0054] In response to a first instruction for the audio data, a current playing position of the audio data is determined; wherein the first instruction is used for indicating starting playing or pausing playing the audio data.

[0055] A target playing position is determined, the target playing position is between two sentences or between two words in a sentence, and sentences before and after the target playing position satisfy a completeness condition.

[0056] Starting playing or pausing playing the audio data at the target playing position.

[0057] The playing method of the audio data provided by the embodiment of the present application acquires the first instruction for indicating starting playing or pausing playing the audio data, determines the current playing position of the audio data and the target playing position close to the current playing position, starts playing or pauses playing the audio data at the target playing position, and can ensure that the sentences before and after the target playing position satisfy the completeness condition, so that the user experience is improved.

[0058] The steps and principles of the playing method of the audio data according to the embodiment of the present application are described in detail below in combination with the accompanying drawings and specific embodiments.

[0059] Figure 1 For the flowchart of the playing method of the audio data according to the first embodiment of the present application, referring to FIG. 1, the playing method of the audio data according to the embodiment of the present application can specifically include the following steps. Figure 1

[0060] S110, in response to a first instruction for the audio data, a current playing position of the audio data is determined; wherein the first instruction is used for indicating starting playing or pausing playing the audio data.

[0061] ​Optionally, the first instruction can be a control instruction generated by an operation component of the electronic device in response to a user operation, or can be a control instruction received by the electronic device from another electronic device based on a communication channel. For example, when the audio data is in a paused state, a user can operate an operation component such as a touch panel, a mouse, or a keyboard, and generate a first instruction through the operation component to instruct the electronic device to start playing the audio data. Alternatively, when the audio data is in a playing state, a user can operate another electronic device to send a first instruction to the electronic device to instruct the electronic device to pause playing the audio data.

[0062] Optionally, after the first instruction is obtained, a current playing position of the audio data is determined. In a case where the first instruction is used to instruct to start playing the audio data, the current playing position can be a beginning position of the audio data, or can be an intermediate position of the audio data. In a case where the first instruction is used to instruct to pause playing the audio data, the current playing position can be an intermediate position of the audio data, or can be an end position of the audio data.

[0063] S120, a target playing position is determined, the target playing position being between two sentences or between two words in a sentence, and sentences before and after the target playing position satisfying a completeness condition.

[0064] Optionally, the completeness condition can include a first completeness condition and a second completeness condition, and a priority of the first completeness condition can be higher than a priority of the second completeness condition. The first completeness condition can be that a sentence before the target playing position and a sentence after the target playing position are complete sentences, and the second completeness condition can be that at least words in the sentence before the target playing position and the sentence after the target playing position are complete words.

[0065] Optionally, in a case where the current playing position is determined, target audio segment data can be obtained based on the current playing position, the target audio segment data including audio segment data of a preset length before the current playing position and / or audio segment data of a preset length after the current playing position. Then, the target playing position is determined from the target audio segment data.

[0066] Optionally, in a case where a playing program of the audio data is configured to buffer audio segment data of a preset length before the current playing position and audio segment data of a preset length after the current playing position, the target audio segment data can be obtained from a local buffer of the electronic device.

[0067] Optionally, speech recognition can be performed on the target audio segment data to obtain corresponding text segment data, and the target playing position that can make the sentences before and after the target playing position satisfy the completeness condition is determined based on the text segment data.

[0068] Optionally, the target audio segment data can be subjected to audio recognition by using an audio recognition model to determine the target playing position that can make the front and rear sentences of the target playing position meet the integrity condition. The audio recognition model can be a machine learning model. A training data set and a verification data set can be constructed in advance, and both the training data set and the verification data set can include input data and output data. The input data can be the target audio segment data, and the output data can be the target playing position. For example, the target audio segment data can be obtained, the target playing position can be manually labeled, and the training data set and the verification data set can be constructed based on the target audio segment data and the labeled data. The machine learning model can be trained by using the training data set, and then the machine learning model can be verified by using the verification data set. If the verification is passed, it is determined that the machine learning model is trained. In the recognition process, the target audio segment data can be used as the input data of the audio recognition model, and the target playing position can be output by the audio recognition model based on the target audio segment data.

[0069] It should be noted that the above method for determining the target playing position is only exemplary, and should not be understood as being limited to the above method. In actual implementation, the target playing position can be determined by various methods, as long as the front and rear sentences of the target playing position meet the integrity condition.

[0070] S130, starting or pausing playing the audio data at the target playing position.

[0071] In the case where the target playing position has been determined, the audio data can be controlled to start playing the audio data or pause playing the audio data at the target playing position. In the case where the first instruction is used to instruct starting playing the audio data, if the target playing position is the same as the current playing position, the audio data is started to be played from the current playing position. If the target playing position is different from the current playing position, the audio data is started to be played by moving forward or backward to the target playing position. In the case where the first instruction is used to instruct pausing playing the audio data, if the target playing position is the same as the current playing position, the audio data is immediately paused to be played. If the target playing position is different from the current playing position, the audio data is paused to be played by moving backward to the target playing position, so that the front and rear sentences of the target playing position meet the integrity condition.

[0072] The method for playing the audio data according to the embodiments of the present application can obtain the first instruction for instructing starting playing or pausing playing the audio data, determine the current playing position of the audio data and the target playing position close to the current playing position, the target playing position is located between two sentences or between two words in a sentence, and the audio data is started or paused to be played at the target playing position, so that the front and rear sentences of the target playing position meet the integrity condition, thereby improving the user experience.

[0073] Cooperation Figure 2In some embodiments, the step S120 of determining the target play position can include the following steps.

[0074] The step S121 of determining the at least one breakpoint position can include the following steps.

[0075] The step S122 of determining the target play position from the at least one breakpoint position can include the following steps.

[0076] Optionally, the breakpoint position can be a position between two sentences or a position between two words in a sentence. The breakpoint position can be before the current play position, after the current play position, or the current play position itself.

[0077] Optionally, in the case of determining one or more breakpoint positions, a target play position can be selected from the one or more breakpoint positions, so that the sentences before and after the target play position meet the integrity condition.

[0078] In some embodiments, the step S121 of determining the at least one breakpoint position can include the following steps.

[0079] Determining one or more breakpoint positions within a target play time from the current play position.

[0080] If the interval between the target play position and the current play position is too long, it will inevitably affect the user experience. Therefore, one or more breakpoint positions within a target play time from the current play position can be determined, and a target play position can be selected therefrom to start or pause the audio data to improve user experience. The target play time can be set based on experience, with the purpose of not significantly affecting user experience.

[0081] In some embodiments, the step S121 of determining the target play position can include the following steps.

[0082] Obtaining a sentence break identifier for identifying a breakpoint position of the audio data.

[0083] Based on the sentence break identifier, determining a target play position close to the current play position and meeting the integrity condition.

[0084] Optionally, the audio data can be pre-added with a sentence break identifier. While the audio data is cached to the local of the electronic device, the sentence break identifier for identifying the breakpoint position is also cached to the local of the electronic device. After obtaining the first instruction, the sentence break identifier can be obtained from a preset storage position of the local of the electronic device.

[0085] Alternatively, the original audio data can not be added with the punctuation marks, and the electronic device can perform audio recognition on the audio data without waiting for the first instruction to be obtained. In the case where the first instruction is obtained, the pre-added punctuation marks can be directly obtained. For example, during the playing of the audio data, the cached audio data can be audio-recognized to determine the punctuation positions of the audio data and generate punctuation marks for identifying the punctuation positions.

[0086] Alternatively, in the case where the original audio data is not added with the punctuation marks, the audio data can not be immediately added with the punctuation marks. Instead, in response to obtaining the first instruction, the audio data can be audio-recognized to determine the punctuation positions of the audio data and generate punctuation marks for identifying the punctuation positions. For example, in the case where the first instruction is obtained, the target audio segment data can be obtained from the local cache of the electronic device, the target audio segment data can be audio-recognized to determine the punctuation positions of the target audio segment data and generate punctuation marks for identifying the punctuation positions.

[0087] The specific steps and principles of audio recognition are described in detail below in combination with some specific embodiments, but should not be understood as being limited to the following methods for audio recognition of audio data. In specific implementations, audio recognition of audio data can be performed by various methods, as long as the punctuation positions of the audio data can be determined and punctuation marks for identifying the punctuation positions can be generated.

[0088] In some embodiments, the audio recognition of the audio data includes:

[0089] voice recognition of the audio data to obtain corresponding text data;

[0090] determination of a breakpoint position that satisfies the integrity condition based on the text data.

[0091] Optionally, target audio segment data cached in the electronic device can be obtained, and the target audio segment data can be voice-recognized based on, for example, automatic speech recognition (ASR) to obtain corresponding text data. Then, the text data can be analyzed based on, for example, natural language processing (NLP) to determine a breakpoint position that satisfies the integrity condition. For example, a first breakpoint position that satisfies a first integrity condition and a second breakpoint position that satisfies a second integrity condition can be determined, and a first punctuation mark for identifying the first breakpoint position and a second punctuation mark for identifying the second breakpoint position can be generated.

[0092] In some embodiments, the audio recognition on the audio data comprises:

[0093] identifying an invalid audio segment in the audio data, and determining an end of the invalid audio segment as the breakpoint position.

[0094] In the application scenario of reading along or reading over, if there is a long silent segment or background sound after the user selects to start playing the audio data, the user experience will also be affected. Therefore, the invalid audio segment in the audio data can be identified, and the first breakpoint position after the invalid audio segment is determined as the target playing position, so as to cross the invalid audio segment and start playing from the valid audio segment.

[0095] Optionally, the target audio segment data cached locally by the electronic device can be acquired, and the target audio segment data is detected based on, for example, a voice activity detection technology (VAD) to generate, for example, a voice spectrogram, and whether the target audio segment data contains an invalid audio segment is determined based on the voice spectrogram. As shown in FIG. 6, the voice spectrogram of the audio data is shown, and it can be clearly seen from FIG. 6 that the A part, the B part and the C part do not contain voice, and the A part, the B part and the C part can be determined as invalid audio segments. Figure 3 Figure 3

[0096] In some embodiments, the audio recognition on the audio data comprises:

[0097] The audio recognition model is used to perform audio recognition on the audio data to determine the breakpoint position satisfying the integrity condition.

[0098] Optionally, the audio recognition model can be a machine learning model. A training data set and a verification data set can be constructed in advance, and the training data set and the verification data set can both include input data and output data. The input data can be audio data, and the output data can be a breakpoint position.

[0099] For example, the target audio segment data can be acquired, the first breakpoint position and the second breakpoint position are marked by artificial marking to generate the first sentence breaking mark and the second sentence breaking mark, and the training data set and the verification data set are constructed based on the target audio segment data, the first sentence breaking mark and the second sentence breaking mark.

[0100] ​​The machine learning model is trained by a training data set and verified by a verification data set. If the verification is passed, it is determined that the machine learning model is trained. In the identification process, the target audio segment data can be used as the input data of the audio identification model, and the first and / or second sentence breaking marks are output by the audio identification model based on the target audio segment data. The machine learning model is easy to implement and has high accuracy.

[0101] In some embodiments, the breakpoint positions include a first breakpoint position and a second breakpoint position with a priority lower than the first breakpoint position. The step S122 of determining the target playing position from the at least one breakpoint position can include:

[0102] In the case that the first breakpoint position is within the target playing time from the current playing position, the first breakpoint position is determined as the target playing position.

[0103] In the case that the first breakpoint position is not within the target playing time from the current playing position and the second breakpoint position is within the target playing time from the current playing position, the second breakpoint position is determined as the target playing position.

[0104] Optionally, all sentence breaking marks within the target playing time from the current playing position can be acquired. For example, the target audio segment data can be acquired based on the current playing position, and the audio data is performed on the target audio segment data to generate the second sentence breaking mark, or the first and second sentence breaking marks. Based on the acquired sentence breaking marks, in the case that the first breakpoint position is within the target playing time from the current playing position, the first breakpoint position is determined as the target playing position, and the audio data is played or paused from the target playing position, so that the sentences before and after the target playing position meet the first integrity condition, i.e., the sentences before and after the target playing position are complete sentences.

[0105] In the case that the first sentence breaking mark is not acquired, it indicates that the first breakpoint position is not within the target playing time from the current playing position. Based on the acquired second sentence breaking mark, the second breakpoint position closest to the target playing position is determined as the target playing position, so that the sentences before and after the target playing position meet the second integrity condition, i.e., the words in the sentences before and after the target playing position are complete words.

[0106] The second embodiment of the present application provides an audio data playing method, which is described in detail taking the pause playing scenario as an example. Figure 4 The flowchart of the audio data playing method of the second embodiment of the present application is shown in FIG. 2. Figure 4 The audio data playing method of the second embodiment of the present application can specifically include the following steps.

[0107] S201, obtaining a first instruction for indicating to pause playing the audio data.

[0108] Optionally, the first instruction can be a control instruction generated by an operation component of the electronic device in response to a user operation, or a control instruction received by the electronic device from another electronic device based on a communication channel. For example, when the audio data is in a playing state, a user can operate an operation component such as a touch panel, a mouse, or a keyboard, and generate a first instruction through the operation component to instruct the electronic device to pause playing the audio data.

[0109] S202, determining a current playing position of the audio data in response to the first instruction.

[0110] S203, determining one or more breakpoint positions within a target playing time that overlaps with the current playing position or is located after the current playing position.

[0111] Optionally, target audio segment data cached locally by the electronic device can be obtained, audio recognition is performed on the target audio segment data, a first sentence break position and a second sentence break position in the target audio segment data are determined, and a second sentence break identifier for identifying the second sentence break position is generated, or a first sentence break identifier for identifying the first sentence break position and a second sentence break identifier for identifying the second sentence break position are generated.

[0112] S204, determining whether the one or more breakpoint positions have a first breakpoint position, and if yes, performing S205, and if no, performing S206.

[0113] If one or more first sentence break identifiers are obtained, it indicates that there is a first breakpoint position within the target playing time from the current playing position. If no first sentence break identifier is obtained, it indicates that there is no first breakpoint position within the target playing time from the current playing position.

[0114] S205, determining the closest first breakpoint position to the current playing position as a target playing position, and pausing playing the audio data until the audio data is played to the target playing position.

[0115] In the case that there is one or more first breakpoint positions within the target play time from the current play position, the first breakpoint position closest to the current play position can be determined as the target play position. Alternatively, in the case that there is only one first breakpoint position within the target play time from the current play position, the first breakpoint position can be determined as the target play position. In the case that there are multiple first breakpoint positions within the target play time from the current play position, the first breakpoint position closest to the current play position can be determined. For example, in the case that one first breakpoint position overlaps with the current play position, the first breakpoint position can be determined as the target play position. If the target play position overlaps with the current play position, the audio data is paused immediately; if the target play position is behind the current play position, the audio data is played on until the target play position, and then the audio data is paused. In this way, the pause position is exactly between two sentences.

[0116] S206, determining the second breakpoint position closest to the current play position as the target play position from the one or more breakpoint positions, and pausing the audio data until the target play position.

[0117] The second breakpoint position is a position between two words. Even if there is no first breakpoint position within the target play time from the current play position, there is usually one or more second breakpoint positions. Therefore, even if there is no first breakpoint position within the target play time from the current play position, the second breakpoint position closest to the current play position can be determined as the target play position. For example, in the case that one second breakpoint position overlaps with the target play position, the second breakpoint position is closest to the current play position, and the second breakpoint position can be determined as the target play position. If the target play position overlaps with the current play position, the audio data is paused immediately; if the target play position is behind the current play position, the audio data is played on until the target play position, and then the audio data is paused. In this way, in the case that the audio data cannot be paused between two sentences, the audio data can at least be paused between two words, avoiding pausing the audio data in the middle of a word.

[0118] The third embodiment of the present application provides a method for playing audio data, which is described in detail taking the method for playing the audio data to start playing a scene as an example. Figure 5 The flowchart of the method for playing the audio data of the third embodiment of the present application is shown in FIG. 3, which can include the following steps. Figure 5 The flowchart of the method for playing the audio data of the third embodiment of the present application is shown in FIG. 3, which can include the following steps.

[0119] S301, obtaining a first instruction for indicating to start playing the audio data.

[0120] Optionally, the first instruction can be a control instruction generated by an operation component of the electronic device in response to a user operation, or can be a control instruction received by the electronic device from another electronic device based on a communication channel. For example, when audio data is in a paused state, a user can operate an operation component such as a touch panel, a mouse, or a keyboard, and generate a first instruction through the operation component to instruct the electronic device to start playing the audio data.

[0121] S302, determining a current playing position of the audio data in response to the first instruction.

[0122] S303, determining whether there is an invalid audio segment after the current playing position, and if yes, performing S304, and if no, performing S305.

[0123] Optionally, target audio segment data locally cached by the electronic device can be acquired, and the target audio segment data is detected based on a VAD technology to determine whether the current playing position contains an invalid audio segment.

[0124] S304, determining a first breakpoint position after the invalid audio segment, and determining the first breakpoint position as a target playing position, and playing the audio data starting from the target playing position.

[0125] In a case where there is an invalid audio segment after the current playing position, it indicates that a first sentence after the current playing position does not have a completeness problem, but the existence of the invalid audio segment affects user experience. Therefore, a first breakpoint position after the invalid audio segment can be determined as a target playing position, and the audio data is played starting from the target playing position to cross the invalid audio segment and improve user experience.

[0126] S305, determining one or more breakpoint positions within a target playing time that overlaps with the current playing position or is located before the current playing position.

[0127] In a case where there is no invalid audio segment after the current playing position, in order to ensure that a first sentence after the current playing position meets a completeness condition, one or more breakpoint positions that overlap with the current playing position or are located before the current playing position can be determined.

[0128] S306, determining whether there is a first breakpoint position in the one or more breakpoint positions, and if yes, performing S307, and if no, performing S308.

[0129] Optionally, in the case of determining the breakpoint position based on the punctuation mark, it is determined whether the first punctuation mark is obtained, and if one or more first punctuation marks are obtained, it is determined that there is one or more first breakpoint positions within the target playing time overlapping or before the current playing position. If one or more first punctuation marks are not obtained, it is determined that there is no first breakpoint position within the target playing time overlapping or before the current playing position.

[0130] S307, determining the first breakpoint position closest to the current playing position as the target playing position, and playing the audio data from the target playing position.

[0131] If the first breakpoint position closest to the current playing position overlaps the current playing position, the audio data is played from the current playing position. If the first breakpoint position closest to the current playing position is before the current playing position, the audio data is played from the first breakpoint position to ensure the integrity of the first sentence.

[0132] S308, determining the second breakpoint position closest to the current playing position among the one or more breakpoint positions as the target playing position, and playing the audio data from the target playing position.

[0133] If there is a first breakpoint position within the target playing time overlapping or before the current playing position, the second breakpoint position closest to the current playing position among the one or more breakpoint positions is determined as the target playing position, and the audio data is played from the target playing position to ensure the integrity of the words in the first sentence.

[0134] Referring to Figure 6 The fourth embodiment of the present application provides an electronic device, which comprises:

[0135] The response module 401 is configured to determine a current playing position of the audio data in response to a first instruction for the audio data, wherein the first instruction is used to instruct to start playing or pause playing the audio data.

[0136] The determination module 402 is configured to determine a target playing position, wherein the target playing position is between two sentences or between two words in a sentence, and the sentences before and after the target playing position satisfy an integrity condition.

[0137] The playing module 403 is configured to start playing or pause playing the audio data at the target playing position.

[0138] In some embodiments, the determination module 402 is specifically configured to:

[0139] determining at least one breakpoint position, wherein the breakpoint position is the current play position or a position before or after the current play position;

[0140] determining a target play position from the at least one breakpoint position.

[0141] In some embodiments, the determining module 402 is specifically configured to:

[0142] determining one or more breakpoint positions within a target play time from the current play position.

[0143] In some embodiments, the breakpoint positions include a first breakpoint position and a second breakpoint position with a lower priority than the first breakpoint position; the determining module 402 is specifically configured to:

[0144] in a case where the first breakpoint position is within the target play time from the current play position, determining the first breakpoint position as the target play position.

[0145] in a case where the first breakpoint position is not within the target play time from the current play position and the second breakpoint position is within the target play time from the current play position, determining the second breakpoint position as the target play position.

[0146] In some embodiments, the determining module 402 is specifically configured to:

[0147] in a case where the first instruction is used to instruct to pause playing the audio data, determining one or more breakpoint positions overlapping with or after the current play position.

[0148] In some embodiments, the determining module 402 is specifically configured to:

[0149] in a case where the first instruction is used to instruct to start playing the audio data, determining whether there is an invalid audio segment after the current play position in the audio data.

[0150] if yes, determining a first breakpoint position after the invalid audio segment;

[0151] if no, determining one or more breakpoint positions overlapping with or before the current play position.

[0152] In some embodiments, the determining module 402 is specifically configured to:

[0153] obtaining a punctuation mark used to identify a breakpoint position of the audio data.

[0154] Based on the punctuation mark identification, a target playing position close to the current playing position and satisfying the integrity condition is determined.

[0155] In some embodiments, the determining module 402 is specifically configured to:

[0156] performing audio recognition on the audio data to obtain punctuation mark identification of the audio data.

[0157] In some embodiments, the determining module 402 is specifically configured to:

[0158] performing speech recognition on the audio data to obtain corresponding text data;

[0159] determining a breakpoint position satisfying the integrity condition based on the text data; or

[0160] identifying an invalid audio segment in the audio data, and determining an end of the invalid audio segment as the breakpoint position; or

[0161] performing audio recognition on the audio data by using an audio recognition model to determine a breakpoint position satisfying the integrity condition.

[0162] Referring to Figure 7 The fifth embodiment of the present application further provides an electronic device, which at least includes a memory 501 and a processor 502, the memory 501 has a program stored thereon, and the processor 502 implements the method of any one of the above embodiments when executing the program stored on the memory 501.

[0163] The sixth embodiment of the present application further provides a computer readable storage medium, which has computer executable instructions stored therein, and the computer executable instructions implement the method of any one of the above embodiments when executed.

[0164] Those skilled in the art will appreciate that the embodiments of the present application can be provided as a method, an electronic device, a computer readable storage medium or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware. Furthermore, the present application can take the form of a computer program product implemented on one or more computer usable storage media (including a computer readable storage medium) having computer usable program code embodied thereon. When implemented by software, the functions can be stored in a computer readable medium or transmitted as one or more instructions or code on a computer readable medium.

[0165] The processor can be a general processor, a digital signal processor, an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof. The general processor can be a microprocessor or any conventional processor.

[0166] The memory can include a non-persistent memory in a computer readable medium, a random access memory (RAM) and / or a non-volatile memory such as a read-only memory (ROM) or a flash memory. The memory is an example of the computer readable medium.

[0167] The readable storage medium can be a magnetic disk, an optical disk, a DVD, a USB, a read-only memory (ROM) or a random access memory (RAM), etc. The specific form of the storage medium is not limited in the present application.

[0168] The above embodiments are only exemplary embodiments of the present application and are not intended to limit the present application. The scope of protection of the present application is defined by the claims. Those skilled in the art can make various modifications or equivalent replacements to the present application within the spirit and protection scope of the present application, and such modifications or equivalent replacements should also be considered to fall within the protection scope of the present application.

Claims

1. A method for playing audio data, comprising: determining a current playing position of the audio data in response to a first instruction for the audio data, wherein the first instruction is used to instruct to start playing or pause playing the audio data; determining a target playing position, wherein the target playing position is between two sentences or between two words in a sentence, and sentences before and after the target playing position satisfy a completeness condition; starting playing or pausing playing the audio data at the target playing position; in a case that the first instruction is used to instruct to pause playing the audio data, and the target playing position is different from the current playing position, moving to the target playing position to pause playing the audio data.

2. The method of claim 1, wherein, The determining the target playing position comprises: determining at least one breakpoint position, wherein the breakpoint position is the current playing position or a position before or after the current playing position; and determining the target playing position from the at least one breakpoint position.

3. The method of claim 2, wherein, The determining the at least one breakpoint position comprises: determining one or more breakpoint positions within a target playing time from the current playing position.

4. The method of claim 2, wherein, The breakpoint position comprises a first breakpoint position and a second breakpoint position with a lower priority than the first breakpoint position; and the determining the target playing position from the at least one breakpoint position comprises: in a case that the first breakpoint position is within the target playing time from the current playing position, determining the first breakpoint position as the target playing position; and in a case that the first breakpoint position is not within the target playing time from the current playing position and the second breakpoint position is within the target playing time from the current playing position, determining the second breakpoint position as the target playing position.

5. The method of claim 2, wherein, The determining the at least one breakpoint position comprises: in a case that the first instruction is used to instruct to pause playing the audio data, determining one or more breakpoint positions overlapping with or after the current playing position.

6. The method of claim 2, wherein, The determining the at least one breakpoint position comprises: in a case that the first instruction is used to instruct to start playing the audio data, determining whether there is an invalid audio segment after the current playing position in the audio data; if yes, determining a first breakpoint position after the invalid audio segment; and if no, determining one or more breakpoint positions overlapping with or before the current playing position.

7. The method of claim 1, wherein, The determining the target playing position comprises: obtaining a sentence breaking identifier used to identify a breakpoint position of the audio data; and determining a target playing position close to the current playing position and satisfying the completeness condition based on the sentence breaking identifier.

8. The method of claim 7, wherein, The obtaining the sentence breaking identifier used to identify the breakpoint position of the audio data comprises: performing audio recognition on the audio data to obtain the sentence breaking identifier of the audio data.

9. The method of claim 8, wherein, The performing audio recognition on the audio data comprises: performing speech recognition on the audio data to obtain corresponding text data; determining a breakpoint position satisfying the completeness condition based on the text data; or recognizing an invalid audio segment in the audio data, and determining an end of the invalid audio segment as the breakpoint position; or perform audio recognition on the audio data using an audio recognition model to determine a breakpoint position that satisfies the completeness condition.

10. An electronic device, comprising: a response module configured to, in response to a first instruction for audio data, determine a current play position of the audio data, wherein the first instruction is used to instruct to start playing or pause playing the audio data; a determination module configured to determine a target play position, the target play position being between two sentences or between two words in a sentence, and sentences before and after the target play position satisfying a completeness condition; a playing module configured to start playing or pause playing the audio data at the target play position, and in a case where the first instruction is used to instruct to pause playing the audio data and the target play position is different from the current play position, move to the target play position to pause playing the audio data.

Citation Information

Patent Citations

  • Multimedia playing method and device

    CN104038827A

  • Audio playing method, electronic equipment and storage medium

    CN111128254A

  • Audio processing method and device and electronic equipment

    CN112712825A