CN109599133B - Language audio track switching method and device, computer equipment and storage medium - Google Patents

Language audio track switching method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN109599133B
CN109599133B CN201811549608.4A CN201811549608A CN109599133B CN 109599133 B CN109599133 B CN 109599133B CN 201811549608 A CN201811549608 A CN 201811549608A CN 109599133 B CN109599133 B CN 109599133B
Authority
CN
China
Prior art keywords
language
audio data
audio
queue corresponding
audio track
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
Application number
CN201811549608.4A
Other languages
Chinese (zh)
Other versions
CN109599133A (en
Inventor
王云刚
董志敏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hisense Visual Technology Co Ltd
Original Assignee
Hisense Visual Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Hisense Visual Technology Co Ltd filed Critical Hisense Visual Technology Co Ltd
Priority to CN201811549608.4A priority Critical patent/CN109599133B/en
Publication of CN109599133A publication Critical patent/CN109599133A/en
Application granted granted Critical
Publication of CN109599133B publication Critical patent/CN109599133B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B20/00Signal processing not specific to the method of recording or reproducing; Circuits therefor
    • G11B20/10Digital recording or reproducing
    • G11B20/10527Audio or video recording; Data buffering arrangements
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B27/00Editing; Indexing; Addressing; Timing or synchronising; Monitoring; Measuring tape travel
    • G11B27/10Indexing; Addressing; Timing or synchronising; Measuring tape travel
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B20/00Signal processing not specific to the method of recording or reproducing; Circuits therefor
    • G11B20/10Digital recording or reproducing
    • G11B20/10527Audio or video recording; Data buffering arrangements
    • G11B2020/1062Data buffering arrangements, e.g. recording or playback buffers

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

The invention discloses a switching method and a switching device of language audio tracks, computer equipment and a storage medium, belonging to the technical field of monitoring and scheduling, wherein the method comprises the following steps: acquiring first audio data corresponding to a first language and second audio data corresponding to a second language, and respectively caching the first audio data and the second audio data into first-level cache queues corresponding to a first language audio track and a second language audio track in local storage; in response to a playing request for playing through the first language audio track, caching the first audio data in the primary cache queue corresponding to the first language audio track into a secondary cache queue corresponding to the first language audio track, and sending the first audio data to a module for playing sound; and in response to a first switching request for switching to the second language audio track, clearing the first audio data buffered in the module for sound playing. Therefore, when the player switches the audio track, silence can not occur for a period of time, and the playing effect of the player is improved.

Description

Language audio track switching method and device, computer equipment and storage medium
Technical Field
The present invention relates to the field of audio technologies, and in particular, to a method and an apparatus for switching a language audio track, a computer device, and a storage medium.
Background
When the player plays the audio and video containing a plurality of languages, the player can switch between playing the music tracks of different languages according to the requirements, for example, the player can switch between the Chinese music track or the English music track so as to meet the requirements of playing the sounds of different languages.
An existing player sends audio data corresponding to a music track selected by a user to a decoding module and a rendering module of the player according to the music track selection input by the user, and sound playing is performed through the decoder and the rendering module. In order to realize smooth sound playing, the player controls the decoder and the rendering module to pre-buffer audio data corresponding to a currently playing audio track for a period of time.
When switching to other tracks, the decoder and rendering module will remove the audio data corresponding to the currently playing track. When the current playing track is switched to again, because the audio data corresponding to the current track in the time period is already removed, the decoder and the rendering module cannot acquire the audio data corresponding to the current track for playing, so that the player may be muted for a period of time, which affects the playing effect of the player in playing the multi-language track video.
Disclosure of Invention
Based on this, in order to solve the technical problem that the player is muted for a period of time when the player switches the audio track in the related art, the invention provides an audio track switching method and device of the player, computer equipment and a storage medium.
In a first aspect, a method for switching language audio tracks is provided, which includes:
acquiring first audio data corresponding to a first language and second audio data corresponding to a second language, and respectively caching the first audio data and the second audio data into first-level cache queues corresponding to a first language audio track and a second language audio track in local storage;
in response to a playing request for playing through the first language audio track, caching the first audio data in the primary cache queue corresponding to the first language audio track into a secondary cache queue corresponding to the first language audio track, and sending the first audio data to a module for playing sound;
in response to a first switching request for switching to the second language audio track, clearing first audio data cached in the module for performing sound playing, caching second audio data cached in a primary cache queue corresponding to the second language audio track into a secondary cache queue corresponding to the second language audio track, and sending the second audio data to the module for performing sound playing, so that the module for performing sound playing performs sound playing according to the second audio data;
and in response to a second switching request for switching to the first language audio track, clearing second audio data cached in the module for performing sound playing, and sending the first audio data cached in a secondary cache queue corresponding to the first language audio track to the module for performing sound playing, so that the module for performing sound playing performs sound playing according to the first audio data.
In a second aspect, there is provided a speech sound track switching apparatus, including:
the acquisition unit is used for acquiring first audio data corresponding to a first language and second audio data corresponding to a second language, and respectively caching the first audio data and the second audio data into a first-level cache queue corresponding to a first language audio track and a second language audio track in local storage;
the first execution unit is used for responding to a playing request played through the first language audio track, caching the first audio data in the primary cache queue corresponding to the first language audio track into a secondary cache queue corresponding to the first language audio track, and sending the first audio data to a module for playing sound;
the second execution unit is used for responding to a first switching request for switching to the second language audio track, clearing first audio data cached in the module for sound playing, caching the second audio data cached in the first-level cache queue corresponding to the second language audio track into a second-level cache queue corresponding to the second language audio track, and sending the second audio data to the module for sound playing;
and the third execution unit is used for responding to a second switching request for switching to the first language audio track, clearing second audio data cached in the module for sound playing, and sending the first audio data cached in a secondary cache queue corresponding to the first language audio track to the module for sound playing.
In a third aspect, a computer device is provided, comprising a memory and a processor, wherein the memory has stored therein computer readable instructions, which when executed by the processor, cause the processor to perform the steps of the above-mentioned language track switching method.
In a fourth aspect, a storage medium is provided that stores computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the above-described language audio track switching method.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
when the player in the computer equipment plays the audio and video through the first language, even if the player is switched to the first language audio track corresponding to the first language again after being switched to other language audio tracks, the player can send the first audio data cached in the second level cache queue corresponding to the first language audio track to a module for playing the audio. The module for playing sound in the player can play the sound corresponding to the first language according to the first audio data, so that the player cannot be muted for a period of time when audio tracks are switched, and the playing effect of the player 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
Fig. 1 is a flowchart illustrating an implementation of a method for switching a language audio track according to an exemplary embodiment.
Fig. 2 is a block diagram illustrating a switching device of a language audio track according to an exemplary embodiment.
Fig. 3 schematically shows an example block diagram of an electronic device for implementing the above-described switching method of language tracks.
Fig. 4 schematically shows a computer-readable storage medium for implementing the switching method of the language tracks described above.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a flowchart illustrating an implementation of a method for switching between language tracks according to a first embodiment of the present invention, where an execution subject of the method for switching between language tracks in the present embodiment is a computer device, and the computer device is specifically a terminal including a player for playing sound and video. The method of language track switching as shown in fig. 1 may comprise the following steps.
Step S110, obtain first audio data corresponding to the first language and second audio data corresponding to the second language, and respectively cache the first audio data and the second audio data in the first-level cache queue corresponding to the first language audio track and the second language audio track in the local storage.
In step S110, when the computer device plays audio of an audio/video including different languages, the computer device sets corresponding language tracks for the different languages, where the language tracks are used to perform corresponding processing on audio data of the different languages, and the number of the language tracks in this embodiment is two, but may also be three or more. The method comprises the steps that the computer equipment obtains audio and video data containing different languages and obtains all audio data in the audio and video data; all audio data comprises first audio data corresponding to a first language and second audio data corresponding to a second language. After acquiring first audio data corresponding to a first language and second audio data corresponding to a second language, the computer device caches the first audio data and the second audio data into first-level cache queues corresponding to a first language audio track and a second language audio track in a local storage respectively.
Step S120, in response to a play request for playing through the first language audio track, buffering the first audio data buffered in the first-level buffer queue corresponding to the first language audio track into a second-level buffer queue corresponding to the first language audio track, and sending the first audio data to a module for audio playing.
In step S120, when the user needs the computer device to play the audio/video in the first language, a play request for playing through the first language audio track is input, and the computer device obtains the play request input by the user for playing through the first language audio track. When the computer equipment responds to a playing request for playing through a first language audio track, first audio data cached in a first-level cache queue corresponding to the first language audio track is cached in a second-level cache queue corresponding to the first language audio track, and the first audio data is issued to a module for playing sound. The second-level cache queue corresponding to the first language audio track is used for backing up the first audio data cached in the first-level cache queue corresponding to the first language audio track; in addition, the module for performing sound playing may be a decoding module and a rendering module, where the decoding module and the rendering module are used for performing sound playing according to the audio data, and certainly, the module for performing sound playing further includes other related modules for performing sound playing.
Step S130, in response to the first switching request for switching to the second language audio track, clearing the first audio data cached in the module for performing sound playing, caching the second audio data cached in the first-level cache queue corresponding to the second language audio track into the second-level cache queue corresponding to the second language audio track, and issuing the second audio data to the module for performing sound playing.
In step S130, when the user needs the computer device to play the audio/video in the second language, the computer device switches the input to the first switching request of the second language audio track, and the computer device obtains the first switching request of the second language audio track input by the user.
When the computer equipment responds to a first switching request for switching to a second language audio track, the data cached in a module for playing sound is cleared firstly, namely the first audio data cached in a decoding module and a rendering module are cleared; and caching the second audio data cached in the first-level cache queue corresponding to the second language audio track into a second-level cache queue corresponding to the second language audio track, and sending the second audio data to a module for sound playing. The second-level buffer queue corresponding to the second language audio track is used for backing up the second audio data buffered in the first-level buffer queue corresponding to the second language audio track, so that the module for performing sound playing performs sound playing according to the second audio data.
Step S140, in response to a second switching request for switching to the first language audio track, clearing second audio data cached in the module for performing sound playing, and sending the first audio data cached in the secondary cache queue corresponding to the first language audio track to the module for performing sound playing.
In step S140, when the user needs the computer device to play the audio/video in the first language again, a second switching request for switching the input to the first language audio track is input, and the computer device obtains the second switching request for switching the input of the user to the first language audio track. And when responding to a second switching request for switching to the first language audio track, the computer equipment clears the second audio data cached in the module for sound playing and sends the first audio data cached in the second level cache queue corresponding to the first language audio track to the module for sound playing.
When the computer equipment plays the audio and video through the first language, even if the audio and video is switched to other language audio tracks and then is switched to the first language audio track corresponding to the first language again, the first audio data cached in the second-level cache queue corresponding to the first language audio track can be sent to the module for playing the audio. The module for playing the sound can play the sound corresponding to the first language according to the first audio data, so that the computer equipment cannot be muted for a period of time when audio tracks are switched, and the playing effect of the computer equipment is improved.
In an embodiment, before the step of sending the first audio data buffered in the second-level buffer queue corresponding to the first language audio track to the module for performing sound playing, the method includes:
and judging whether the audio time of the first audio data cached in the second-level cache queue corresponding to the first language audio track is later than the current video playing time.
Before the computer device issues the first audio data cached in the second-level cache queue corresponding to the first language audio track to the module for playing sound, it needs to judge whether the audio time of the first audio data cached in the second-level cache queue corresponding to the first language audio track is later than the time of playing the current video, and it is intended to ensure that the playing time of the first audio data issued to the module for playing sound is later than the time of playing the current video, so that the sound played by the computer device and the time of playing the video can be synchronized.
The step of sending the first audio data cached in the second level cache queue corresponding to the first language audio track to the module for playing sound includes:
and if the audio time of the first audio data cached in the secondary cache queue corresponding to the first language audio track is later than the current video playing time, sending the first audio data cached in the secondary cache queue corresponding to the first language audio track to the module for playing the sound.
If the audio time of the first audio data cached in the secondary cache queue corresponding to the first language audio track is later than the current video playing time, the computer device issues the first audio data cached in the secondary cache queue corresponding to the first language audio track to the module for sound playing, so that the playing time of the first audio data issued to the module for sound playing is ensured to be later than the current video playing time, and the time of playing the sound and the time of playing the video by the computer device are synchronized.
In one embodiment, after the step of determining whether the audio time of the first audio data buffered in the second level buffer queue corresponding to the first language audio track is later than the time of the current video playing, the method includes:
and if the audio time of the first audio data cached in the second-level cache queue corresponding to the first language audio track is earlier than the current video playing time, deleting the audio data part which is earlier than the current video playing time in the first audio data cached in the second-level cache queue corresponding to the first language audio track.
If the audio time of the first audio data cached in the secondary cache queue corresponding to the first language audio track is earlier than the current video playing time, the computer device needs to delete the audio data part earlier than the current video playing time in the first audio data cached in the secondary cache queue corresponding to the first language audio track, so as to avoid that the playing time of the first audio data sent to the module for sound playing is earlier than the current video playing time, and further avoid the condition that the sound played by the computer device is not synchronous with the video playing time.
In one embodiment, before the step of determining whether the audio time of the first audio data buffered in the second level buffer queue corresponding to the first language audio track is later than or equal to the time of the current video playing, the method further includes:
and judging whether the second-level buffer queue corresponding to the first language audio track has the buffered first audio data.
If the cached first audio data exists in the second-level cache queue corresponding to the first language audio track, backing up the first audio data cached in the second-level cache queue corresponding to the first language audio track to the tail of the first-level cache queue corresponding to the first language audio track, so as to update the cached first audio data in the first-level cache queue corresponding to the first language audio track.
And clearing the first audio data cached in the second-level cache queue corresponding to the first language audio track, and caching the updated first audio data in the first-level cache queue corresponding to the first language audio track into the second-level cache queue corresponding to the first language audio track.
When the computer device responds to a second switching request for switching to the first language audio track, the first audio data cached in the second-level cache queue corresponding to the first language audio track needs to be processed first, so that the first audio data cached in the second-level cache queue corresponding to the first language audio track is ensured to be arranged according to the time sequence. The computer device judges whether the second-level cache queue corresponding to the first language audio track has the cached first audio data or not, if so, the first audio data cached in the second-level cache queue corresponding to the first language audio track is backed up to the tail of the first-level cache queue corresponding to the first language audio track, so as to update the cached first audio data in the first-level cache queue corresponding to the first language audio track, and therefore the first audio data cached in the first-level cache queue corresponding to the first language audio track is arranged according to the time sequence.
The computer equipment empties the first audio data cached in the second-level cache queue corresponding to the first language audio track, and caches the updated first audio data in the first-level cache queue corresponding to the first language audio track into the second-level cache queue corresponding to the first language audio track, so that the first audio data cached in the second-level cache queue corresponding to the first language audio track is sent to the module for sound playing.
In an embodiment, before the step of buffering the second audio data buffered in the primary buffer queue corresponding to the second language audio track into the secondary buffer queue corresponding to the second language audio track and sending the second audio data to the module for sound playing, the method includes:
comparing the audio time of the second audio data cached in the first-level cache queue corresponding to the second language audio track with the current video playing time;
if the audio time of the second audio data cached in the first-level cache queue corresponding to the second language audio track is earlier than the current video playing time, deleting the audio data part which is earlier than the current video playing time in the second audio data cached in the second-level cache queue corresponding to the second language audio track;
and if the audio time of the second audio data cached in the first-level cache queue corresponding to the second language audio track is later than the current video playing time, waiting for the corresponding time to enable the audio time of the second audio data cached in the first-level cache queue corresponding to the second language audio track to be synchronous with the current video playing time.
Before the computer device caches the second audio data cached in the first-level cache queue corresponding to the second language audio track into the second-level cache queue corresponding to the second language audio track and issues the second audio data to the module for sound playing, the audio time of the second audio data cached in the first-level cache queue corresponding to the second language audio track needs to be compared with the current video playing time. If the audio time of the second audio data cached in the first-level cache queue corresponding to the second language audio track is earlier than the current video playing time, it is indicated that the sound corresponding to the audio data is played when the audio time is earlier than the current video playing time, and therefore deletion is required. Therefore, the computer device needs to delete the audio data portion earlier than the current video playing time in the second audio data buffered in the second level buffer queue corresponding to the second language audio track, so that the audio time of the second audio data buffered in the first level buffer queue corresponding to the second language audio track is synchronized with the current video playing time.
If the audio time of the second audio data cached in the first-level cache queue corresponding to the second language audio track is later than the current video playing time, the computer device waits for a corresponding time to synchronize the audio time of the second audio data cached in the first-level cache queue corresponding to the second language audio track with the current video playing time, and after synchronization, releases the played audio data from the second audio data cached in the first-level cache queue corresponding to the second language audio track so as to keep the audio time of the second audio data cached in the first-level cache queue corresponding to the second language audio track and the current video playing time in a synchronized state all the time.
As shown in fig. 2, in an embodiment, a switching apparatus of a language audio track is provided, and the switching apparatus of the language audio track may be integrated in the computer device 100, and specifically may include an obtaining unit 110, a first executing unit 120, a second executing unit 130, and a third executing unit 140.
An obtaining unit 110, configured to obtain first audio data corresponding to a first language and second audio data corresponding to a second language, and cache the first audio data and the second audio data in a first-level cache queue corresponding to a first language audio track and a second language audio track in a local storage respectively;
a first executing unit 120, configured to, in response to a play request for playing through the first language audio track, cache the first audio data in the primary cache queue corresponding to the first language audio track into a secondary cache queue corresponding to the first language audio track, and send the first audio data to a module for performing sound playing;
a second executing unit 130, configured to, in response to a first switching request for switching to the second language audio track, clear first audio data cached in the module for performing sound playing, cache the second audio data cached in the primary cache queue corresponding to the second language audio track in a secondary cache queue corresponding to the second language audio track, and send the second audio data to the module for performing sound playing;
a third executing unit 140, configured to respond to a second switching request for switching to the first language audio track, clear second audio data cached in the module for performing sound playing, and send the first audio data cached in the second level cache queue corresponding to the first language audio track to the module for performing sound playing.
Optionally, the apparatus for switching language tracks further includes:
the first judgment unit is used for judging whether the audio time of the first audio data cached in the secondary cache queue corresponding to the first language audio track is later than the current video playing time;
the third execution unit includes:
and the execution subunit is configured to, if the audio time of the first audio data cached in the secondary cache queue corresponding to the first language audio track is later than the current video playing time, issue the first audio data cached in the secondary cache queue corresponding to the first language audio track to the module for performing sound playing.
Optionally, the apparatus for switching language tracks further includes:
a fourth execution unit, configured to delete, if the audio time of the first audio data cached in the second level cache queue corresponding to the first language audio track is earlier than the current video playing time, an audio data portion that is earlier than the current video playing time in the first audio data cached in the second level cache queue corresponding to the first language audio track.
Optionally, the apparatus for switching language tracks further includes:
the second judgment unit is used for judging whether the first audio data cached exists in the second-level cache queue corresponding to the first language audio track;
the updating unit is configured to, if the cached first audio data exists in the secondary cache queue corresponding to the first language audio track, back up the first audio data cached in the secondary cache queue corresponding to the first language audio track to the end of the primary cache queue corresponding to the first language audio track, so as to update the cached first audio data in the primary cache queue corresponding to the first language audio track;
and the fifth execution unit is used for emptying the first audio data cached in the second-level cache queue corresponding to the first language audio track and caching the updated first audio data in the first-level cache queue corresponding to the first language audio track into the second-level cache queue corresponding to the first language audio track.
Optionally, the apparatus for switching language tracks further includes:
the comparison unit is used for comparing the audio time of the second audio data cached in the first-level cache queue corresponding to the second language audio track with the current video playing time;
a deleting unit, configured to delete, if the audio time of the second audio data cached in the first-level cache queue corresponding to the second language audio track is earlier than the current video playing time, an audio data portion that is earlier than the current video playing time in the second audio data cached in the second-level cache queue corresponding to the second language audio track;
and the synchronization unit is used for waiting for corresponding time to enable the audio time of the second audio data cached in the first-level cache queue corresponding to the second language audio track to be synchronized with the current video playing time if the audio time of the second audio data cached in the first-level cache queue corresponding to the second language audio track is later than the current video playing time.
The implementation process of the functions and actions of each module in the apparatus is specifically detailed in the implementation process of the corresponding step in the switching method of the language audio track, and is not described herein again.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Moreover, although the steps of the methods of the present disclosure are depicted in the drawings in a particular order, this does not require or imply that the steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Thus, various aspects of the invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
Referring to fig. 3, fig. 3 is a computer apparatus 300 according to this embodiment of the present invention. The electronic device 300 shown in fig. 3 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 3, electronic device 300 is embodied in the form of a general purpose computing device. The components of electronic device 300 may include, but are not limited to: the at least one processing unit 310, the at least one memory unit 320, and a bus 330 that couples various system components including the memory unit 320 and the processing unit 310.
Wherein the storage unit stores program code that is executable by the processing unit 310 to cause the processing unit 310 to perform steps according to various exemplary embodiments of the present invention as described in the above section "exemplary methods" of the present specification. For example, the processing unit 310 may perform step S110 as shown in fig. 1: acquiring first audio data corresponding to a first language and second audio data corresponding to a second language, and respectively caching the first audio data and the second audio data into first-level cache queues corresponding to a first language audio track and a second language audio track in local storage; step S120: in response to a playing request for playing through the first language audio track, caching the first audio data in the primary cache queue corresponding to the first language audio track into a secondary cache queue corresponding to the first language audio track, and sending the first audio data to a module for playing sound; step S130: in response to a first switching request for switching to the second language audio track, clearing first audio data cached in the module for performing sound playing, caching the second audio data cached in a first-level cache queue corresponding to the second language audio track into a second-level cache queue corresponding to the second language audio track, and issuing the second audio data to the module for performing sound playing; step S140: and in response to a second switching request for switching to the first language audio track, clearing second audio data cached in the module for performing sound playing, and sending the first audio data cached in a secondary cache queue corresponding to the first language audio track to the module for performing sound playing.
The storage unit 320 may include readable media in the form of volatile storage units, such as a random access memory unit (RAM)3201 and/or a cache memory unit 3202, and may further include a read only memory unit (ROM) 3203.
The storage unit 320 may also include a program/utility 3204 having a set (at least one) of program modules 3205, such program modules 3205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 330 may be one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 300 may also communicate with one or more external devices 500 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 300, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 300 to communicate with one or more other computing devices. Such communication may occur via an input/output (I/O) interface 330. Also, the electronic device 300 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 360. As shown, network adapter 360 communicates with the other modules of electronic device 300 via bus 330. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with electronic device 300, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, aspects of the invention may also be implemented in the form of a program product comprising program code means for causing a terminal device to carry out the steps according to various exemplary embodiments of the invention described in the above section "exemplary methods" of the present description, when said program product is run on the terminal device.
Referring to fig. 4, a program product 400 for implementing the above method according to an embodiment of the present invention is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a computer device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
Furthermore, the above-described figures are merely schematic illustrations of processes involved in methods according to exemplary embodiments of the invention, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
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 application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the 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.

Claims (10)

1. A method for switching a language soundtrack, the method comprising:
acquiring first audio data corresponding to a first language and second audio data corresponding to a second language, and respectively caching the first audio data and the second audio data into first-level cache queues corresponding to a first language audio track and a second language audio track in local storage;
in response to a playing request for playing through the first language audio track, caching the first audio data in the primary cache queue corresponding to the first language audio track into a secondary cache queue corresponding to the first language audio track, and sending the first audio data to a module for playing sound;
in response to a first switching request for switching to the second language audio track, clearing first audio data cached in the module for performing sound playing, caching the second audio data cached in a first-level cache queue corresponding to the second language audio track into a second-level cache queue corresponding to the second language audio track, and issuing the second audio data to the module for performing sound playing;
and in response to a second switching request for switching to the first language audio track, clearing second audio data cached in the module for performing sound playing, and sending the first audio data cached in a secondary cache queue corresponding to the first language audio track to the module for performing sound playing.
2. The method of claim 1, wherein before the step of sending the first audio data buffered in the second level buffer queue corresponding to the first language audio track to the module for audio playback, the method comprises:
judging whether the audio time of the first audio data cached in the second-level cache queue corresponding to the first language audio track is later than the current video playing time;
the step of sending the first audio data cached in the second level cache queue corresponding to the first language audio track to the module for playing sound includes:
and if the audio time of the first audio data cached in the secondary cache queue corresponding to the first language audio track is later than the current video playing time, sending the first audio data cached in the secondary cache queue corresponding to the first language audio track to the module for playing the sound.
3. The method of claim 2, wherein said step of determining whether the audio time of the first audio data buffered in the second level buffer queue corresponding to the first language audio track is later than the current video playing time comprises:
and if the audio time of the first audio data cached in the second-level cache queue corresponding to the first language audio track is earlier than the current video playing time, deleting the audio data part which is earlier than the current video playing time in the first audio data cached in the second-level cache queue corresponding to the first language audio track.
4. The method of claim 2, wherein before the step of determining whether the audio time of the first audio data buffered in the second level buffer queue corresponding to the first language audio track is later than the current video playing time, the method further comprises:
judging whether the second-level cache queue corresponding to the first language audio track has cached first audio data or not;
if the cached first audio data exists in the second-level cache queue corresponding to the first language audio track, backing up the first audio data cached in the second-level cache queue corresponding to the first language audio track to the tail of the first-level cache queue corresponding to the first language audio track so as to update the cached first audio data in the first-level cache queue corresponding to the first language audio track;
and clearing the first audio data cached in the second-level cache queue corresponding to the first language audio track, and caching the updated first audio data in the first-level cache queue corresponding to the first language audio track into the second-level cache queue corresponding to the first language audio track.
5. The method according to claim 1, wherein before the step of buffering the second audio data buffered in the first-level buffer queue corresponding to the second language audio track into the second-level buffer queue corresponding to the second language audio track and sending the second audio data to the module for audio playback, the method comprises:
comparing the audio time of the second audio data cached in the first-level cache queue corresponding to the second language audio track with the current video playing time;
if the audio time of the second audio data cached in the first-level cache queue corresponding to the second language audio track is earlier than the current video playing time, deleting the audio data part which is earlier than the current video playing time in the second audio data cached in the second-level cache queue corresponding to the second language audio track;
and if the audio time of the second audio data cached in the first-level cache queue corresponding to the second language audio track is later than the current video playing time, waiting for the corresponding time to enable the audio time of the second audio data cached in the first-level cache queue corresponding to the second language audio track to be synchronous with the current video playing time.
6. An apparatus for switching speech tracks, said apparatus comprising:
the acquisition unit is used for acquiring first audio data corresponding to a first language and second audio data corresponding to a second language, and respectively caching the first audio data and the second audio data into a first-level cache queue corresponding to a first language audio track and a second language audio track in local storage;
the first execution unit is used for responding to a playing request played through the first language audio track, caching the first audio data in the primary cache queue corresponding to the first language audio track into a secondary cache queue corresponding to the first language audio track, and sending the first audio data to a module for playing sound;
the second execution unit is used for responding to a first switching request for switching to the second language audio track, clearing first audio data cached in the module for sound playing, caching the second audio data cached in the first-level cache queue corresponding to the second language audio track into a second-level cache queue corresponding to the second language audio track, and sending the second audio data to the module for sound playing;
and the third execution unit is used for responding to a second switching request for switching to the first language audio track, clearing second audio data cached in the module for sound playing, and sending the first audio data cached in a secondary cache queue corresponding to the first language audio track to the module for sound playing.
7. The apparatus of claim 6, further comprising:
the first judgment unit is used for judging whether the audio time of the first audio data cached in the secondary cache queue corresponding to the first language audio track is later than the current video playing time;
the third execution unit includes:
and the execution subunit is configured to, if the audio time of the first audio data cached in the secondary cache queue corresponding to the first language audio track is later than the current video playing time, issue the first audio data cached in the secondary cache queue corresponding to the first language audio track to the module for performing sound playing.
8. The apparatus of claim 6, further comprising:
a fourth execution unit, configured to delete, if the audio time of the first audio data cached in the second level cache queue corresponding to the first language audio track is earlier than the current video playing time, an audio data portion that is earlier than the current video playing time in the first audio data cached in the second level cache queue corresponding to the first language audio track.
9. A computer device comprising a memory and a processor, the memory having stored therein computer-readable instructions that, when executed by the processor, cause the processor to perform the method of any of claims 1 to 5.
10. A storage medium storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the method of any one of claims 1-5.
CN201811549608.4A 2018-12-18 2018-12-18 Language audio track switching method and device, computer equipment and storage medium Active CN109599133B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811549608.4A CN109599133B (en) 2018-12-18 2018-12-18 Language audio track switching method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811549608.4A CN109599133B (en) 2018-12-18 2018-12-18 Language audio track switching method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109599133A CN109599133A (en) 2019-04-09
CN109599133B true CN109599133B (en) 2020-11-24

Family

ID=65963019

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811549608.4A Active CN109599133B (en) 2018-12-18 2018-12-18 Language audio track switching method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109599133B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111338986B (en) * 2020-03-13 2023-08-04 北京艾克斯特科技有限公司 Method for acquiring data in three-dimensional model data structure
CN111601158B (en) * 2020-05-14 2021-11-02 青岛海信传媒网络技术有限公司 Method for optimizing audio track cutting of streaming media pipeline and display equipment
CN113596545A (en) * 2021-07-21 2021-11-02 中央广播电视总台 Audio track switching method and device, media playing device and computer storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103780943B (en) * 2014-01-24 2017-04-12 华为技术有限公司 Audio channel switching method, device and system
CN104967901B (en) * 2015-06-29 2018-05-04 腾讯科技(北京)有限公司 Track switching method and apparatus for media playing in media play
CN106604124A (en) * 2015-10-19 2017-04-26 深圳市中兴微电子技术有限公司 Audio data playing method and device
CN108810575B (en) * 2017-05-04 2021-10-29 杭州海康威视数字技术股份有限公司 Method and device for sending target video
CN107426600B (en) * 2017-06-30 2019-11-08 北京威动科技有限公司 Switch the playback method and device of track and subtitle rail
CN108040277B (en) * 2017-12-04 2020-08-25 海信视像科技股份有限公司 Subtitle switching method and device for multi-language subtitles obtained after decoding

Also Published As

Publication number Publication date
CN109599133A (en) 2019-04-09

Similar Documents

Publication Publication Date Title
JP6751433B2 (en) Processing method, device and storage medium for waking up application program
CN109599133B (en) Language audio track switching method and device, computer equipment and storage medium
CN110113407B (en) Applet state synchronization method, apparatus and computer storage medium
US20190066671A1 (en) Far-field speech awaking method, device and terminal device
CN108965907B (en) Method, device and system for playing video
KR20080021691A (en) Gpu timeline with render-ahead queue
EP3866481A1 (en) Audio/video switching method and apparatus, and computer device and readable storage medium
EP3151577B1 (en) Information processing apparatus, information processing method, and program
CN105393544A (en) Dynamic track switching in media streaming
CN111177453A (en) Method, device and equipment for controlling audio playing and computer readable storage medium
CN110136713A (en) Dialogue method and system of the user in multi-modal interaction
CN104601535A (en) Video processing method and system
CN108182930B (en) Sound effect processing method and equipment and audio and video on demand system
CN109672745A (en) The online control method for playing back of audio and device for FreeRTOS
WO2023072028A1 (en) Music caching method and apparatus, and electronic device and storage medium
CN113301424A (en) Play control method, device, storage medium and program product
WO2018153020A1 (en) Audio data processing method and apparatus, audio output device and storage medium
CN110769316B (en) Method, device, equipment and storage medium for calculating first frame time
US20150312369A1 (en) Checkpoints for media buffering
US20200105249A1 (en) Custom temporal blacklisting of commands from a listening device
CN110855645B (en) Streaming media data playing method and device
CN113778370A (en) Voice message playing method and device, electronic equipment and storage medium
CN111467797A (en) Game data processing method and device, computer storage medium and electronic equipment
KR20100029010A (en) Multiprocessor systems for processing multimedia data and methods thereof
CN111680522B (en) Method and system for realizing translation control based on electronic terminal and electronic equipment

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
CB02 Change of applicant information

Address after: 266000, No. 218, Bay Road, Qingdao economic and Technological Development Zone, Shandong

Applicant after: Hisense Video Technology Co., Ltd

Address before: 266555 Qingdao economic and Technological Development Zone, Shandong, Hong Kong Road, No. 218

Applicant before: HISENSE ELECTRIC Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant