Audio playback methods and devices

By splitting the variable speed processor into two modules, the problem of playback discontinuity during audio playback rate adjustment was solved, smooth playback of audio data was achieved, and the responsiveness of rate adjustment was improved.

CN115798492BActive Publication Date: 2026-03-06BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111066580.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-13
Publication Date
2026-03-06
Estimated Expiration
2041-09-13

AI Technical Summary

Technical Problem

Existing technologies have poor playback smoothness when adjusting audio playback speed, resulting in discontinuous audio data, especially when recreating the speed processor, audio data that has not undergone speed processing is lost.

Method used

The speed processor is split into two modules: one for primary processing and the other for speed adjustment. When a rate adjustment command is received, a second audio filter is recreated for speed adjustment to prevent audio data that has not undergone speed adjustment from being lost.

Benefits of technology

It improves the smoothness of audio data playback, reduces the response latency of rate adjustment commands, and ensures that audio data is played continuously according to the new rate parameters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115798492B_ABST
    Figure CN115798492B_ABST
Patent Text Reader

Abstract

This disclosure provides an audio playback method and device. The method includes: receiving a rate adjustment instruction to adjust the audio playback rate from a first multiple of a preset standard rate to a second multiple of the preset standard rate; creating a second audio filter at the second multiple; invoking the second audio filter to perform a second multiple speed adjustment on second audio data in a first buffer to obtain third audio data, wherein the second audio data is obtained after the first audio filter performs a first processing on the first audio data, the first processing including at least one of the following: audio decoding, format conversion, sampling, and channel conversion; and playing the third audio data. This disclosure improves the smoothness of audio data playback by the player.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of audio processing technology, and in particular to an audio playback method and device. Background Technology

[0002] As electronic devices become increasingly powerful, their use is becoming more widespread. While using these devices, users can play audio and adjust the playback rate. For example, a user can adjust the playback rate to twice the standard rate.

[0003] Therefore, how to ensure smooth playback when adjusting the audio playback rate is an urgent problem to be solved. Summary of the Invention

[0004] This disclosure provides an audio playback method and device that can ensure smooth playback when adjusting the audio playback rate.

[0005] In a first aspect, embodiments of this disclosure provide an audio playback method, including:

[0006] Receive a rate adjustment command, the rate adjustment command being used to adjust the audio playback rate from a first multiple of a preset standard rate to a second multiple of a preset standard rate;

[0007] Create a second audio filter for the second multiple;

[0008] The second audio filter is invoked to perform speed-changing processing on the second audio data in the first buffer by the second multiple, resulting in the third audio data. The second audio data is obtained after the first audio filter performs a first processing on the first audio data. The first processing includes at least one of the following: audio decoding, format conversion, sampling, and channel conversion.

[0009] Play the third audio data.

[0010] In a second aspect, embodiments of this disclosure provide an electronic device, including:

[0011] A rate adjustment instruction receiving module is used to receive a rate adjustment instruction, which is used to adjust the audio playback rate from a first multiple of a preset standard rate to a second multiple of a preset standard rate.

[0012] A filter creation module is used to create a second audio filter for the second multiple.

[0013] The first speed-changing processing module is used to call the second audio filter to perform speed-changing processing on the second audio data in the first buffer by the second multiple to obtain the third audio data. The second audio data is obtained after the first audio filter performs a first processing on the first audio data. The first processing includes at least one of the following: audio decoding, format conversion, sampling, and channel conversion.

[0014] The first audio playback module is used to play the third audio data.

[0015] Thirdly, embodiments of this disclosure provide an electronic device, including: at least one processor and a memory;

[0016] The memory stores computer-executed instructions;

[0017] The at least one processor executes computer execution instructions stored in the memory, causing the electronic device to perform the method as described in the first aspect.

[0018] Fourthly, embodiments of this disclosure provide a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, cause a computing device to implement the method described in the first aspect.

[0019] Fifthly, embodiments of this disclosure provide a computer program for implementing the method as described in the first aspect.

[0020] This disclosure provides an audio playback method and device. The method includes: receiving a rate adjustment instruction to adjust the audio playback rate from a first multiple of a preset standard rate to a second multiple of the preset standard rate; creating a second audio filter at the second multiple; invoking the second audio filter to perform a second multiple speed change on second audio data in a first buffer to obtain third audio data, wherein the second audio data is obtained after the first audio filter performs a first processing on the first audio data, and the first processing includes at least one of the following: audio decoding, format conversion, sampling, and channel conversion; and playing the third audio data. This disclosure splits the speed change processor for the first processing and speed change into two parts: one first audio filter for the first processing and the other second audio filter for the speed change. Thus, when a rate adjustment instruction is received, a new second audio filter can be created to perform speed change on the audio data that has undergone the first processing but not speed change by the first audio filter. This avoids the loss of audio data that has undergone the first processing but not speed change by the first audio filter, thereby improving the smoothness of audio data playback by the player. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 An exemplary schematic diagram of the structure of an audio speed-changing playback device provided by the prior art is shown;

[0023] Figure 2 An exemplary flowchart illustrates the steps of an audio playback method provided in an embodiment of this disclosure;

[0024] Figure 3 An exemplary schematic diagram of an audio speed-changing playback device provided in an embodiment of this disclosure is shown;

[0025] Figure 4 The illustration provides a detailed process diagram of an audio playback method according to an embodiment of this disclosure.

[0026] Figures 5 to 7 Structural block diagrams of three electronic devices provided in embodiments of this disclosure are shown as examples. Detailed Implementation

[0027] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0028] The embodiments disclosed herein can be applied to electronic devices, which can be any device with audio playback function, such as mobile phones, tablets, and computers.

[0029] The aforementioned electronic devices play audio at a preset standard rate by default. During audio playback, users can adjust the playback speed to several times the preset standard rate.

[0030] The process of playing audio at double speed can be achieved by an audio speed-changing playback device. Figure 1 An exemplary schematic diagram of a prior art audio speed-changing playback device is shown. (Refer to...) Figure 1 As shown, the audio speed-changing playback device includes: a speed-changing processor and a player.

[0031] use Figure 1 When the audio speed-changing playback device shown plays audio, firstly, the speed-changing processor can perform at least one first processing on the original audio data, including but not limited to: format conversion, channel conversion, audio decoding, and sampling; then, the speed-changing processor can perform speed-changing processing on the audio data after the first processing; finally, the player can play the speed-changed audio data.

[0032] In practical applications, audio usually needs to be encoded before transmission, that is, converted from analog audio data to digital audio data. Therefore, before playing the audio, it is necessary to decode the audio, that is, convert the digital audio data back into analog audio data.

[0033] Format conversion is used to convert audio formats from a first format to a second format supported by the player. Of course, if the player supports the first format, no format conversion is needed. Audio formats can include, but are not limited to: MP3 (Media Player Three), FLAC (lossless audio codec), and WAV (Windows Wave).

[0034] Sampling is the process of converting sound waves into binary data.

[0035] Channel conversion is the process of changing the number of audio channels. For example, converting one-channel audio to two-channel audio, or converting four-channel audio to two-channel audio.

[0036] The speed processor in the above process can be an AV filter (audio video filter) provided by ffmpeg (Fast Forward Moving Picture Experts Group, an open-source computer program that can record, convert, and stream digital audio and video). Since this embodiment only uses its audio processing function, it is referred to as an audio filter in this embodiment.

[0037] In existing technologies, because the speed adjustment parameters of the aforementioned AVfilter are set during creation and cannot be modified subsequently, the AVfilter can only adjust the speed according to the parameters set at creation, and cannot adjust the speed according to the adjusted parameters of the original AVfilter. Therefore, to achieve audio playback with different speed parameters, a new AVfilter needs to be created, that is, a new speed processor needs to be created, and its speed adjustment parameters need to be set to the adjusted parameters. However, since the speed processor performs both initial processing and speed adjustment, recreating the speed processor will cause the loss of audio data that was processed initially but not adjusted. This results in discontinuous audio data played by the player, meaning poor playback smoothness.

[0038] To address the aforementioned technical problems, this embodiment of the disclosure splits the speed-adjusting processor, which performs the first processing and speed-adjusting, into two parts: a first audio filter for performing the first processing and a second audio filter for performing the speed-adjusting. Thus, upon receiving a rate adjustment command, a new second audio filter can be created to perform speed-adjusting on the audio data that underwent the first processing but not speed-adjusting in the first audio filter. This avoids the loss of audio data that underwent the first processing but not speed-adjusting in the first audio filter, thereby improving the smoothness of audio playback by the player.

[0039] The technical solutions of the present disclosure and how the technical solutions of the present disclosure solve the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of the present disclosure will now be described with reference to the accompanying drawings.

[0040] refer to Figure 2 , Figure 2 An exemplary flowchart of an audio playback method provided in an embodiment of this disclosure is shown. Figure 2 The method shown can be applied to electronic devices, see reference. Figure 2 As shown, the audio playback method includes:

[0041] S101: Receive rate adjustment command, which is used to adjust the audio playback rate from a first multiple of the preset standard rate to a second multiple of the preset standard rate.

[0042] The rate adjustment command can be a user-triggered command on the audio playback interface, used to adjust the audio playback rate from a second rate to a first rate. The second rate is a first multiple of the preset standard rate, and the first rate is a second multiple of the preset standard rate. In other words, when the first multiple is 1 and the second multiple is 2, the rate adjustment command adjusts the audio playback rate from the preset standard rate to twice the preset standard rate, meaning the audio is played at twice the speed.

[0043] In this embodiment, the speed adjustment parameter of the avfilter can be represented by a multiple of a preset standard rate, such as a second multiple and a first multiple. Of course, this multiple can be greater than 1 or less than 1. When the multiple is greater than 1, playback is accelerated. When the multiple is less than 1, playback is decelerated.

[0044] S102: Create a second audio filter that is a multiple of the second.

[0045] In existing technology, the speed-changing parameters of an audio filter used for speed-changing processing are set when the audio filter is created and cannot be modified subsequently. Therefore, it is impossible to achieve a second-fold speed-changing processing using the original audio filter with a first-fold speed change.

[0046] To achieve the second-multiple speed adjustment, a new audio filter needs to be created as the second audio filter, and the speed adjustment parameter of the second audio filter needs to be set to the second multiple.

[0047] Optionally, before creating the second audio filter, it is necessary to determine whether the amount of unplayed audio data obtained by using the first speed-changing factor has reached a preset unit playback volume. If it has, a second audio filter with a second speed-changing factor is created, proceeding to S103. If it has not, a second audio filter with a second speed-changing factor is not created, and the second audio data in the first buffer is processed by speed-changing factor according to the original first speed-changing factor until the amount of unplayed audio data obtained by using the first speed-changing factor reaches the preset unit playback volume, at which point the step of creating a second audio filter with a second speed-changing factor is initiated.

[0048] Among them, the amount of unplayed audio data obtained by using the first multiplier speed change can be the amount of audio data of the third audio data in the second buffer.

[0049] In practical applications, audio players play audio in preset units of playback. Audio data that doesn't reach the preset unit of playback is discarded and cannot be played. Therefore, if a second audio filter is created when the amount of unplayed audio data obtained using the first speed adjustment is less than the preset unit of playback, the unplayed audio data obtained using the first speed adjustment will be discarded, resulting in poor playback smoothness.

[0050] To address the aforementioned issues, this embodiment creates a second audio filter when the above conditions are met. This ensures that the original second audio filter, at a multiple of the first, has undergone speed-changing processing to obtain a complete and playable second audio data. Since this portion of the second audio data is playable, it is avoided from being discarded, thus contributing to further improved playback smoothness.

[0051] S103: Call the second audio filter to perform a second-fold speed change on the second audio data in the first buffer to obtain the third audio data. The second audio data is obtained after the first audio filter performs a first processing on the first audio data. The first processing includes at least one of the following: audio decoding, format conversion, sampling, and channel conversion.

[0052] The speed change process can be performed once or multiple times. During each speed change process, Figure 3 The second audio filter in Figure 3 A certain amount of second audio data is retrieved from the first buffer and processed at varying speeds. This process is repeated until the first buffer is empty.

[0053] The aforementioned speed adjustment can be understood as adjusting the playback duration while preserving the audio content. In other words, it transforms an audio file that requires a duration of t1 to play into one that requires a duration of t2. When t1 is greater than t2, the speed adjustment parameter increases, and the amount of audio data corresponding to duration t2 is typically greater than that corresponding to duration t1, thus achieving accelerated playback. When t1 is less than t2, the speed adjustment parameter decreases, and the amount of audio data corresponding to duration t2 is typically less than that corresponding to duration t1, thus achieving decelerated playback.

[0054] After obtaining the aforementioned third audio data, the third audio data can be stored in [location]. Figure 3 The second audio filter corresponds to the second buffer. When the preset number of playbacks is reached, the third audio data of the preset number of playbacks is retrieved from... Figure 3 The second cache shown is moved to Figure 3 The player cache is shown to enable playback. At this point, the second cache no longer stores the second audio data that has been moved to the player cache.

[0055] Of course, the second cache and the player cache can also be merged into one cache, and this disclosure does not limit this embodiment.

[0056] In practical applications, before performing the first processing, the first audio filter can determine whether the first buffer has reached a preset audio data volume. If the preset audio data volume is reached, it means that the first buffer is full, and the first audio filter needs to stop performing the first processing. If the preset audio data volume is not reached, it means that the first buffer is not full, and the first audio filter can perform the first processing and store the second audio data obtained from the first processing into the first buffer.

[0057] Optionally, before invoking the second audio filter to perform a second-multiple speed change on the second audio data in the first buffer, a first marker of the second audio data in the first buffer can be deleted. Since this first marker indicates that the second audio data has been speed-changed but not played, the second audio data corresponding to the deleted first marker is audio data that has been speed-changed by a first multiple but not played.

[0058] Understandably, deleting the first marker indicates that the second audio data has not undergone speed adjustment, thus requiring re-speed adjustment according to a second multiple. This achieves the goal of re-speeding second audio data that has been adjusted to a first multiple but not played, and then playing it again according to a second multiple. This ensures that unplayed audio data is played according to the new speed adjustment parameters, reducing the response latency to rate adjustment commands and improving the timeliness of response to rate adjustment commands.

[0059] Corresponding to the above-mentioned deletion of the first marker, before performing speed-changing processing on the second audio data by any multiple, the second audio data must be set to the first marker, indicating that speed-changing processing on this part of the second audio data has begun. Furthermore, when the amount of audio data obtained from speed-changing processing of the second audio data in the first buffer reaches a preset unit playback count, the second audio data with the first marker is deleted from the first buffer.

[0060] The above process ensures the accuracy of deleting the second audio data that has undergone speed-changing processing in the first buffer, and avoids deleting the second audio data that has not undergone speed-changing processing, which helps to further improve playback smoothness.

[0061] Optionally, to avoid adding third audio data to the player cache when the player cache is full, embodiments of this disclosure can determine the amount of audio data in the player cache, and only perform speed-changing processing on the second audio data in the first cache when the amount of audio data is less than or equal to a first data amount threshold.

[0062] It should be noted that when the audio is played at the preset standard rate, it can be considered that the audio is processed by a multiple of 1. The amount of audio data before and after the speed change is the same, which is the preset unit playback volume M.

[0063] When audio is played at a rate greater than the preset standard rate, the audio is speed-changed by a factor greater than 1, resulting in a smaller audio data size after speed-changing than before speed-changing.

[0064] When audio is played at a rate lower than the preset standard rate, the audio is speed-changed by a factor less than 1, resulting in a larger audio data size after speed-changing than before speed-changing.

[0065] S104: Play the third audio data.

[0066] It is understandable that the third audio data can be audio data obtained through one or more speed-changing processes.

[0067] When the amount of third audio data obtained from a single speed-changing process reaches the preset unit playback count, the third audio data is stored from the second buffer to the player buffer, and the third audio data in the second buffer is deleted; then, the player is invoked to play the third audio data in the player buffer. In practical applications, when the second multiple is less than or equal to 1, the amount of third audio data obtained from a single speed-changing process reaches the preset unit playback count. It should be noted that using three independent buffers—the first buffer, the second buffer, and the player buffer—helps reduce noise and static during audio playback.

[0068] If the amount of third audio data obtained from a single speed-changing process does not reach the preset playback unit, audio data continues to be retrieved from the first buffer and processed at a second multiple until the accumulated third audio data reaches the preset playback unit. This accumulated third audio data is then stored in the player's buffer, and the player plays the third audio data from the buffer. In practical applications, when the second multiple is greater than 1, the amount of third audio data obtained from a single speed-changing process does not reach the preset playback unit. For example, if the second multiple is 2, the amount of third audio data obtained from two speed-changing processes reaches the preset playback unit.

[0069] Optionally, after receiving the rate adjustment instruction, since the second multiple is different from the first multiple, the size of the first buffer can be adjusted to make reasonable use of the buffer space. In this embodiment of the disclosure, the size of the first buffer can be adjusted according to a preset function and a second multiple, wherein the preset function is used to represent the correspondence between the size of the player buffer, the size of the first buffer, and the audio playback rate.

[0070] The size of the player buffer can be set according to the actual application scenario. When the player buffer is set smaller, the real-time performance of audio playback is better; conversely, when the player buffer is set larger, the real-time performance of audio playback is worse. The size of the player buffer is fixed after being set and does not change with the audio playback rate.

[0071] The preset function can be derived from historical experience. Since the player's buffer size is fixed, the size of the first buffer changes with the audio playback rate. When the audio playback rate increases, the first buffer increases; when the audio playback rate decreases, the first buffer decreases.

[0072] Figure 4 A detailed process diagram illustrating an audio playback method provided by an embodiment of this disclosure is shown as an example. From Figure 4 As can be seen from this, the detailed process of the audio playback method may include the following steps:

[0073] S1: Determine if the first cache is full. If the first cache is not full, proceed to S2; if the first cache is full, proceed to S4.

[0074] It is understandable that checking whether the first buffer is full before performing the first processing on the first audio data can prevent the second audio data after the first processing from being unable to be stored when the first buffer is full.

[0075] S2: Perform the first processing on the first audio data, and then proceed to S3 and S5.

[0076] S3: Store the processed second audio data into the first buffer.

[0077] S4: Waiting timeout, i.e., waiting for a preset time. No initial processing will be performed within this preset time. After waiting for the preset time, proceed to S5.

[0078] The preset duration can be determined based on the playback duration per preset unit of views. The preset duration can be a multiple of the playback duration per preset unit of views, including one time. To ensure the accuracy of the preset duration, the playback duration per preset unit of views can be counted in real time to update the preset duration.

[0079] S5: Determine if the player cache is full. If the player cache is full, proceed to S1; if the player cache is not full, proceed to S6.

[0080] It's understandable that speed adjustment is performed when the player's cache is not full, allowing the adjusted third-level audio data to be stored in the player's cache. When the player's cache is full, speed adjustment is not performed to prevent the adjusted third-level audio data from being unable to be stored.

[0081] S6: Determine whether a rate adjustment command has been received. If a rate adjustment command has been received, proceed to S7; if no rate adjustment command has been received, proceed to S9.

[0082] Understandably, even without receiving a rate adjustment instruction, the second audio data in the first buffer is still processed at the original first multiple.

[0083] S7: Determine whether the amount of unplayed audio data obtained using the first speed multiplier has reached the preset unit playback count. If it has reached the preset unit playback count, proceed to S8; if the amount of unplayed audio data obtained using the first speed multiplier has not reached the preset unit playback count, proceed to S9.

[0084] The amount of unplayed audio data obtained by using the first speed multiplier is the amount of audio data in the second buffer.

[0085] S8: Create a second audio filter, delete the first tag of the second audio data in the first buffer, set the speed parameter to the second multiple, and proceed to S9.

[0086] S9: The second audio data in the first buffer is processed sequentially by changing the speed parameters, and then proceeds to S10 and S11.

[0087] S10: Delete the second audio data that has finished speed change processing from the first buffer.

[0088] Specifically, when the amount of audio data of the third audio data in the second cache reaches a preset unit playback count, the second audio data with the first tag is deleted from the first cache.

[0089] S11: Call the player to play the third audio data in the player's cache.

[0090] S12: Release player cache.

[0091] The player caches audio data for each preset unit of playback, and deletes the audio data for that preset unit of playback after it has finished playing.

[0092] Corresponding to the audio playback method in the above embodiments, Figure 5 An exemplary structural block diagram of an electronic device provided by an embodiment of this disclosure is shown. For ease of explanation, only the parts relevant to the embodiments of this disclosure are shown. (Refer to...) Figure 5 The aforementioned electronic device 200 includes: a rate adjustment instruction receiving module 201, a filter creation module 202, a first speed processing module 203, and a first audio playback module 204.

[0093] The rate adjustment instruction receiving module 201 is used to receive a rate adjustment instruction, which is used to adjust the audio playback rate from a first multiple of the preset standard rate to a second multiple of the preset standard rate.

[0094] Filter creation module 202 is used to create a second audio filter for the second multiple.

[0095] The first speed-changing processing module 203 is used to call the second audio filter to perform speed-changing processing on the second audio data in the first buffer by the second multiple to obtain the third audio data. The second audio data is obtained after the first audio filter performs a first processing on the first audio data. The first processing includes at least one of the following: audio decoding, format conversion, sampling, and channel conversion.

[0096] The first audio playback module 204 is used to play the third audio data.

[0097] Optionally, the filter creation module 202 described above is also used for:

[0098] If the amount of unplayed audio data obtained using the first speed multiplier reaches the preset unit playback volume, then a second audio filter with the second speed multiplier is created.

[0099] Optionally, the aforementioned electronic device 200 further includes:

[0100] The first marker deletion module is used to call the second audio filter to perform the second multiple speed change processing on the second audio data in the first buffer. Before obtaining the third audio data, the first marker of the second audio data in the first buffer is deleted. The first marker is used to indicate that the second audio data has been speed changed but has not been played.

[0101] Optionally, the aforementioned electronic device 200 further includes:

[0102] The second speed-changing processing module is used to process the second audio data in the first buffer by the first speed-changing factor if the amount of unplayed audio data obtained by using the first speed-changing factor does not reach the preset unit playback amount, until the amount of unplayed audio data obtained by using the first speed-changing factor reaches the preset unit playback amount, and then proceed to the step of creating the second audio filter with the second speed-changing factor.

[0103] Optionally, the aforementioned electronic device 200 further includes:

[0104] A tagging module is used to set the first tag on the second audio data in the first buffer before performing speed-changing processing on the second audio data in the first buffer.

[0105] Optionally, the aforementioned electronic device 200 further includes:

[0106] The audio data deletion module is used to delete the second audio data with the first mark from the first cache when the amount of audio data obtained by speed-changing the second audio data in the first cache reaches a preset unit playback volume.

[0107] Optionally, the third audio data is stored in the second buffer, and the first audio playback module 204 is further configured to:

[0108] When the amount of the third audio data reaches a preset unit playback count, the third audio data is stored from the second cache to the player cache, and the third audio data in the second cache is deleted; the player is then invoked to play the third audio data in the player cache.

[0109] Optionally, the first speed change processing module 203 described above is further used for:

[0110] If the amount of audio data in the player's cache is less than or equal to the first data volume threshold, the second audio filter is invoked to perform the second multiple speed change on the second audio data in the first cache to obtain the third audio data.

[0111] Optionally, the aforementioned electronic device 200 further includes:

[0112] The first buffer size adjustment module is used to adjust the size of the first buffer according to a preset function and a second multiple. The preset function is used to represent the correspondence between the size of the player buffer, the size of the first buffer, and the audio playback rate.

[0113] The electronic device provided in this embodiment can be used to perform the above-described... Figure 2 The technical solutions of the method embodiments shown are similar in implementation principle and technical effect, and will not be described again here.

[0114] Figure 6 An exemplary structural block diagram of an electronic device 600 provided in an embodiment of this disclosure is shown. The electronic device 600 includes a memory 602 and at least one processor 601;

[0115] Among them, memory 602 stores computer-executed instructions;

[0116] At least one processor 601 executes computer execution instructions stored in memory 602, causing electronic device 601 to perform the aforementioned functions. Figure 2 Audio playback methods in [the context of the text].

[0117] In addition, the electronic device may also include a receiver 603 and a transmitter 604, wherein the receiver 603 is used to receive information from other devices or equipment and forward it to the processor 601, and the transmitter 604 is used to send information to other devices or equipment.

[0118] Further, refer to Figure 7 The diagram illustrates a structural schematic of an electronic device 900 suitable for implementing embodiments of the present disclosure. This electronic device 900 can be a terminal device. The terminal device can include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, personal digital assistants (PDAs), portable Android devices (PADs), portable media players (PMPs), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 7 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0119] like Figure 7 As shown, the electronic device 900 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 into a random access memory (RAM) 903. The RAM 903 also stores various programs and data required for the operation of the electronic device 900. The processing unit 901, ROM 902, and RAM 903 are interconnected via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0120] Typically, the following devices can be connected to I / O interface 905: input devices 906 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 907 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 908 including, for example, magnetic tapes, hard disks, etc.; and communication devices 909. Communication device 909 allows electronic device 900 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 7 An electronic device 900 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0121] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 909, or installed from a storage device 908, or installed from a ROM 902. When the computer program is executed by a processing device 901, it performs the functions defined in the methods of embodiments of this disclosure.

[0122] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0123] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0124] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above embodiments.

[0125] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0126] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0127] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".

[0128] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0129] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0130] In a first example of the first aspect, this disclosure provides an audio playback method, including:

[0131] Receive a rate adjustment command, the rate adjustment command being used to adjust the audio playback rate from a first multiple of a preset standard rate to a second multiple of a preset standard rate;

[0132] Create a second audio filter for the second multiple;

[0133] The second audio filter is invoked to perform speed-changing processing on the second audio data in the first buffer by the second multiple, resulting in the third audio data. The second audio data is obtained after the first audio filter performs a first processing on the first audio data. The first processing includes at least one of the following: audio decoding, format conversion, sampling, and channel conversion.

[0134] Play the third audio data.

[0135] Based on the first example of the first aspect, in the second example of the first aspect, the creation of the second audio filter for the second multiple includes:

[0136] If the amount of unplayed audio data obtained using the first multiplier speed adjustment reaches a preset unit playback volume, then a second audio filter with the second multiplier speed adjustment is created.

[0137] Based on the second example of the first aspect, in the third example of the first aspect, before calling the second audio filter to perform the second multiple speed-changing processing on the second audio data in the first buffer to obtain the third audio data, the method further includes:

[0138] Delete the first marker of the second audio data in the first cache, the first marker being used to indicate that the second audio data has been speed-changed but not played.

[0139] Based on the second example of the first aspect, in the fourth example of the first aspect, the method further includes:

[0140] If the amount of unplayed audio data obtained by using the first multiplier speed change does not reach the preset unit playback amount, then the second audio data in the first buffer is speed-changed using the first multiplier until the amount of unplayed audio data obtained by using the first multiplier speed change reaches the preset unit playback amount, and then the step of creating the second audio filter with the second multiplier is entered.

[0141] Based on the third example of the first aspect, in the fifth example of the first aspect, the method further includes:

[0142] Before performing speed-changing processing on the second audio data in the first cache, the first flag is set on the second audio data in the first cache.

[0143] Based on the fifth example of the first aspect, in the sixth example of the first aspect, the method further includes:

[0144] When the amount of audio data obtained by speed-changing the second audio data in the first cache reaches a preset number of playbacks, the second audio data with the first tag is deleted from the first cache.

[0145] Based on the first example of the first aspect, in the seventh example of the first aspect, the third audio data is stored in a second buffer, and playing the third audio data includes:

[0146] When the amount of the third audio data reaches a preset number of playbacks, the third audio data is stored from the second cache to the player cache, and the third audio data in the second cache is deleted.

[0147] The player is invoked to play the third audio data cached in the player.

[0148] Based on the seventh example of the first aspect, in the eighth example of the first aspect, the invocation of the second audio filter to perform the second multiple speed-changing processing on the second audio data in the first buffer to obtain the third audio data includes:

[0149] If the amount of audio data in the player's cache is less than or equal to the first data volume threshold, the second audio filter is invoked to perform the second multiple speed change on the second audio data in the first cache to obtain the third audio data.

[0150] Based on the seventh example of the first aspect, the ninth example of the first aspect also includes:

[0151] The size of the first buffer is adjusted according to a preset function and a second multiple, wherein the preset function is used to represent the correspondence between the size of the player buffer, the size of the first buffer, and the audio playback rate.

[0152] In a first example of the second aspect, an electronic device is provided, comprising:

[0153] A rate adjustment instruction receiving module is used to receive a rate adjustment instruction, which is used to adjust the audio playback rate from a first multiple of a preset standard rate to a second multiple of a preset standard rate.

[0154] A filter creation module is used to create a second audio filter for the second multiple.

[0155] The first speed-changing processing module is used to call the second audio filter to perform speed-changing processing on the second audio data in the first buffer by the second multiple to obtain the third audio data. The second audio data is obtained after the first audio filter performs a first processing on the first audio data. The first processing includes at least one of the following: audio decoding, format conversion, sampling, and channel conversion.

[0156] The first audio playback module is used to play the third audio data.

[0157] Based on the first example of the second aspect, in the second example of the second aspect, the above-mentioned filter creation module is also used for:

[0158] If the amount of unplayed audio data obtained using the first speed multiplier reaches the preset unit playback volume, then a second audio filter with the second speed multiplier is created.

[0159] Based on the second example of the second aspect, in the third example of the second aspect, the aforementioned electronic device further includes:

[0160] The first marker deletion module is used to call the second audio filter to perform the second multiple speed change processing on the second audio data in the first buffer. Before obtaining the third audio data, the first marker of the second audio data in the first buffer is deleted. The first marker is used to indicate that the second audio data has been speed changed but has not been played.

[0161] Based on the second example of the second aspect, in the fourth example of the second aspect, the aforementioned electronic device further includes:

[0162] The second speed-changing processing module is used to process the second audio data in the first buffer by the first speed-changing factor if the amount of unplayed audio data obtained by using the first speed-changing factor does not reach the preset unit playback amount, until the amount of unplayed audio data obtained by using the first speed-changing factor reaches the preset unit playback amount, and then proceed to the step of creating the second audio filter with the second speed-changing factor.

[0163] Based on the third example of the second aspect, in the fifth example of the second aspect, the aforementioned electronic device further includes:

[0164] A tagging module is used to set the first tag on the second audio data in the first buffer before performing speed-changing processing on the second audio data in the first buffer.

[0165] Based on the fifth example of the second aspect, in the sixth example of the second aspect, the aforementioned electronic device further includes:

[0166] The audio data deletion module is used to delete the second audio data with the first mark from the first cache when the amount of audio data obtained by speed-changing the second audio data in the first cache reaches a preset unit playback volume.

[0167] Based on the first example of the second aspect, in the seventh example of the second aspect, the third audio data is stored in the second buffer, and the aforementioned first audio playback module is further configured to:

[0168] When the amount of the third audio data reaches a preset unit playback count, the third audio data is stored from the second cache to the player cache, and the third audio data in the second cache is deleted; the player is then invoked to play the third audio data in the player cache.

[0169] Based on the seventh example of the second aspect, in the eighth example of the second aspect, the aforementioned first speed-changing processing module is further used for:

[0170] If the amount of audio data in the player's cache is less than or equal to the first data volume threshold, the second audio filter is invoked to perform the second multiple speed change on the second audio data in the first cache to obtain the third audio data.

[0171] Based on the seventh example of the second aspect, in the ninth example of the second aspect, the aforementioned electronic device further includes:

[0172] The first buffer size adjustment module is used to adjust the size of the first buffer according to a preset function and a second multiple. The preset function is used to represent the correspondence between the size of the player buffer, the size of the first buffer, and the audio playback rate.

[0173] Thirdly, according to one or more embodiments of the present disclosure, an electronic device is provided, comprising: at least one processor and a memory;

[0174] The memory stores computer-executed instructions;

[0175] The at least one processor executes computer execution instructions stored in the memory, causing the electronic device to implement the method described in any of the first aspects.

[0176] Fourthly, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, the computer-readable storage medium storing computer-executable instructions that, when executed by a processor, cause a computing device to implement the method described in any one of the first aspects.

[0177] Fifthly, according to one or more embodiments of the present disclosure, a computer program is provided for implementing the method described in any of the first aspects.

[0178] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.

[0179] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0180] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.

Claims

1. An audio playback method, characterized by, The method comprises: receiving a rate adjustment instruction, the rate adjustment instruction being used to adjust an audio playing rate from a first multiple of a preset standard rate to a second multiple of the preset standard rate; if an amount of unplayed audio data obtained by using the first multiple of the rate adjustment instruction reaches a preset unit playing amount, creating a second audio filter of the second multiple; deleting a first mark of second audio data in a first cache, the first mark being used to indicate that the second audio data has been processed by the first multiple of the rate adjustment instruction but has not been played; calling the second audio filter to process the second audio data in the first cache by the second multiple of the rate adjustment instruction, to obtain third audio data, the second audio data being obtained after first processing of first audio data by a first audio filter, the first processing at least including one of audio decoding, format conversion, sampling, and channel conversion; playing the third audio data.

2. The method of claim 1, wherein, The method further comprises: if the amount of unplayed audio data obtained by using the first multiple of the rate adjustment instruction does not reach the preset unit playing amount, processing the second audio data in the first cache by the first multiple of the rate adjustment instruction until the amount of unplayed audio data obtained by using the first multiple of the rate adjustment instruction reaches the preset unit playing amount, and then entering the step of creating the second audio filter of the second multiple.

3. The method of claim 1, wherein, The method further comprises: before processing the second audio data in the first cache by the first multiple of the rate adjustment instruction, setting the first mark for the second audio data in the first cache.

4. The method of claim 3, wherein, The method further comprises: when the amount of audio data obtained by processing the second audio data in the first cache by the first multiple of the rate adjustment instruction reaches the preset unit playing amount, deleting the second audio data with the first mark from the first cache.

5. The method of claim 1, wherein, The third audio data is stored in a second cache, and the playing of the third audio data comprises: when the amount of the third audio data reaches the preset unit playing amount, storing the third audio data from the second cache into a player cache and deleting the third audio data in the second cache; calling a player to play the third audio data in the player cache.

6. The method of claim 5, wherein, The calling of the second audio filter to process the second audio data in the first cache by the second multiple of the rate adjustment instruction to obtain the third audio data comprises: if an amount of audio data in a player cache is less than or equal to a first data amount threshold, calling the second audio filter to process the second audio data in the first cache by the second multiple of the rate adjustment instruction to obtain the third audio data.

7. The method of claim 5, wherein, The method further comprises: adjusting a size of the first cache according to a preset function and the second multiple of the rate adjustment instruction, the preset function being used to indicate a corresponding relationship among a size of the player cache, the size of the first cache, and the audio playing rate.

8. An electronic device, comprising: The method comprises: a rate adjustment instruction receiving module configured to receive a rate adjustment instruction, the rate adjustment instruction being used to adjust an audio playing rate from a first multiple of a preset standard rate to a second multiple of the preset standard rate; a filter creating module, configured to create a second audio filter of the second multiple if an amount of the audio data that is not played obtained by using the first multiple reaches a preset unit play amount; a first mark deleting module, configured to delete a first mark of the second audio data in the first cache, the first mark being used to indicate that the second audio data has been processed by the variable speed processing but has not been played; a first variable speed processing module, configured to invoke the second audio filter to process the second audio data in the first cache by the variable speed processing of the second multiple to obtain third audio data, the second audio data being obtained after the first audio filter processes the first audio data by a first processing, the first processing at least including one of the following: audio decoding, format conversion, sampling, and channel conversion; a first audio playing module, configured to play the third audio data.

9. An electronic device, comprising: comprising: at least one processor and a memory; the memory stores computer-executable instructions; the at least one processor executes the computer-executable instructions stored in the memory, so that the electronic device implements the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, the computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the computing device implements the method according to any one of claims 1 to 7.

11. A computer program, characterized in that, the computer program is used to implement the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and device for playing streaming media

    CN103051955A

  • System and method for time domain audio speed up, while maintaining pitch

    US20050209847A1