CN114385109B - Audio playing processing method and device, electronic equipment and storage medium - Google Patents
Audio playing processing method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN114385109B CN114385109B CN202210033716.6A CN202210033716A CN114385109B CN 114385109 B CN114385109 B CN 114385109B CN 202210033716 A CN202210033716 A CN 202210033716A CN 114385109 B CN114385109 B CN 114385109B
- Authority
- CN
- China
- Prior art keywords
- audio
- playing
- target
- played
- task
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/16—Sound input; Sound output
-
- G—PHYSICS
- G11—INFORMATION STORAGE
- G11C—STATIC STORES
- G11C7/00—Arrangements for writing information into, or reading information out from, a digital store
- G11C7/16—Storage of analogue signals in digital stores using an arrangement comprising analogue/digital [A/D] converters, digital memories and digital/analogue [D/A] converters
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Audiology, Speech & Language Pathology (AREA)
- General Health & Medical Sciences (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Signal Processing For Digital Recording And Reproducing (AREA)
Abstract
The disclosure relates to a processing method, a device, an electronic device, a computer readable storage medium and a computer program product for audio playing, wherein the method determines the type of a data source of audio to be played by receiving an audio playing instruction of the audio to be played, acquires an audio format and playing parameters of the audio to be played, generates a target playing task corresponding to the type of the data source, and calls a target player corresponding to the audio format to play the target playing task in response to the audio playing instruction when no playing task matched with the type of the data source exists in the playing task. Therefore, the problem of play errors caused by the fact that a plurality of play tasks under the same data source type are played simultaneously to influence the play effect is avoided, and the fact that only one play task in the same data source type can be played at the same time is ensured, so that the play effect is improved.
Description
Technical Field
The present disclosure relates to the field of audio processing technologies, and in particular, to a processing method, an apparatus, an electronic device, a computer readable storage medium, and a computer program product for audio playing.
Background
With the development of network technology, more and more users are used to online learning and entertainment through a network. For example, learning and entertainment is performed by playing audio data through a network platform. While audio data has a number of different formats, audio data in each format is typically played by a corresponding player.
In the related art, a playing service in a network platform may create a player to play corresponding audio data based on needs, for example, the playing service may create a corresponding player to play based on audio data in different formats to be played, and manage the created player. There are also occasions when one play service needs to call the player created by another play service to control the play, interruption and restoration of audio.
However, the existing method of creating and controlling the player by playing the service not only increases the service development cost, but also easily causes a problem of play errors when the playing service is more.
Disclosure of Invention
The disclosure provides a processing method, an apparatus, an electronic device, a computer readable storage medium and a computer program product for audio playing, so as to at least solve the problems of high cost and easy occurrence of playing errors in the related art in a manner of creating and controlling a player through a playing service. The technical scheme of the present disclosure is as follows:
According to a first aspect of an embodiment of the present disclosure, there is provided a processing method for audio playing, including:
receiving an audio playing instruction of audio to be played, and determining a data source type of the audio to be played, wherein the data source type comprises any one of an audio stream type and a non-audio stream type;
acquiring an audio format and playing parameters of the audio to be played, and generating a target playing task corresponding to the data source type;
and when the playing task matched with the data source type does not exist in the playing tasks, calling a target player corresponding to the audio format to play the target playing task in response to the audio playing instruction.
In one embodiment, the method further comprises: when a playing task matched with the data source type exists in the playing task, determining a player corresponding to the playing task; when the player is the same as the target player corresponding to the audio format, responding to the audio playing instruction, and indicating the player to switch the playing task being played into the target playing task.
In one embodiment, the method further comprises: when the player is different from the target player corresponding to the audio format, responding to the audio playing instruction, stopping the playing task which is being played by the player, and calling the target player corresponding to the audio format to play the target playing task.
In one embodiment, the method further comprises: and returning to continue playing the playing task when the playing of the target playing task is completed.
In one embodiment, before the target player corresponding to the audio format plays the target play task, the method further includes: and determining the player corresponding to the audio format as the target player according to the corresponding relation between the pre-established audio format and the player.
In one embodiment, the obtaining the audio format of the audio to be played includes: identifying a file extension of the audio to be played, and acquiring keyword information in the file extension; and determining an audio format corresponding to the keyword information according to a corresponding relation between the pre-established audio format and the keyword information, and taking the audio format as the audio format of the audio to be played.
According to a second aspect of embodiments of the present disclosure, there is provided a processing apparatus for audio playback, including:
an audio playing instruction receiving module configured to execute receiving an audio playing instruction of audio to be played, and determining a data source type of the audio to be played, wherein the data source type comprises any one of an audio stream type and a non-audio stream type;
The target playing task generating module is configured to acquire the audio format and the playing parameters of the audio to be played and generate a target playing task corresponding to the data source type;
and the playing processing module is configured to execute the target player corresponding to the audio format to play the target playing task in response to the audio playing instruction when the playing task matched with the data source type does not exist in the playing tasks.
In one embodiment, the play processing module is further configured to perform: when a playing task matched with the data source type exists in the playing task, determining a player corresponding to the playing task; when the player is the same as the target player corresponding to the audio format, responding to the audio playing instruction, and indicating the player to switch the playing task being played into the target playing task.
In one embodiment, the play processing module is further configured to perform: when the player is different from the target player corresponding to the audio format, responding to the audio playing instruction, stopping the playing task which is being played by the player, and calling the target player corresponding to the audio format to play the target playing task.
In one embodiment, the play processing module is further configured to perform: and returning to continue playing the playing task when the playing of the target playing task is completed.
In one embodiment, the apparatus further comprises a target player determination module configured to perform: before a target player corresponding to the audio format is called to play the target play task, determining the player corresponding to the audio format as the target player according to the corresponding relation between the pre-established audio format and the player.
In one embodiment, the target play task generation module is further configured to perform: identifying a file extension of the audio to be played, and acquiring keyword information in the file extension; and determining an audio format corresponding to the keyword information according to a corresponding relation between the pre-established audio format and the keyword information, and taking the audio format as the audio format of the audio to be played.
According to a third aspect of embodiments of the present disclosure, there is provided an electronic device, comprising: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the method for processing audio playback as described in the first aspect above.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer readable storage medium, which when executed by a processor of an electronic device, causes the electronic device to perform the method of processing audio playback as described in the first aspect above.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product comprising instructions therein, which when executed by a processor of an electronic device, enable the electronic device to perform the method of processing audio playback as described in the first aspect above.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects: determining the data source type of the audio to be played by receiving an audio playing instruction of the audio to be played, acquiring the audio format and playing parameters of the audio to be played, generating a target playing task corresponding to the data source type, and calling a target player corresponding to the audio format to play the target playing task in response to the audio playing instruction when the playing task matched with the data source type does not exist in the playing task. Therefore, the problem of play errors caused by the fact that a plurality of play tasks under the same data source type are played simultaneously to influence the play effect is avoided, and the fact that only one play task in the same data source type can be played at the same time is ensured, so that the play effect is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure and do not constitute an undue limitation on the disclosure.
Fig. 1 is a flowchart illustrating a processing method of audio playback according to an exemplary embodiment.
Fig. 2 is a flowchart illustrating a processing method of audio playback according to another exemplary embodiment.
Fig. 3 is a schematic diagram illustrating steps for obtaining an audio format of audio to be played according to an exemplary embodiment.
Fig. 4 is a flowchart illustrating a processing method of audio playback according to still another exemplary embodiment.
Fig. 5 is a block diagram illustrating a processing apparatus for audio playback according to an exemplary embodiment.
Fig. 6 is a block diagram of an electronic device, according to an example embodiment.
Detailed Description
In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the foregoing figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the disclosure described herein may be capable of operation in sequences other than those illustrated or described herein. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
It should be further noted that, the user information (including, but not limited to, user equipment information, user personal information, etc.) and the data (including, but not limited to, data for presentation, analyzed data, etc.) related to the present disclosure are information and data authorized by the user or sufficiently authorized by each party.
The processing method for audio playing provided by the disclosure can be applied to a terminal. As shown in fig. 1, the following steps are included.
In step S110, an audio playing instruction of the audio to be played is received, and a data source type of the audio to be played is determined.
The audio to be played refers to audio materials to be played, such as a song, a piece of music, a recording file, a piece of voice message, and the like. The audio playing instruction is an instruction or command for instructing the terminal to play the audio to be played. The data source type then includes any one of an audio stream type and a non-audio stream type, specifically, the audio stream type refers to audio transmitted through a streaming technology on a network, such as an audio stream; the non-audio stream type refers to audio that is not transmitted by streaming technology, such as a local audio file. Therefore, the corresponding data source type can be obtained based on the transmission mode of the audio to be played.
In this embodiment, the terminal determines the type of the data source of the audio to be played by receiving an audio playing instruction of the audio to be played according to the transmission mode of the audio to be played, that is, determines whether the audio to be played is an audio stream.
Specifically, the terminal may be a computer, a smart phone, a tablet computer, or the like. The terminal can be provided with a client, and various audio data can be processed and played through the client.
In step S120, an audio format and a playing parameter of the audio to be played are obtained, and a target playing task corresponding to the data source type is generated.
The audio format refers to a mode of playing or processing an audio file in a terminal and performing digital-to-analog conversion on the audio file. For example, common Audio formats include a CD (Compact Disk) format, a WAVE format (which is a sound file format developed by microsoft corporation that conforms to the file specification of PIFF (Resource Interchange File Format, resource interchange file format)), an AIFF format (Audio Interchange File Format ), an MPEG format (Moving Picture Experts Group, dynamic image expert group), a WMA format (Windows Media Audio, windows media Audio format), an Audio format (which is a compressed digital Audio format proposed by Sun Microsystems corporation), MIDI (Musical Instrument Digital Interface ) format, and the like. The audio files are processed or converted in different ways during playing.
The playing parameters include the data source of the audio to be played, and setting parameters, such as the file address of the audio to be played, setting volume, etc. The target playing task is a task for playing audio to be played, and is an object of playing processing by the terminal.
In this embodiment, after determining the data source type of the audio to be played through the above steps, the terminal further identifies the audio format of the audio to be played, obtains the corresponding playing parameters, and further generates the target playing task corresponding to the data source type. For example, when the data source type of the audio to be played is determined to be an audio stream, a target playing task of the audio stream type is generated based on the audio format and the playing parameters of the audio to be played. And when the data source type of the audio to be played is determined not to be the audio stream, generating a target playing task of a non-audio stream type based on the audio format and the playing parameters of the audio to be played.
In step S130, when there is no play task matching the data source type among the tasks being played, a target player corresponding to the audio format is called to play the target play task in response to the audio play instruction.
The target player is a player for playing the target playing task. And players are specific applications for audio playback. Because the audio files are processed or converted in different modes during playing, the audio files have corresponding players for different audio formats. For example, for Audio files in Audio format, the corresponding player is play Audio Buffer (i.e., audio stream player), and for Audio files in MPEG format, the corresponding player may be an MP4 player. There are also powerful players with the ability to play audio files in multiple audio formats.
Specifically, after generating the corresponding target playing task according to the above steps, in order to avoid that a plurality of playing tasks are played simultaneously to affect the playing effect, the embodiment further determines whether there is a playing task matching with the data source type in the tasks currently being played by the terminal. Only when the playing task matched with the data source type does not exist in the currently playing tasks, responding to the audio playing instruction, and calling a target player corresponding to the audio format to play the target playing task. For example, if the data source type of the target playing task is an audio stream, further determining whether the playing task currently being played is an audio stream type playing task, and only when the playing task currently being played is not an audio stream type, that is, the playing task currently having no audio stream type is playing, invoking the target player corresponding to the audio format of the audio to be played to play the corresponding target playing task, so as to ensure that only one playing task of the same data source type can be played at the same time.
In the processing method for playing the audio, the data source type of the audio to be played is determined by receiving the audio playing instruction of the audio to be played, the audio format and the playing parameters of the audio to be played are acquired, the target playing task corresponding to the data source type is generated, and when the playing task matched with the data source type does not exist in the playing task, the target player corresponding to the audio format is called to play the target playing task in response to the audio playing instruction. Therefore, the problem of play errors caused by the fact that a plurality of play tasks under the same data source type are played simultaneously to influence the play effect is avoided, and the fact that only one play task in the same data source type can be played at the same time is ensured, so that the play effect is improved.
In an exemplary embodiment, as shown in fig. 2, the above processing method for audio playing may further include the following steps:
in step S210, when a play task matching the data source type exists in the tasks being played, a player corresponding to the play task is determined.
The playing task refers to a task currently being played, and the player refers to a player used by the task currently being played. Specifically, when it is determined that a play task matching the data source type of the audio to be played exists in the task being played, that is, when the data source type of the play task being played is the same as the data source type of the audio to be played, a player used by the task being played is further determined, whether the currently used player is the same as a target player corresponding to the audio format of the audio to be played is determined, and then playing processing is performed based on subsequent steps.
In step S220, when the player is the same as the target player corresponding to the audio format, the player is instructed to switch the playing task being played to the target playing task in response to the audio playing instruction.
Specifically, if it is determined that the player used by the task currently being played is the same as the target player corresponding to the audio format of the audio to be played, the player is instructed to switch the playing task being played to the target playing task in response to the audio playing instruction. Because the player used by the task currently being played is the same as the target player required to be used by the target playing task corresponding to the audio to be played, the player can be directly controlled to pause the task currently being played and play the target playing task based on the audio playing instruction.
In the above embodiment, when a playing task matching the data source type exists in the playing tasks, a player corresponding to the playing task is determined, and when the player is the same as a target player corresponding to the audio format, the player is instructed to switch the playing task being played to the target playing task in response to the audio playing instruction. When the player used by the task currently being played is determined to be the same as the target player required to be used by the target playing task, the embodiment directly controls the player to pause the task currently being played based on the audio playing instruction and plays the target playing task, so that the centralized management and control of the player and the playing task are realized, and the problem of playing errors is avoided.
In an exemplary embodiment, the method may further include: when the player is different from the target player corresponding to the audio format, responding to the audio playing instruction, stopping the playing task which is being played by the player, and calling the target player corresponding to the audio format to play the target playing task.
Specifically, when it is determined that the player used by the task currently being played is different from the target player required to be used by the target playing task, switching between the player and the playing task is performed in response to the audio playing instruction. For example, a player used for a task currently being played is paused, and a target player corresponding to an audio format of audio to be played is called to play a target play task, so that the player currently being used is switched to the target player, and the task currently being played is switched to the target play task. So as to realize centralized control of the player and the playing task and avoid the occurrence of the problem of playing errors.
In an exemplary embodiment, the method may further include: and returning to continue playing the playing task when the playing of the target playing task is completed. The playing task refers to a task which is paused when the target playing task is played, and the data source type of the playing task is matched with the data source type of the target playing task. Specifically, when the playing of the target playing task corresponding to the audio to be played is completed, the playing task paused before the playing is continued is returned. In this embodiment, when the playing of the target playing task is completed, the playing task is returned to continue playing, so that centralized control over the playing task is realized, the playing error is avoided, and the playing effect can be improved.
In an exemplary embodiment, before invoking the target player corresponding to the audio format to play the target play task in step S130, the method may further include: and determining the player corresponding to the audio format as a target player according to the pre-established corresponding relation between the audio format and the player.
The manner in which the audio files are processed or converted during playback varies from audio format to audio format, and for different audio formats there is a corresponding player. Therefore, in this embodiment, by establishing a correspondence between the audio format and the player in advance, a player corresponding to the audio format of the audio to be played may be determined based on the correspondence, and the player may be used as the target player. In this embodiment, through the corresponding relationship between the audio format and the player established in advance, the target player corresponding to the audio format of the audio to be played, that is, the target player corresponding to the target playing task, can be quickly determined, so that the playing effect is further improved. And when the audio format is newly added or the player needs to be expanded, the corresponding relation is correspondingly configured or adjusted based on the newly added audio format or the expanded player without redevelopment.
In an exemplary embodiment, as shown in fig. 3, in step S120, the audio format of the audio to be played is obtained, and specifically the method may further include the following steps:
in step S122, the file extension of the audio to be played is identified, and keyword information in the file extension is acquired.
Among them, file extension (Filename Extension), also called the suffix name of the file, is a mechanism used by the operating system to tag the file type. The extension is almost an integral part of each file, and if a file does not have an extension, the operating system cannot tell how to handle the file and cannot handle it.
The keyword information is a flag in the file extension for distinguishing the file format, for example, a Word file, where the keyword information in the file extension is ". Doc" or ". Docx", for example, an Excel file, and the keyword information in the file extension is ". Xls" or ". Xlsx". For the file extension of the audio to be played in this embodiment, the keyword information in the file extension is different based on different audio formats. For example, for an audio file in the WAVE format, the keyword information in the corresponding file extension thereof is ". WAV", and for an audio file in the AIFF format, the keyword information in the corresponding file extension thereof is ". AIF" or ". AIFF".
Specifically, in this embodiment, by identifying the file extension of the audio to be played, keyword information in the file extension is obtained, so that the audio format of the audio to be played can be determined according to the subsequent steps.
In step S124, an audio format corresponding to the keyword information is determined as an audio format of the audio to be played according to the correspondence between the audio format and the keyword information established in advance.
Since the keyword information is a flag in the file extension for distinguishing the file format, the keyword information in the file extension is different for different audio formats. Therefore, in this embodiment, by pre-establishing a correspondence between the audio format and the keyword information, the audio format of the audio to be played may be determined based on the identified keyword information in the file extension of the audio to be played and the correspondence. For example, if a correspondence between the audio format "WAVE format" and the keyword information ". WAV" is established in advance, and based on the recognition of the above steps, if the keyword information in the file extension of the audio to be played is obtained as ". WAV", based on the correspondence, it may be determined that the audio format corresponding to the keyword information ". WAV" is the "WAVE format", that is, the audio format of the audio to be played is the "WAVE format".
In this embodiment, by identifying the file extension of the audio to be played, acquiring the keyword information in the file extension, and according to the corresponding relationship between the audio format and the keyword information, the audio format corresponding to the keyword information can be quickly determined, that is, the audio format of the audio to be played can be quickly determined, and further, the corresponding player can be called to play according to the audio format, thereby further improving the playing effect.
In an exemplary embodiment, the processing method for playing the audio is further described below, as shown in fig. 4, and specifically includes the following steps:
in step S410, an audio playing instruction of the audio to be played is received, and a data source type of the audio to be played is determined.
Specifically, when the user has an audio playing requirement, an audio playing instruction of the audio to be played can be initiated based on the terminal, and the terminal can receive the corresponding audio playing instruction and determine the data source type of the audio to be played.
In step S420, the audio format and the playing parameters of the audio to be played are obtained, and a target playing task corresponding to the data source type is generated.
In step S430, a player corresponding to the audio format is determined as a target player according to the correspondence between the audio format and the player established in advance.
In step S440, it is determined whether there is a play task matching the data source type among the tasks currently being played. When not present, step S450 is performed, and when present, step S460 is performed.
In step S450, in response to the audio playing instruction, the target player is invoked to play the target playing task.
Specifically, when a playing task matched with the data source type does not exist in the playing tasks, a target player corresponding to the audio format is called to play the target playing task in response to the audio playing instruction.
In step S460, it is determined whether the player corresponding to the playing task currently being played is the same as the target player corresponding to the audio format. If the same, step S470 is performed, and if different, step S480 is performed.
In step S470, in response to the audio play instruction, the player is instructed to switch the playing task being played to the target playing task.
Specifically, when the player is the same as the target player corresponding to the audio format, the player is instructed to switch the playing task being played to the target playing task in response to the audio playing instruction.
In step S480, in response to the audio playing instruction, the playing task being played by the player is stopped, and the target player is invoked to play the target playing task.
Specifically, when the player is different from the target player corresponding to the audio format, responding to the audio playing instruction, stopping the playing task being played by the player, and calling the target player corresponding to the audio format to play the target playing task.
In step S490, when the playback of the target playback task is completed, the playback task that continues to play the pause is returned.
In this embodiment, by receiving an audio playing instruction of an audio to be played, determining a data source type of the audio to be played, and obtaining an audio format and a playing parameter of the audio to be played, generating a target playing task corresponding to the data source type, and further performing playing control based on a playing task, the data source type to which the target playing task belongs, and a player adopted, centralized control of the playing task and the player is achieved, the problem that a playing effect is affected due to simultaneous playing of a plurality of playing tasks under the same data source type, and a playing error is caused is avoided, and only one playing task of the same data source type can be played at the same time so as to improve playing quality.
It should be understood that, although the steps in the flowcharts of fig. 1-4 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least a portion of the steps of fig. 1-4 may include multiple steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor does the order in which the steps or stages are performed necessarily occur sequentially, but may be performed alternately or alternately with at least a portion of the steps or stages in other steps or other steps.
It should be understood that the same/similar parts of the embodiments of the method described above in this specification may be referred to each other, and each embodiment focuses on differences from other embodiments, and references to descriptions of other method embodiments are only needed.
Fig. 5 is a block diagram of a processing device for audio playback, according to an exemplary embodiment. Referring to fig. 5, the apparatus includes an audio play instruction receiving module 502, a target play task generating module 504, and a play processing module 506.
An audio play instruction receiving module 502 configured to perform receiving an audio play instruction of audio to be played, and determine a data source type of the audio to be played, where the data source type includes any one of an audio stream type and a non-audio stream type;
the target play task generating module 504 is configured to perform obtaining an audio format and a play parameter of the audio to be played, and generate a target play task corresponding to the data source type;
and the playing processing module 506 is configured to execute, when a playing task matched with the data source type does not exist in the playing tasks, calling a target player corresponding to the audio format to play the target playing task in response to the audio playing instruction.
In an exemplary embodiment, the play processing module is further configured to perform: when a playing task matched with the data source type exists in the playing task, determining a player corresponding to the playing task; when the player is the same as the target player corresponding to the audio format, responding to the audio playing instruction, and indicating the player to switch the playing task being played into the target playing task.
In an exemplary embodiment, the play processing module is further configured to perform: when the player is different from the target player corresponding to the audio format, responding to the audio playing instruction, stopping the playing task which is being played by the player, and calling the target player corresponding to the audio format to play the target playing task.
In an exemplary embodiment, the play processing module is further configured to perform: and returning to continue playing the playing task when the playing of the target playing task is completed.
In an exemplary embodiment, the apparatus further comprises a target player determination module configured to perform: before a target player corresponding to the audio format is called to play the target play task, determining the player corresponding to the audio format as the target player according to the corresponding relation between the pre-established audio format and the player.
In an exemplary embodiment, the target play task generation module is further configured to perform: identifying a file extension of the audio to be played, and acquiring keyword information in the file extension; and determining an audio format corresponding to the keyword information according to a corresponding relation between the pre-established audio format and the keyword information, and taking the audio format as the audio format of the audio to be played.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
Fig. 6 is a block diagram of an electronic device Z00 illustrating a process for audio playback according to an example embodiment. For example, electronic device Z00 may be a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, exercise device, personal digital assistant, or the like.
Referring to fig. 6, electronic device Z00 may include one or more of the following components: a processing component Z02, a memory Z04, a power component Z06, a multimedia component Z08, an audio component Z10, an input/output (I/O) interface Z12, a sensor component Z14, and a communication component Z16.
The processing component Z02 generally controls overall operation of the electronic device Z00, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component Z02 may include one or more processors Z20 to execute instructions to perform all or part of the steps of the methods described above. Further, the processing component Z02 may include one or more modules that facilitate interactions between the processing component Z02 and other components. For example, the processing component Z02 may include a multimedia module to facilitate interaction between the multimedia component Z08 and the processing component Z02.
The memory Z04 is configured to store various types of data to support operations at the electronic device Z00. Examples of such data include instructions for any application or method operating on electronic device Z00, contact data, phonebook data, messages, pictures, video, and the like. The memory Z04 may be implemented by any type of volatile or non-volatile memory device or combination thereof, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, optical disk, or graphene memory.
The power supply component Z06 provides power to the various components of the electronic device Z00. Power component Z06 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for electronic device Z00.
The multimedia component Z08 comprises a screen providing an output interface between said electronic device Z00 and the user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may sense not only the boundary of a touch or slide action, but also the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component Z08 includes a front camera and/or a rear camera. When the electronic device Z00 is in an operation mode, such as a photographing mode or a video mode, the front camera and/or the rear camera may receive external multimedia data. Each front and rear camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
The audio component Z10 is configured to output and/or input an audio signal. For example, the audio component Z10 includes a Microphone (MIC) configured to receive external audio signals when the electronic device Z00 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may be further stored in the memory Z04 or transmitted via the communication component Z16. In some embodiments, the audio component Z10 further comprises a speaker for outputting audio signals.
The I/O interface Z12 provides an interface between the processing component Z02 and a peripheral interface module, which may be a keyboard, click wheel, button, etc. These buttons may include, but are not limited to: homepage button, volume button, start button, and lock button.
The sensor assembly Z14 includes one or more sensors for providing status assessment of various aspects for the electronic device Z00. For example, sensor assembly Z14 may detect an on/off state of electronic device Z00, a relative positioning of the assemblies, such as a display and keypad of electronic device Z00, sensor assembly Z14 may also detect a change in position of electronic device Z00 or an electronic device Z00 assembly, the presence or absence of a user's contact with electronic device Z00, a device Z00 orientation or acceleration/deceleration, and a change in temperature of electronic device Z00. The sensor assembly Z14 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly Z14 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly Z14 may also include an acceleration sensor, a gyroscopic sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component Z16 is configured to facilitate wired or wireless communication between the electronic device Z00 and other devices. The electronic device Z00 may access a wireless network based on a communication standard, such as WiFi, an operator network (e.g., 2G, 3G, 4G, or 5G), or a combination thereof. In one exemplary embodiment, the communication component Z16 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component Z16 further includes a Near Field Communication (NFC) module to facilitate short range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device Z00 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic elements for performing the above method.
In an exemplary embodiment, a computer readable storage medium is also provided, such as a memory Z04, comprising instructions executable by a processor Z20 of the electronic device Z00 to perform the above method. For example, the computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
In an exemplary embodiment, a computer program product is also provided, comprising instructions therein, which are executable by the processor Z20 of the electronic device Z00 to perform the above method.
It should be noted that the descriptions of the foregoing apparatus, the electronic device, the computer readable storage medium, the computer program product, and the like according to the method embodiments may further include other implementations, and the specific implementation may refer to the descriptions of the related method embodiments and are not described herein in detail.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any adaptations, uses, or adaptations of the disclosure following the general principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims (15)
1. A method for processing audio playback, the method comprising:
receiving an audio playing instruction of audio to be played, and determining a data source type of the audio to be played, wherein the data source type comprises any one of an audio stream type and a non-audio stream type;
acquiring an audio format and playing parameters of the audio to be played, and generating a target playing task corresponding to the data source type;
and when the playing task matched with the data source type does not exist in the playing tasks, calling a target player corresponding to the audio format to play the target playing task in response to the audio playing instruction.
2. The method according to claim 1, wherein the method further comprises:
when a playing task matched with the data source type exists in the playing task, determining a player corresponding to the playing task;
when the player is the same as the target player corresponding to the audio format, responding to the audio playing instruction, and indicating the player to switch the playing task being played into the target playing task.
3. The method according to claim 2, wherein the method further comprises:
When the player is different from the target player corresponding to the audio format, responding to the audio playing instruction, stopping the playing task which is being played by the player, and calling the target player corresponding to the audio format to play the target playing task.
4. A method according to claim 2 or 3, characterized in that the method further comprises:
and returning to continue playing the playing task when the playing of the target playing task is completed.
5. A method according to any one of claims 1 to 3, wherein before the invoking the target player corresponding to the audio format to play the target play task, the method further comprises:
and determining the player corresponding to the audio format as the target player according to the corresponding relation between the pre-established audio format and the player.
6. A method according to any one of claims 1 to 3, wherein said obtaining an audio format of the audio to be played comprises:
identifying a file extension of the audio to be played, and acquiring keyword information in the file extension;
and determining an audio format corresponding to the keyword information according to a corresponding relation between the pre-established audio format and the keyword information, and taking the audio format as the audio format of the audio to be played.
7. A processing apparatus for audio playback, comprising:
an audio playing instruction receiving module configured to execute receiving an audio playing instruction of audio to be played, and determining a data source type of the audio to be played, wherein the data source type comprises any one of an audio stream type and a non-audio stream type;
the target playing task generating module is configured to acquire the audio format and the playing parameters of the audio to be played and generate a target playing task corresponding to the data source type;
and the playing processing module is configured to execute the target player corresponding to the audio format to play the target playing task in response to the audio playing instruction when the playing task matched with the data source type does not exist in the playing tasks.
8. The apparatus of claim 7, wherein the play processing module is further configured to perform:
when a playing task matched with the data source type exists in the playing task, determining a player corresponding to the playing task;
when the player is the same as the target player corresponding to the audio format, responding to the audio playing instruction, and indicating the player to switch the playing task being played into the target playing task.
9. The apparatus of claim 8, wherein the play processing module is further configured to perform:
when the player is different from the target player corresponding to the audio format, responding to the audio playing instruction, stopping the playing task which is being played by the player, and calling the target player corresponding to the audio format to play the target playing task.
10. The apparatus according to claim 8 or 9, wherein the play processing module is further configured to perform:
and returning to continue playing the playing task when the playing of the target playing task is completed.
11. The apparatus according to any one of claims 7 to 9, further comprising a target player determination module configured to perform:
before a target player corresponding to the audio format is called to play the target play task, determining the player corresponding to the audio format as the target player according to the corresponding relation between the pre-established audio format and the player.
12. The apparatus according to any one of claims 7 to 9, wherein the target play task generation module is further configured to perform:
Identifying a file extension of the audio to be played, and acquiring keyword information in the file extension;
and determining an audio format corresponding to the keyword information according to a corresponding relation between the pre-established audio format and the keyword information, and taking the audio format as the audio format of the audio to be played.
13. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the method of processing audio playback as claimed in any one of claims 1 to 6.
14. A computer readable storage medium, characterized in that instructions in the computer readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the method of processing audio playback according to any one of claims 1 to 6.
15. A computer program product comprising instructions which, when executed by a processor of an electronic device, enable the electronic device to perform the method of processing audio playback as claimed in any one of claims 1 to 6.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210033716.6A CN114385109B (en) | 2022-01-12 | 2022-01-12 | Audio playing processing method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210033716.6A CN114385109B (en) | 2022-01-12 | 2022-01-12 | Audio playing processing method and device, electronic equipment and storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN114385109A CN114385109A (en) | 2022-04-22 |
| CN114385109B true CN114385109B (en) | 2024-01-09 |
Family
ID=81201343
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210033716.6A Active CN114385109B (en) | 2022-01-12 | 2022-01-12 | Audio playing processing method and device, electronic equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN114385109B (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116320906A (en) * | 2023-03-28 | 2023-06-23 | 海宁奕斯伟集成电路设计有限公司 | Audio processing device, method, electronic device and storage medium |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108259985A (en) * | 2018-01-09 | 2018-07-06 | 武汉斗鱼网络科技有限公司 | Live audio sound mixing method, device, readable storage medium storing program for executing and equipment |
| CN111526404A (en) * | 2020-04-27 | 2020-08-11 | 杭州海康威视系统技术有限公司 | Single frame playing method, device, equipment and storage medium |
| CN111797270A (en) * | 2019-08-07 | 2020-10-20 | 厦门雅基软件有限公司 | Audio playing method and device, electronic equipment and computer readable storage medium |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP3076680A4 (en) * | 2013-11-25 | 2016-10-26 | Le Shi Zhi Xin Electronic Technology Tianjin Ltd | Video playback method, apparatus and intelligent terminal |
-
2022
- 2022-01-12 CN CN202210033716.6A patent/CN114385109B/en active Active
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108259985A (en) * | 2018-01-09 | 2018-07-06 | 武汉斗鱼网络科技有限公司 | Live audio sound mixing method, device, readable storage medium storing program for executing and equipment |
| CN111797270A (en) * | 2019-08-07 | 2020-10-20 | 厦门雅基软件有限公司 | Audio playing method and device, electronic equipment and computer readable storage medium |
| CN111526404A (en) * | 2020-04-27 | 2020-08-11 | 杭州海康威视系统技术有限公司 | Single frame playing method, device, equipment and storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN114385109A (en) | 2022-04-22 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN107122158A (en) | The method and device of broadcast information prompting audio, electronic equipment | |
| US12142296B2 (en) | Audio processing method and apparatus, and electronic device and storage medium | |
| CN111935357B (en) | Multimedia playing method and equipment | |
| CN108495168B (en) | Bullet screen information display method and device | |
| US7912444B2 (en) | Media portion selection system and method | |
| CN106024033B (en) | Control method for playing back and device | |
| CN107272896B (en) | Method and device for switching between VR mode and non-VR mode | |
| US11756586B2 (en) | Method for splicing audio file and computer device | |
| CN110943908A (en) | Voice message sending method, electronic device and medium | |
| CN112380362A (en) | Music playing method, device and equipment based on user interaction and storage medium | |
| JP2025521197A (en) | INTERACTION METHOD, DEVICE, ELECTRONIC DEVICE, STORAGE MEDIUM, AND COMPUTER PROGRAM | |
| CN114385109B (en) | Audio playing processing method and device, electronic equipment and storage medium | |
| CN113365010B (en) | Volume adjusting method, device, equipment and storage medium | |
| CN104837020B (en) | The method and apparatus for playing video | |
| CN106375846A (en) | Live audio processing method and device | |
| CN105472149A (en) | Ringtone setting method and apparatus thereof | |
| CN113655984A (en) | Audio playback control method, audio playback control device and computer storage medium | |
| CN113692067A (en) | Device connection method, device and readable storage medium | |
| CN104765686B (en) | The method and device of test application program | |
| CN112596696B (en) | Song recording method, device, terminal and storage medium | |
| CN112201283B (en) | Audio playing method and device | |
| CN107046650A (en) | Interface playback control method and device | |
| CN113704515B (en) | Multimedia output method and device | |
| CN110349599B (en) | Audio playback method and device | |
| CN114125545B (en) | Video information processing method, device, electronic equipment and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |