CN116088787B - Audio stream processing method and related device - Google Patents

Audio stream processing method and related device Download PDF

Info

Publication number
CN116088787B
CN116088787B CN202211035410.0A CN202211035410A CN116088787B CN 116088787 B CN116088787 B CN 116088787B CN 202211035410 A CN202211035410 A CN 202211035410A CN 116088787 B CN116088787 B CN 116088787B
Authority
CN
China
Prior art keywords
terminal
stream
audio
wireless earphone
audio stream
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
CN202211035410.0A
Other languages
Chinese (zh)
Other versions
CN116088787A (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.)
Honor Device Co Ltd
Original Assignee
Honor Device 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 Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202211035410.0A priority Critical patent/CN116088787B/en
Publication of CN116088787A publication Critical patent/CN116088787A/en
Application granted granted Critical
Publication of CN116088787B publication Critical patent/CN116088787B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/16Sound input; Sound output
    • G06F3/165Management of the audio stream, e.g. setting of volume, audio stream path

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (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)
  • Circuit For Audible Band Transducer (AREA)

Abstract

The application provides an audio stream processing method and a related device, and relates to the technical field of terminals. The method comprises the following steps: the first terminal plays at least one audio stream through a wireless earphone; when the number of audio streams played by the first terminal through the wireless earphone changes, the first terminal determines a first stream type, wherein the first stream type is the stream type with the highest priority in the audio streams played by the first terminal through the wireless earphone; the first terminal transmits first indication information to the second terminal, wherein the first indication information is used for indicating the first flow type. Therefore, under the scene that two terminals are connected with the same wireless earphone, the wireless earphone can always play the audio streams with higher priority on the two terminals, and the experience of a user is improved.

Description

Audio stream processing method and related device
Technical Field
The present application relates to the field of terminal technologies, and in particular, to an audio stream processing method and a related device.
Background
Users often use wireless headphones to play audio streams from terminals, such as conversations, music, alarm clocks, etc. In the case where a wireless headset connects two terminals at the same time, there are cases where terminal a and terminal B need to play audio streams on their respective devices simultaneously through the wireless headset, but for the wireless headset, only one of the terminals can play audio streams at a time. Therefore, when both terminals need to play their own audio streams through wireless headphones, how to determine which terminal on which audio stream can be played through the wireless headphones becomes an important point of research in the art.
Currently, two terminals can preempt the wireless earphone by comparing the priorities of the stream types of the audio streams at two ends, and the audio stream with high priority can use the wireless earphone preferentially. However, in some cases, the terminal may play multiple types of audio streams through the wireless earphone, and because different types of audio streams may correspond to different priorities, misjudgment may be caused by the terminal, the wireless earphone may be occupied by the audio stream with low priority, while the audio stream with high priority is not preempted to the wireless earphone, which may cause interruption of the audio stream with high priority, and affect the use of the user, so that the user experience is poor.
Disclosure of Invention
The application provides an audio stream processing method and a related device, which can always play audio streams with higher priority on two terminals by a wireless earphone when a plurality of types of audio streams exist on the terminals, thereby improving the experience of users.
In a first aspect, a method of audio stream processing is provided. The method is applied to the first terminal, and the first terminal and the second terminal are connected with the wireless earphone. For example, the method may be performed by the first terminal, or may be performed by a component (such as a chip, a chip system, etc.) configured in the first terminal, or may be implemented by a logic module or software capable of implementing all or part of the functions of the first terminal, which is not limited in this aspect of the application.
The method comprises the following steps: playing at least one audio stream through the wireless headset; when the number of audio streams played by the first terminal through the wireless earphone changes, determining a first stream type, wherein the first stream type is the stream type with the highest priority in the audio streams played by the first terminal through the wireless earphone; and sending first indication information to the second terminal, wherein the first indication information is used for indicating the first flow type.
Based on the above, in a scenario that two terminals are simultaneously connected with the same wireless earphone, when the audio stream on the first terminal is played through the wireless earphone, the number of the audio streams played by the first terminal through the wireless earphone is changed each time, the stream type with the highest priority in at least one audio stream played by the wireless earphone is redetermined and sent to the second terminal, so that when the audio stream is generated on the second terminal, judgment can be made based on the stream type corresponding to the highest priority in the audio stream currently played by the wireless earphone, and whether the wireless earphone can be preempted or not can be seen. Therefore, the wireless earphone can be always preempted by the terminal from which the audio stream with the highest priority is from among all audio streams to be played, and the audio stream with the highest priority can be always played through the wireless earphone, so that the possibility that the audio stream with the high priority is interrupted is reduced, and the experience of a user can be improved.
With reference to the first aspect, in certain implementation manners of the first aspect, the first terminal is configured with a plurality of count values sequentially arranged in order from high to low according to priorities of stream types, each count value corresponds to one or more stream types with the same priority, each count value takes a preset value as an initial value, and counts up based on audio stream playing of the corresponding stream type; the determining the first stream type includes: and determining the first stream type according to the stream type corresponding to the count value, of which the first value is not the preset value, in the plurality of count values.
The terminal can rapidly determine the stream type with the highest priority based on the configuration of the priority of the stream type, and the processing efficiency of the terminal is effectively improved.
With reference to the first aspect, in certain implementation manners of the first aspect, the changing the number of audio streams played by the first terminal through the wireless earphone includes: the number of audio streams played by the first terminal through the wireless earphone increases or decreases.
With reference to the first aspect, in certain implementation manners of the first aspect, before the playing of the at least one audio stream by the wireless headset, the method further includes: receiving second indication information from the second terminal, wherein the second indication information is used for indicating a second stream type, and the second stream type is the stream type with the highest priority in the audio streams from the second terminal which are being played by the wireless earphone; based on the second indication information, it is determined that the priority of the first stream type is not lower than the priority of the second stream type.
The second terminal sends the stream type with the highest priority in the audio stream played through the wireless earphone to the first terminal, so that the first terminal can judge based on the stream type with the highest priority to see whether to preempt the earphone. Therefore, the wireless earphone can be always preempted by the terminal from which the audio stream with the highest priority is from among all audio streams to be played, and the audio stream with the highest priority can be always played through the wireless earphone, so that the possibility that the audio stream with the high priority is interrupted is reduced, and the experience of a user can be improved.
With reference to the first aspect, in certain implementation manners of the first aspect, the method further includes: and sending a first notification message to the second terminal, wherein the first notification message is used for notifying that the wireless earphone is occupied by the first terminal.
After the terminal occupies the wireless earphone, the terminal receiving the notification message can pause or mute the audio stream of the terminal by sending the first notification message.
With reference to the first aspect, in certain implementation manners of the first aspect, the method further includes: receiving third indication information from the second terminal, wherein the third indication information is used for indicating a third stream type, the priority of the third stream type is not lower than that of the first stream type, and the third stream type is the stream type with the highest priority in at least one stream type played by the second terminal through the wireless earphone; receiving a second notification message from the second terminal, wherein the second notification message is used for notifying that the wireless earphone is occupied by the second terminal; stopping playing the at least one audio stream through the wireless headset based on the second notification message; and said playing at least one audio stream through said wireless headset, comprising: and transmitting the at least one audio stream to the wireless earphone to play the at least one audio stream through the wireless earphone.
Wherein stopping playing the at least one audio stream through the wireless headset is understood to mean pausing the playing of the at least one audio stream or muting the playing of the at least one audio stream.
In a second aspect, there is provided another processing method applied to a system including a first terminal, a second terminal and a wireless headset, the method comprising: the first terminal plays at least one audio stream through the wireless earphone; when the number of the audio streams played by the first terminal through the wireless earphone changes, determining a first stream type, wherein the first stream type is the stream type with the highest priority in the audio streams played by the first terminal through the wireless earphone; the first terminal sends first indication information to the second terminal, wherein the first indication information is used for indicating the first flow type.
Based on the above, in a scenario that two terminals are simultaneously connected with the same wireless earphone, when the audio stream on the first terminal is played through the wireless earphone, the number of the audio streams played by the first terminal through the wireless earphone is changed each time, the stream type with the highest priority in at least one audio stream played by the wireless earphone is redetermined and sent to the second terminal, so that when the audio stream is generated on the second terminal, judgment can be made based on the stream type corresponding to the highest priority in the audio stream currently played by the wireless earphone, and whether the wireless earphone can be preempted or not can be seen. Therefore, the wireless earphone can be always preempted by the terminal from which the audio stream with the highest priority is from among all audio streams to be played, and the audio stream with the highest priority can be always played through the wireless earphone, so that the possibility that the audio stream with the high priority is interrupted is reduced, and the experience of a user can be improved.
With reference to the second aspect, in some implementations of the second aspect, the changing the number of audio streams played by the first terminal through the wireless earphone includes: the number of audio streams played by the first terminal through the wireless earphone increases or decreases.
With reference to the second aspect, in certain implementations of the second aspect, before the first terminal plays at least one audio stream through a wireless headset, the method further includes: the second terminal sends at least one audio stream to the wireless earphone; the second terminal determines a second stream type based on the at least one audio stream, wherein the second stream type is the stream type with the highest priority in the audio streams played by the second terminal through the wireless earphone; the second terminal sends second indication information to the first terminal, wherein the second indication information is used for indicating the second stream type; the first terminal determines that the priority of the first stream type is not lower than the priority of the second stream type based on the second indication information; and the first terminal playing the at least one audio stream through the wireless earphone, comprising: the first terminal sends the at least one audio stream to the wireless headset to play the at least one audio stream through the wireless headset.
With reference to the second aspect, in certain implementations of the second aspect, the method further includes: the second terminal receives a first notification message from a first terminal, wherein the notification message is used for notifying that the wireless earphone is occupied by the first terminal; and the second terminal stops playing the audio stream through the wireless earphone based on the first notification message.
With reference to the second aspect, in certain implementations of the second aspect, the method further includes: when the number of the audio streams played by the second terminal through the wireless earphone changes, determining a third stream type, wherein the third stream type is the stream type with the highest priority in the audio streams played by the second terminal through the wireless earphone; the second terminal sends third indication information to the first terminal, wherein the third indication information is used for indicating the third stream type; the second terminal sends a second notification message to the first terminal, wherein the second notification message is used for notifying that the wireless earphone is occupied by the second terminal; and the first terminal stops playing the audio stream through the wireless earphone based on the second notification message.
With reference to the second aspect, in certain implementation manners of the second aspect, each of the first terminal and the second terminal is configured with a plurality of count values sequentially arranged in order from high to low in priority of a stream type, each count value corresponds to one or more stream types having the same priority, each count value takes a preset value as an initial value, and counts up based on stream play of the corresponding stream type; and the stream type corresponding to the first calculated value which is not the preset value in the plurality of counted values in each terminal is the stream type with the highest priority in the audio stream played by each terminal through the wireless earphone.
In a third aspect, there is provided a terminal device comprising: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to cause the terminal device to perform the method in any one of the possible implementations of the first aspect described above.
In a fourth aspect, there is provided an audio stream processing system comprising: the wireless earphone comprises a first terminal, a second terminal and a wireless earphone, wherein the first terminal and the second terminal are both in communication connection with the wireless earphone; the wireless earphone is used for playing at least one audio stream from the first terminal; the first terminal is used for determining a first stream type when the number of audio streams played through the wireless earphone changes, wherein the first stream type is the stream type with the highest priority in the audio streams played through the wireless earphone by the first terminal; and sending first indication information to the second terminal, wherein the first indication information is used for indicating the first flow type.
In a fifth aspect, there is provided a processor comprising: input circuit, output circuit and processing circuit. The processing circuit is configured to receive the stream via the input circuit and to send the stream via the output circuit, such that the processor performs the method in any one of the possible implementations of the first aspect.
In a specific implementation process, the processor may be a chip, the input circuit may be an input pin, the output circuit may be an output pin, and the processing circuit may be a transistor, a gate circuit, a trigger, various logic circuits, and the like. The input stream received by the input circuit may be received and input by, for example and without limitation, a receiver, the output stream output by the output circuit may be output to and transmitted by, for example and without limitation, a transmitter, and the input circuit and the output circuit may be the same circuit that functions as the input circuit and the output circuit, respectively, at different times. The application is not limited to the specific implementation of the processor and various circuits.
In a sixth aspect, a processing device is provided that includes a processor and a memory. The processor is configured to read instructions stored in the memory and to receive the stream via the receiver and to transmit the stream via the transmitter to perform the method of any one of the possible implementations of the first aspect.
Optionally, the processor is one or more and the memory is one or more.
Alternatively, the memory may be integrated with the processor or the memory may be separate from the processor.
In a specific implementation process, the memory may be a non-transient (non-transitory) memory, for example, a Read Only Memory (ROM), which may be integrated on the same chip as the processor, or may be separately disposed on different chips.
The processing means in the sixth aspect may be a chip, and the processor may be implemented by hardware or software, and when implemented by hardware, the processor may be a logic circuit, an integrated circuit, or the like; when implemented in software, the processor may be a general-purpose processor, implemented by reading software code stored in a memory, which may be integrated in the processor, or may reside outside the processor, and exist separately.
In a seventh aspect, a computer readable storage medium is provided, which stores a computer program (which may also be referred to as code, or instructions) which, when run on a computer, causes the computer to perform the method of any one of the possible implementations of the first aspect.
In an eighth aspect, there is provided a computer program product comprising: a computer program (which may also be referred to as code, or instructions) which, when executed, causes a computer to perform the method of any one of the possible implementations of the first aspect.
In a ninth aspect, there is provided a chip comprising a processor for invoking a computer program in memory to perform the method according to the first aspect.
It should be understood that the second to eighth aspects of the present application correspond to the technical solutions of the first aspect of the present application, and the advantages obtained by each aspect and the corresponding possible embodiments are similar, and are not repeated.
Drawings
FIG. 1 is a schematic diagram of a communication scenario provided by an embodiment of the present application;
fig. 2 is a schematic structural diagram of a terminal according to an embodiment of the present application;
FIG. 3 is a schematic flow chart of a method of processing an audio stream;
FIG. 4 is a schematic flow chart of another method of processing an audio stream;
FIG. 5 is a schematic flow chart of a method for processing an audio stream according to an embodiment of the present application;
FIG. 6 is a schematic flow chart of another audio stream processing method provided by an embodiment of the present application;
Fig. 7 is a schematic flow chart of a processing method of still another audio stream according to an embodiment of the present application.
Detailed Description
For purposes of clarity in describing the embodiments of the present application, the words "exemplary" or "such as" are used herein to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "for example" should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion.
In the embodiments of the present application, "at least one" means one or more, and "a plurality" means two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a alone, a and B together, and B alone, wherein a, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b, or c may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c may be single or plural.
The technical scheme of the application will be described below with reference to the accompanying drawings.
Fig. 1 is a schematic diagram of a communication scenario provided in an embodiment of the present application. As shown in fig. 1, the scenario includes a terminal 11, a terminal 12, and a wireless headset 13. In fig. 1, the terminal 11 and the terminal 12 are taken as an example of mobile phones, and the wireless headset 13 is connected to the terminal 11 and the terminal 12 through a wireless communication protocol, so as to perform data transmission.
Illustratively, the wireless headset 13 may include a headset 01 and a headset 02, and the headset 01 and the headset 02 may also communicate wirelessly. For example, the headset 01 serves as a master headset, the headset 02 serves as a slave headset, the headset 01 and the terminal 11 and the terminal 12 establish a bluetooth link (referred to as a mobile link) through a bluetooth communication protocol, the headset 01 and the headset 02 establish a bluetooth link (referred to as a bluetooth true wireless stereo (true wireless stereo, TWS) link) through a bluetooth communication protocol, meanwhile, the headset 02 listens to signals sent by the terminal by copying the mobile link between the headset 01 and the terminal, the copied link is referred to as a listening link, the listening link is not received, and no confirmation mechanism exists between the listening link and the terminal. The earphone 01 directly connected to the terminal in communication may be referred to as a master earphone, and the earphone 02 indirectly connected to the terminal through the master earphone may be referred to as a slave earphone.
In one embodiment, the terminal 11 and the wireless earphone 13, and the terminal 12 and the wireless earphone 13 may be interconnected through a communication network to implement interaction of wireless signals. The communication network may be, but is not limited to: wireless fidelity (wireless fidelity, wi-Fi) hotspot networks, wi-Fi point-to-point (P2P) networks, bluetooth networks, zigbee (zigbee) networks, or near field communication (near field communication, NFC) networks.
Fig. 2 is a schematic structural diagram of a terminal according to an embodiment of the present application. As shown in fig. 2, the terminal may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display 194, a subscriber identity module (subscriber identification module, SIM) card interface 195, and the like. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It should be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the terminal. In other embodiments of the application, the terminal may include more or less components than illustrated, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
It should also be understood that the terminal shown in fig. 2 may be the terminal 11 or the terminal 12 shown in fig. 1 described above.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (ubscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
It should be understood that the connection relationship between the modules illustrated in the embodiment of the present application is only illustrative, and does not limit the structure of the terminal. In other embodiments of the present application, the terminal may also use different interfacing manners in the foregoing embodiments, or a combination of multiple interfacing manners.
The terminal may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an application processor, and the like. Such as music playing, recording, etc. For example, the audio signal in the present application may be played through speaker 170A.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The speaker 170A, also referred to as a "horn," is used to convert audio electrical signals into sound signals. The terminal can listen to music through the speaker 170A or to hands-free conversations. A receiver 170B, also referred to as a "earpiece", is used to convert the audio electrical signal into a sound signal. When the terminal picks up a call or voice message, the voice can be picked up by placing the receiver 170B close to the human ear. Microphone 170C, also referred to as a "microphone" or "microphone", is used to convert sound signals into electrical signals.
The terminal implements display functions through the GPU, the display screen 194, and the application processor, etc. The GPU is a microprocessor for image processing, and is connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
The display screen 194 is used to display images, videos, and the like. The display 194 includes a display panel. The display panel may employ a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (OLED), an active-matrix or active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (flex), a mini, micro led, micro-OLED, quantum dot light-emitting diode (quantum dot lightemitting diodes, QLED), a low-temperature polycrystalline oxide (low temperature polycrystalline oxide, LTPO), or the like. In some embodiments, the terminal may include 1 or N displays 194, N being a positive integer greater than 1.
The terminal may implement photographing functions through an ISP, a camera 193, a video codec, a GPU, a display 194, an application processor, and the like.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to realize the memory capability of the extension terminal. The external memory card communicates with the processor 110 through an external memory interface 120 to implement data storage functions. For example, files such as music, video, etc. are stored in an external memory card.
The internal memory 121 may be used to store computer-executable program code that includes instructions. The internal memory 121 may include a storage program area and a storage data area. The storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data (e.g., audio data, phonebook, etc.) created during use of the terminal, etc. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like. The processor 110 performs various functional applications of the terminal and data processing by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
The terminal according to the embodiment of the present application may be a handheld device, an in-vehicle device, or the like having a wireless connection function, and may also be referred to as a terminal device, a User Equipment (UE), a Mobile Station (MS), a Mobile Terminal (MT), or the like. Currently, examples of some terminal devices are: mobile phone (mobile phone), tablet, smart tv, notebook, tablet (Pad), palm, mobile internet device (mobile internet device, MID), virtual Reality (VR) device, augmented reality (augmented reality, AR) device, wireless terminal in industrial control (industrial control), wireless terminal in unmanned driving (self driving), wireless terminal in teleoperation (remote medical surgery), wireless terminal in smart grid (smart grid), wireless terminal in transportation security (transportation safety), wireless terminal in smart city (smart home), wireless terminal in smart home (smart home), cellular phone, cordless phone, session initiation protocol (session initiation protocol, SIP) phone, wireless local loop (wireless local loop, WLL) station, personal digital assistant (personal digital assistant, PDA), handheld device with wireless communication function, computing device or other processing device connected to wireless modem, vehicle device, wearable device, terminal device in 5G network or terminal in future evolution (37) are not specific examples of the application and public communication system.
By way of example, and not limitation, in embodiments of the application, the terminal may also be a wearable device. The wearable device can also be called as a wearable intelligent device, and is a generic name for intelligently designing daily wear by applying wearable technology and developing wearable devices, such as glasses, gloves, watches, clothes, shoes and the like. The wearable device is a portable device that is worn directly on the body or integrated into the clothing or accessories of the user. The wearable device is not only a hardware device, but also can realize a powerful function through software support, data interaction and cloud interaction. The generalized wearable intelligent device includes full functionality, large size, and may not rely on the smart phone to implement complete or partial functionality, such as: smart watches or smart glasses, etc., and focus on only certain types of application functions, and need to be used in combination with other devices, such as smart phones, for example, various smart bracelets, smart jewelry, etc. for physical sign monitoring.
It should be understood that in the embodiment of the present application, the terminal may be a device for implementing a function of the terminal, or may be a device capable of supporting the terminal to implement the function, for example, a chip system, and the device may be installed in the terminal. In the embodiment of the application, the chip system can be composed of chips, and can also comprise chips and other discrete devices.
It should also be understood that, the terminal in the embodiment of the present application is a terminal supporting connection to a wireless headset, where the wireless headset in the embodiment of the present application has a function of simultaneously connecting two terminals, and priorities of stream types of audio streams in two terminal devices connected to the wireless headset in the embodiment of the present application are the same.
Currently, users often play audio streams on terminals using wireless headphones. In an exemplary scenario where one wireless headset connects two terminals at the same time, both terminals a and B may play their own audio streams through the wireless headset, but for the wireless headset only the audio stream from one terminal may be played at the same time. Thus, when both terminals want to play their own audio streams over the wireless headphones, how to determine which terminal the audio on is played over the wireless headphones.
In some embodiments, the terminal may determine which terminal the wireless headset plays the audio stream on by comparing the stream type of the audio stream at the opposite terminal with the priority of the stream type of the audio stream at the home terminal. For example, a wireless headset plays a higher priority audio stream; for the audio streams with the same priority, the wireless earphone plays the back audio stream preferentially, and when the back audio stream is finished or switched to the local terminal for playing, the wireless earphone plays the front audio stream.
Fig. 3 is a schematic flow chart of a method 300 of processing an audio stream. The method 300 may be applied to the scenario shown in fig. 1, and the method 300 is a process after terminal a and terminal B establish a communication connection with a wireless headset.
As shown in fig. 3, the method 300 may include S301 to S307. The steps in fig. 3 are described in detail below.
S301, terminal a generates a first audio stream.
When the wireless earphone is in an idle state, the terminal A plays the first audio stream through the wireless earphone and executes the following steps:
it should be understood that the wireless earphone is in an idle state, i.e. the wireless earphone does not play any audio stream, i.e. neither terminal a nor terminal B occupies the wireless earphone, and if any terminal connected to the wireless earphone generates an audio stream at this time, the audio stream is played through the wireless earphone.
Illustratively, whether the wireless headset is in an idle state may be determined based on whether the type of audio stream is received on terminal a from terminal B. That is, when the stream type of the audio stream of the opposite end is received, the wireless earphone is occupied; and if the stream type of the audio stream of the opposite terminal is not received, the wireless earphone is in an idle state.
S302, terminal a sends the stream type of the first audio stream to terminal B.
S303, terminal B receives and records the stream type of the first audio stream.
S304, the terminal B generates a second audio stream.
S305, the terminal B determines whether the priority of the stream type of the second audio stream is lower than the priority of the stream type of the first audio stream.
The description will be made below in connection with two cases where the priority of the stream type of the second audio stream is not lower than the priority of the stream type of the first audio stream (case one) and the priority of the stream type of the second audio stream is lower than the priority of the stream type of the first audio stream (case two).
In case one, when the priority of the stream type of the second audio stream is not lower than the priority of the stream type of the first audio stream, the second audio stream is played by the wireless earphone, and S306 and S307 are executed:
it should be understood that when the wireless earphone plays the second audio stream, the first audio stream is not played any more, i.e. the wireless earphone can only play the audio stream on the same terminal at the same time.
And S306, the terminal B sends the stream type of the second audio stream and the notification message that the wireless earphone is occupied to the terminal A through the wireless earphone.
S307, terminal a pauses or mutes the first audio stream based on the received notification message.
It will be appreciated that after the first audio stream is paused, the user continues to play the first audio, which is then played through the speaker or earpiece of terminal a. Or the user turns up the volume, and the first audio is played through the terminal A loudspeaker or the receiver.
It should be noted that, when the second audio stream on the terminal B ends, pauses, or switches to the speaker playing or the earpiece, a message for indicating the end of the second audio stream is sent to the terminal a. And the terminal A sends the first audio stream to the wireless earphone based on the received message when the first audio stream is not finished, and continues to play the first audio stream through the wireless earphone.
In the second case, when the priority of the stream type of the first audio stream is lower than that of the stream type of the second audio stream, the first audio stream continues to be played through the wireless earphone, and the second audio stream is played through the loudspeaker or the earphone on the terminal B.
It should be appreciated that at the end of the first audio stream, the second audio stream continues to be played through terminal B or through a wireless headset. The audio stream end may be understood as switching the audio stream to a speaker or a headphone of the terminal for playing, or suspending playing, or muting playing, etc. I.e. the audio stream is not played through the wireless headset, the end of the audio stream is confirmed.
The method 300 is a specific implementation manner of playing the audio stream by the wireless earphone when only one audio stream is available on the terminal a. In some embodiments multiple audio streams may be present at the same time on terminal a. The manner in which the wireless headset plays the audio streams on both terminals in a scenario where multiple audio streams are concurrent is described in detail below in conjunction with fig. 4.
Fig. 4 is a schematic flow chart of another method 400 of processing an audio stream. The method 400 is applicable to the scenario shown in fig. 1.
As shown in fig. 4, the method 400 may include the steps of:
it should be appreciated that the method 400 shown below is a process after terminal a (first terminal) and terminal B (second terminal) establish a communication connection with a wireless headset.
S401, terminal a generates a first audio stream.
When the terminal A plays the first audio stream by the wireless earphone, the following steps are executed:
s402, the terminal A sends the stream type of the first audio stream to the terminal B through a wireless earphone.
S403, the terminal B receives and records the stream type of the first audio stream.
S404, terminal a generates a second audio stream when the first audio stream flows through the wireless earphone. At this time, the second audio stream and the first audio stream of the terminal a may both be played through the wireless headphones.
S405, the terminal a transmits the stream type of the second audio stream to the terminal B.
S406, the terminal B receives the stream type of the second audio stream and updates the stream type of the first audio stream to the stream type of the second audio stream.
When the first audio stream and the second audio stream pass through the wireless earphone, S407, the terminal B generates a third audio stream.
S408, the terminal B determines whether the priority of the stream type of the third audio stream is lower than the priority of the stream type of the second audio stream.
Similar to the method 300, the magnitude relation of the priority of the stream type of the third audio stream and the priority of the stream type of the second audio stream also exists in two cases:
in the first case, when the priority of the stream type of the third audio stream is not lower than the priority of the stream type of the second audio stream, the wireless earphone plays the third audio stream.
And when the priority of the stream type of the second audio stream is lower than that of the stream type of the third audio stream, the wireless earphone continues to play the audio stream on the terminal A.
The specific steps performed in the case one and the case two may refer to the descriptions related to the case one and the case two in S305 to S307 in the above-mentioned method 300, and are not repeated here.
In connection with the example shown in fig. 4 above, in one implementation, the priority of the stream type of the first audio stream is higher than the priority of the stream type of the second audio stream and the stream type of the third audio stream, but the priority of the stream type of the second audio stream is lower than the priority of the stream type of the third audio stream. Based on the principle that the wireless earphone keeps playing the audio stream with the highest priority, at this time, the wireless earphone should play the audio stream on the terminal a. However, based on the determination method of the method 400, the wireless earphone plays the audio stream on the terminal B (i.e., the third audio stream), but cannot continue playing the first audio stream with the highest priority.
It can be seen that when the same wireless earphone is connected to two terminals at the same time, a plurality of audio streams with different priorities are generated on one terminal, and when the other terminal also generates the audio stream, the situation that the audio stream played by the wireless earphone is not the audio stream with the highest priority on the two terminals can occur, so that the experience of the user for using the wireless earphone is reduced.
In view of this, the embodiments of the present application provide an audio stream processing method and related apparatus, where, in a scenario where two terminals are connected to the same wireless earphone, when a plurality of audio streams appear on one terminal and play through the wireless earphone, the terminal may further determine a stream type with the highest priority in the audio streams played on the wireless earphone when the audio streams played through the wireless earphone change, and send the stream type with the highest priority to another terminal, so that when another terminal generates an audio stream, the other terminal may determine based on the stream type with the highest priority, thereby ensuring that the wireless earphone always plays the audio stream with the highest priority, and improving user experience when using the wireless earphone.
The following describes the technical scheme of the present application and how the technical scheme of the present application solves the above technical problems in detail with specific embodiments. The following embodiments may be combined with each other or implemented independently, and the same or similar concepts or processes may not be described in detail in some embodiments. It should be appreciated that the method embodiments shown below are applicable to the scenario shown in fig. 1.
In a scenario where a terminal a (first terminal) and a terminal B (second terminal) are simultaneously connected to one wireless earphone, three audio streams simultaneously appear on the terminal a is taken as an example, and the method provided by the embodiment of the present application is described in detail.
Fig. 5 is a schematic flowchart of an audio stream processing method 500 according to an embodiment of the present application, and as shown in fig. 5, the method may include the following steps S501 to S516. The steps in fig. 5 are described in detail below.
S501, terminal a generates a first audio stream.
The first audio stream is any audio that can be played through a speaker or earpiece on the terminal. Such as an alarm clock, music, ringing, talking, or system notification sounds, etc.
S502, the terminal a determines whether the first audio stream can be played through the wireless earphone.
It should be appreciated that the first audio stream may be played through the wireless headset while the wireless headset is in an idle state; or when the audio stream played by the wireless earphone is the audio stream on the terminal A, the first audio stream can be played by the wireless earphone; alternatively, the first audio stream may be played through the wireless headset when the priority of the stream type of the audio stream on the terminal B played through the wireless headset is not higher than the priority of the stream type of the first audio stream.
Illustratively, terminal a may determine whether the first audio stream may be played over the wireless headset based on whether the stream type of the audio stream on terminal B is received. For example, if terminal a does not receive the stream type of the audio stream on terminal B, the first audio stream is played by the wireless headset. The terminal a receives the stream type of the audio stream on the terminal B, and further determines the stream type of the audio stream on the terminal B and the priority of the stream type of the first audio stream, thereby determining whether the first audio stream can be played through the wireless earphone.
It should be noted that, when the audio stream on the terminal is played through the wireless earphone, the stream type of the played audio stream is sent to other terminals connected to the wireless earphone; if the audio stream on the terminal is played through its speaker or earpiece, the terminal will not send the stream type of the audio stream to other terminals connected to the wireless headset. Thus, terminal a may determine whether the first audio stream may be played over the wireless headset based on whether the type of audio stream on terminal B was received.
It should also be understood that the stream type of the audio stream on the terminal is determined based on the use of the audio stream, and each type of audio stream may have a corresponding number, that is, a one-to-one correspondence between a plurality of types of audio streams and a plurality of numbers, the correspondence being preset on the terminal by a developer. Therefore, the terminal can transmit the corresponding number when transmitting the type of the audio stream.
Illustratively, S503 to S516 are performed when the first audio stream can be played through the wireless earphone.
S503, the terminal A determines the stream type of the audio stream with the highest priority among the audio streams generated by the terminal A.
It should be appreciated that multiple types of audio streams are included on the terminal and that the priority of each type of audio stream may be different.
For example, the level of priority between audio streams of each type on the terminal may be preset by a developer. For example, a plurality of count values are sequentially arranged in order from high to low or from low to high according to the priorities of the various streams, each count value corresponds to a stream type with the same priority, and the initial value of each count value is 0, which indicates that the audio stream of the stream type corresponding to the count value is in an inactive state, that is, the audio stream of the stream type is turned off or suspended. When the number of audio streams on the terminal changes, the terminal may update the count value of the corresponding stream type, for example, every time an audio stream is generated, the value of the count parameter corresponding to the stream type of the audio stream is increased by 1, and every time an audio stream is finished, the value of the count parameter corresponding to the stream type of the audio stream is decreased by 1.
In combination with the above priority ranking example, if the priorities of the stream types are ranked in order from high to low, the stream type of the audio stream corresponding to the count parameter of the first non-zero value is the stream type with the highest priority. If the priorities of the stream types are arranged in the order from low to high, the stream type of the audio stream corresponding to the last non-zero value calculation parameter is the stream type with the highest priority. Therefore, when determining the stream type with the highest priority, the terminal a only needs to find the stream type corresponding to the count value with the first or last count value not being 0.
If S503 determines that the priority of the stream type of the first audio stream is highest, S504 to S516 are performed.
S504, the terminal a sends the stream type of the first audio stream to the terminal B through the wireless earphone.
S505, the terminal B receives and records the stream type of the first audio stream.
S506, when the first audio stream is played by the wireless earphone, the terminal A generates a second audio stream. At this time, both the second audio stream and the first audio stream may be played through the wireless earphone.
In combination with the above priority ordering example, when generating the second audio stream, the terminal a determines the stream type of the second audio stream, and then adds 1 to the count value corresponding to the stream type.
S507, the terminal A determines the stream type of the audio stream with the highest priority among the audio streams generated by the terminal A. Reference may be made specifically to the relevant description of S503, and will not be repeated here.
The above-mentioned magnitude relation of the priority of the stream type of the first audio stream and the priority of the stream type of the second audio stream has three cases as follows:
in case one, when the priority of the stream type of the first audio stream and the priority of the stream type of the second audio stream are the same, the terminal a may send the stream type of the first audio stream, or the stream type of the second audio stream, or the stream type of no audio stream to the terminal B.
In the second case, the priority of the stream type of the first audio stream is higher than that of the second audio stream, and the terminal a sends the stream type of the first audio stream to the terminal B, or does not send the type of the first audio stream.
In case three, if the stream type of the second audio stream has a higher priority than the stream type of the first audio stream, S508 and S509 are performed.
S508, the terminal A sends the stream type of the second audio stream to the terminal B through a wireless earphone;
s509, the terminal B updates the stream type of the first audio stream to the stream type of the second audio stream.
S510, terminal a generates a third audio stream when the first audio stream and the second audio stream are played through the wireless earphone. At this time, the third audio stream, the second audio stream and the first audio stream may all be played through the wireless earphone.
S511, the terminal A determines the type of the audio stream with the highest priority among the audio streams generated by the terminal A. Reference may be made specifically to the relevant description of S503, and will not be repeated here.
The above-mentioned magnitude relation of the priority of the stream type of the first audio stream, the priority of the stream type of the second audio stream, and the priority of the third audio stream has three cases:
in the first case, the priority of the stream type of the first audio stream is the highest priority stream type in the three audio streams, the terminal a may send the stream type of the first audio stream to the terminal B, or may not send any stream type.
In the second case, the priority of the stream type of the second audio stream is the highest priority stream type in the three audio streams, the terminal a may send the stream type of the second audio stream to the terminal B, or may not send any stream type.
In case three, the priority of the stream type of the third audio stream is the highest priority stream type among the three audio streams, S512 and S513 are performed.
S512, the terminal A sends the stream type of the third audio stream to the terminal B through the wireless earphone;
s513, the type of the terminal B update audio stream is the type of the third audio stream.
S514, when the third audio stream, the second audio stream and the first audio stream are all played through the wireless earphone, the terminal a ends the third audio stream. At this point, the wireless headset continues to play the second audio stream and the first audio stream.
Ending the third audio stream may be understood as turning off the third audio stream, switching the third audio stream to play on the terminal a, suspending the third audio stream, muting the third audio stream, and so on.
And S515, the terminal A determines the stream type with the highest priority in the audio streams which are not ended by the terminal A. Reference is specifically made to the above related description, and no further description is given here.
S516, terminal a sends the stream type with the highest priority to terminal B.
Optionally, before ending the third audio stream, the type of the first audio stream has the highest priority among the three audio stream types, and the type of the audio stream may not be sent after the third audio stream is closed. Or before ending the third audio stream, if the priority of the type of the second audio stream is the highest priority type of the three audio stream types, the type of the audio stream may not be sent after the third audio stream is closed. Or before ending the third audio stream, if the priority of the type of the third audio stream is the highest priority type of the three audio stream types, after closing the third audio stream, the stream type with the highest priority in the first audio stream or the second audio stream needs to be sent.
In the embodiment of the application, the terminal A can simultaneously exist a plurality of audio streams, and when the audio streams are changed, the type of the audio stream with the highest priority is sent to the terminal B through the wireless earphone, so that the terminal B can judge based on the type of the received audio stream with the highest priority when generating the audio stream, thereby avoiding the problem that the audio stream played by the wireless earphone is not the audio stream with the highest priority in the two terminals, and improving the experience of users.
The terminal A comprises an application A, a multimedia framework A and a Bluetooth module A, and the terminal B comprises an application B, a multimedia framework B and a Bluetooth module B. The wireless earphone comprises a Bluetooth module C. It should be understood that the audio stream transmission between terminal a and terminal B is transmitted through bluetooth module a, bluetooth module C, and bluetooth module B. It should also be appreciated that the above-described Applications (APP) a and B may be various types of applications on the terminal for generating audio streams, and are not limited to one application.
The following describes the interaction flow between the above modules in detail with reference to fig. 6, taking the generation of the first audio stream as an example. Fig. 6 is a schematic flow chart of another audio stream processing method 600 provided by an embodiment of the present application. As shown in fig. 6, the method 600 may include the following S601 to S610, and each step in fig. 6 is described in detail below.
S601, the Bluetooth module A and the Bluetooth module C establish communication connection.
S602, the Bluetooth module B and the Bluetooth module C establish communication connection.
S603, the application A generates a first audio stream.
By way of example, application a may be a music APP, a video APP, or a conversation APP, etc., as the application is not limited in this regard.
S604, the application a sends the stream type of the first audio stream to the multimedia framework a.
S605, the multimedia framework a determines whether the first audio stream can be played through the wireless earphone based on the stream type of the received first audio stream.
The specific determination process may refer to the related description in S502, which is not described herein.
S606, the multimedia framework A determines the stream type with the highest priority in the audio stream generated by the local terminal.
The specific determination process may refer to the related description in S503, which is not described herein.
It should be understood that if the multimedia framework a does not receive the stream type of the other audio stream before receiving the stream type of the first audio, the priority of the stream type of the first audio stream is the highest stream type.
S607, the multimedia device a transmits the stream type with the highest priority to the bluetooth module a.
S608, the bluetooth module a sends the stream type with the highest priority to the bluetooth module B through the bluetooth module C.
Illustratively, bluetooth module a sends the highest priority stream type to bluetooth module C; the bluetooth module C transmits the received stream type to the bluetooth module B.
In S609, the bluetooth module B sends the received stream type with the highest priority to the multimedia framework B.
S610, the multimedia framework B records the stream type with the highest priority.
It should be appreciated that application a generates a second audio stream while the first audio stream is being played over the wireless headset. After that, the above S604 to S609 may be continued. Note that, in executing S604 to S609 described above, the first audio stream is replaced with the second audio stream.
It will also be appreciated that the multimedia framework B will update the type of audio stream recorded when the highest stream type is received. For example, the type of the second audio stream is the type of the audio stream having the highest priority, and the stream type of the update record of the multimedia framework B is the stream type of the second audio stream.
Optionally, when the terminal a continues to generate other audio streams, the implementation may refer to the related description of the first audio stream in the method 600, which is not described herein.
Fig. 7 is a schematic flow chart diagram of yet another audio stream processing method 700 according to an embodiment of the present application. The first terminal in the embodiment of the present application may be the above terminal a, and the second terminal may be the above terminal B. As shown in fig. 7, the method 700 may include the following S701 to S703. The steps in fig. 7 are described in detail below.
S701, the first terminal plays at least one audio stream through the wireless earphone. At this time, the wireless headset is occupied by the first terminal.
It should be appreciated that the at least one audio stream may be one or more audio streams of one type or a plurality of audio streams of a plurality of types.
S702, when the number of audio streams played by the first terminal through the wireless earphone changes, the first terminal determines a first stream type, wherein the first stream type is the stream type with the highest priority in the audio streams played by the first terminal through the wireless earphone.
Optionally, before the first terminal plays the at least one audio stream through the wireless earphone, the method 700 further includes: at least one audio stream is generated.
It should be appreciated that in the case where the audio stream on the first terminal may be played through a wireless headset, the type of audio stream with the highest primary priority is determined each time the first terminal generates or ends an audio stream. Or, each time the first terminal generates or ends a different type of audio stream, determining the type of the audio stream with the highest primary priority. Whether the audio stream on the terminal can be played through the wireless earphone may refer to the related description of the method 500, which is not repeated here. The ending of the audio stream is understood as stopping the audio stream, or pausing the audio stream, or muting the audio stream, etc. I.e. the audio stream is not played through the wireless headphones.
S703, the first terminal sends first indication information to the second terminal, where the first indication information is used to indicate the first flow type. Correspondingly, the second terminal receives the first indication information.
The first terminal sends the first indication information to the second terminal through the wireless earphone. That is, the first terminal sends the first indication information to the wireless earphone, and the wireless earphone sends the received first indication information to the second terminal.
When the second terminal receives the first indication information, it can be determined that the wireless earphone is currently in an occupied state, that is, the wireless earphone is playing the audio stream on the first terminal. Optionally, if the second terminal generates the audio stream at this time, the stream type of the audio stream at the home terminal is compared with the priority of the first stream type. When the priority of the stream type of the audio stream of the local terminal is not lower than the priority of the first stream type, the second terminal occupies the wireless earphone, namely the wireless earphone plays the audio stream on the second terminal, and sends a message that the earphone is occupied and indication information of the type of the audio stream played on the wireless earphone to the first terminal. Otherwise, the wireless earphone continues to play the audio on the first terminal.
In the embodiment of the application, under the condition that two terminals are simultaneously connected with the same wireless earphone, when the audio stream on the first terminal is played through the wireless earphone, the number of the audio streams played by the wireless earphone by the first terminal every time is changed, the stream type with the highest priority in at least one audio stream played by the wireless earphone is determined again and is sent to the second terminal, so that when the audio stream is generated on the second terminal, the judgment can be carried out based on the stream type corresponding to the highest priority in the audio stream currently played by the wireless earphone, and whether the wireless earphone can be preempted or not can be judged. Therefore, the wireless earphone can be always preempted by the terminal from which the audio stream with the highest priority is from among all audio streams to be played, and the audio stream with the highest priority can be always played through the wireless earphone, so that the possibility that the audio stream with the high priority is interrupted is reduced, and the experience of a user can be improved.
As an alternative embodiment, the first terminal is configured with a plurality of count values sequentially arranged in order of higher priority of stream types, each count value corresponding to one or more stream types having the same priority, each count value having a preset value as an initial value, and accumulating the count based on audio stream playback of the corresponding stream type; the first terminal determining a first flow type, comprising: and determining the first stream type according to the stream type corresponding to the count value, the first value of which is not the preset value, in the plurality of count values.
Optionally, when the first terminal is configured with a plurality of count values sequentially arranged in order of low priority to high priority of the stream type, the type of the first stream is a stream type corresponding to a count value of which a last value is not a preset value in the plurality of count values.
For example, if the preset initial value of the count value is 0 and the terminal generates one audio stream, the corresponding count value of the audio stream is increased by 1; and each time the terminal finishes one audio stream, the corresponding count value of the stream of the audio stream is reduced by 1.
As an alternative embodiment, the number of audio streams played by the first terminal through the wireless earphone is changed, including: the number of audio streams played by the first terminal through the wireless headset increases or decreases.
As an alternative embodiment, the method 700 further comprises, before the first terminal plays the at least one audio stream through the wireless headset: the second terminal sends second indication information to the first terminal, wherein the second indication information is used for indicating a second stream type, and the second stream type is the stream type with the highest priority in the audio streams from the second terminal which are being played by the wireless earphone. Correspondingly, the first terminal receives the second indication information and determines that the priority of the first stream type is not lower than the priority of the second stream type based on the second indication information.
It should be understood that when the priority of the first stream type is not lower than the priority of the second stream type, the audio stream on the first terminal is played through the wireless earphone, and the stream type with the highest priority in the audio stream on the first terminal is sent to the second terminal. I.e. the first terminal sends the first stream type to the second terminal.
Optionally, if the first terminal determines that the priority of the first stream type is lower than the priority of the second stream type based on the second indication information, the wireless earphone continues to play the audio stream on the second terminal.
As an alternative embodiment, the method 700 further includes: the first terminal sends a first notification message to the second terminal, wherein the first notification message is used for notifying that the wireless earphone is occupied. That is, the wireless headset plays the audio stream on the first terminal and does not play the audio stream on the second terminal. Correspondingly, the second terminal receives the first notification message, and pauses or mutes the audio of the local terminal based on the received first notification message, i.e. the audio stream of the local terminal is not played through the wireless earphone.
Optionally, after the wireless earphone is occupied by the first terminal, when the audio stream of the first terminal ends or is not played through the wireless earphone, the first terminal sends a notification message of the end of playing to the second terminal. Correspondingly, after receiving the notification message of the end of playing, the second terminal continues playing the audio stream of the local terminal through the wireless earphone when the audio stream of the local terminal is not ended, and simultaneously deletes the first stream type received by the local terminal.
As an alternative embodiment, the method 700 further comprises: the second terminal sends third indication information to the first terminal, wherein the third indication information is used for indicating a third stream type, and the priority of the third stream type is not lower than that of the first stream type. Correspondingly, the first terminal receives third indication information from the second terminal. The second terminal sends a second notification message to the first terminal, the second notification message being used to notify that the wireless headset is occupied by the second terminal. Correspondingly, the first terminal receives the second notification message and stops playing at least one audio stream through the wireless earphone based on the second notification message.
The third stream type is the highest priority stream type in at least one stream type played by the second terminal through the wireless earphone.
The third indication information and the second notification information may be transmitted simultaneously or separately. When the first indication information is sent separately, the second indication information is sent first; alternatively, the second notification message is sent first, and then the third indication message is sent, which is not limited in the present application.
Optionally, before the second terminal sends the third indication information, the method further includes: the second terminal generates an audio stream, wherein the stream type of the audio stream is a third stream type; and the second terminal determines that the priority of the third stream type is not lower than the priority of the first stream type based on the received first stream type, and the second terminal preempts the wireless earphone for playing the audio stream of the local terminal.
It should be understood that if the priority of the third stream type is lower than the priority of the first stream type, the audio stream on the second terminal is played through the speaker or the earpiece of the local terminal, and the third indication information is not sent to the first terminal.
It should be further understood that the sequence numbers of the above processes do not mean the order of execution, and the order of execution of the processes should be determined by the functions and internal logic of the processes, and should not be construed as limiting the implementation process of the embodiments of the present application.
The application also provides a computer readable storage medium for storing a computer program for implementing the method executed by the ear camera or the method executed by the terminal in the above method embodiment.
The present application also provides a computer program product comprising a computer program (which may also be referred to as code, or instructions) which, when run on a computer, is capable of performing the method performed by the handset or the method performed by the terminal in the above-described method embodiments.
The embodiment of the application provides a chip. The chip comprises a processor for invoking a computer program in a memory to perform the technical solutions in the above embodiments. The principle and technical effects of the present application are similar to those of the above-described related embodiments, and will not be described in detail herein.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In the several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a read-only memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. An audio stream processing method, applied to a first terminal, where the first terminal and a second terminal are communicatively connected to a wireless headset, the method comprising:
playing at least one audio stream through the wireless headset;
when the number of audio streams played by the first terminal through the wireless earphone changes, determining a first stream type, wherein the first stream type is the stream type with the highest priority in the audio streams played by the first terminal through the wireless earphone;
sending first indication information to the second terminal, wherein the first indication information is used for indicating the first flow type;
before said playing at least one audio stream over said wireless headset, said method further comprises:
receiving second indication information from the second terminal, wherein the second indication information is used for indicating a second stream type, and the second stream type is the stream type with the highest priority in audio streams from the second terminal played by the wireless earphone;
determining that the priority of the first stream type is not lower than the priority of the second stream type based on the second indication information;
the method further comprises the steps of: sending a first notification message to the second terminal, wherein the first notification message is used for notifying that the wireless earphone is occupied by the first terminal;
The method further comprises the steps of: receiving third indication information from the second terminal, wherein the third indication information is used for indicating a third stream type, the priority of the third stream type is not lower than that of the first stream type, and the third stream type is the stream type with the highest priority in at least one stream type played by the second terminal through the wireless earphone;
receiving a second notification message from the second terminal, wherein the second notification message is used for notifying that the wireless earphone is occupied by the second terminal;
stopping playing the at least one audio stream through the wireless headset based on the second notification message; and
the playing at least one audio stream through the wireless earphone comprises:
and transmitting the at least one audio stream to the wireless earphone to play the at least one audio stream through the wireless earphone.
2. The method according to claim 1, wherein the first terminal is configured with a plurality of count values sequentially arranged in order of priority of stream types from high to low, each count value corresponding to one or more stream types having the same priority, each count value having a preset value as an initial value, and accumulating the count based on audio stream playback of the corresponding stream type;
The determining the first stream type includes:
and determining the first stream type according to the stream type corresponding to the count value, of which the first value is not the preset value, in the plurality of count values.
3. The method according to claim 1 or 2, wherein the number of audio streams played by the first terminal through the wireless headset is changed, comprising: the number of audio streams played by the first terminal through the wireless earphone increases or decreases.
4. An audio stream processing method, which is applied to a system including a first terminal, a second terminal and a wireless earphone, the method comprising:
the first terminal plays at least one audio stream through the wireless earphone;
when the number of the audio streams played by the first terminal through the wireless earphone changes, determining a first stream type, wherein the first stream type is the stream type with the highest priority in the audio streams played by the first terminal through the wireless earphone;
the first terminal sends first indication information to the second terminal, wherein the first indication information is used for indicating the first flow type;
before the first terminal plays at least one audio stream through the wireless headset, the method further comprises:
The second terminal sends at least one audio stream to the wireless earphone;
the second terminal determines a second stream type based on the at least one audio stream, wherein the second stream type is the stream type with the highest priority in the audio streams played by the second terminal through the wireless earphone;
the second terminal sends second indication information to the first terminal, wherein the second indication information is used for indicating the second stream type;
the first terminal determines that the priority of the first stream type is not lower than the priority of the second stream type based on the second indication information;
the method further comprises the steps of:
the second terminal receives a first notification message from a first terminal, wherein the notification message is used for notifying that the wireless earphone is occupied by the first terminal;
the second terminal stops playing the audio stream through the wireless earphone based on the first notification message;
the method further comprises the steps of:
when the number of the audio streams played by the second terminal through the wireless earphone changes, determining a third stream type, wherein the third stream type is the stream type with the highest priority in the audio streams played by the second terminal through the wireless earphone;
The second terminal sends third indication information to the first terminal, wherein the third indication information is used for indicating the third stream type;
the second terminal sends a second notification message to the first terminal, wherein the second notification message is used for notifying that the wireless earphone is occupied by the second terminal;
and the first terminal stops playing the audio stream through the wireless earphone based on the second notification message.
5. The method of claim 4, wherein the first terminal changes the number of audio streams played through the wireless headset, comprising: the number of audio streams played by the first terminal through the wireless earphone increases or decreases.
6. The method according to claim 4 or 5, wherein,
the first terminal plays the at least one audio stream through the wireless earphone, including:
the first terminal sends the at least one audio stream to the wireless headset to play the at least one audio stream through the wireless headset.
7. The method according to claim 6, wherein each of the first terminal and the second terminal is configured with a plurality of count values sequentially arranged in order of higher priority of stream types, each count value corresponding to one or more stream types having the same priority, each count value having a preset value as an initial value, and accumulating the count based on audio stream playback of the corresponding stream type; and the stream type corresponding to the first calculated value which is not the preset value in the plurality of counted values in each terminal is the stream type with the highest priority in the audio stream played by each terminal through the wireless earphone.
8. A terminal device, comprising: a processor and a memory;
the memory stores computer-executable instructions;
the processor executing computer-executable instructions stored in the memory to cause the terminal device to perform the method of any one of claims 1-3.
9. An audio stream processing system, comprising: the wireless earphone comprises a first terminal, a second terminal and a wireless earphone, wherein the first terminal and the second terminal are both in communication connection with the wireless earphone;
the wireless earphone is used for playing at least one audio stream from the first terminal;
the first terminal is used for determining a first stream type when the number of audio streams played through the wireless earphone changes, wherein the first stream type is the stream type with the highest priority in the audio streams played through the wireless earphone by the first terminal;
sending first indication information to the second terminal, wherein the first indication information is used for indicating the first flow type;
before the wireless earphone is used for playing at least one audio stream from the first terminal, the second terminal is used for sending second indication information to the first terminal, the second indication information is used for indicating a second stream type, and the second stream type is the stream type with the highest priority in the audio streams played by the second terminal through the wireless earphone;
The first terminal is further configured to determine, based on the second indication information, that the priority of the first stream type is not lower than the priority of the second stream type;
the second terminal is further configured to receive a first notification message from a first terminal, where the notification message is configured to notify that the wireless headset is occupied by the first terminal;
the second terminal is further configured to stop playing an audio stream through the wireless headset based on the first notification message;
the second terminal is further configured to determine a third stream type when the number of audio streams played through the wireless earphone changes, where the third stream type is a stream type with a highest priority in the audio streams played through the wireless earphone by the second terminal;
the second terminal is further configured to send third indication information to the first terminal, where the third indication information is used to indicate the third stream type;
the second terminal is further configured to send a second notification message to the first terminal, where the second notification message is used to notify that the wireless headset is occupied by the second terminal;
the first terminal is further configured to stop playing an audio stream through the wireless headset based on the second notification message.
10. A computer readable storage medium storing a computer program, which when executed by a processor, implements the method according to any one of claims 1-7.
CN202211035410.0A 2022-08-26 2022-08-26 Audio stream processing method and related device Active CN116088787B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211035410.0A CN116088787B (en) 2022-08-26 2022-08-26 Audio stream processing method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211035410.0A CN116088787B (en) 2022-08-26 2022-08-26 Audio stream processing method and related device

Publications (2)

Publication Number Publication Date
CN116088787A CN116088787A (en) 2023-05-09
CN116088787B true CN116088787B (en) 2023-11-28

Family

ID=86201298

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211035410.0A Active CN116088787B (en) 2022-08-26 2022-08-26 Audio stream processing method and related device

Country Status (1)

Country Link
CN (1) CN116088787B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106254185A (en) * 2015-06-05 2016-12-21 苹果公司 Voice data route between the equipment of multiple wireless connections
CN114040373A (en) * 2021-11-19 2022-02-11 Oppo广东移动通信有限公司 Audio service processing method and device, electronic equipment and storage medium
CN114173309A (en) * 2020-09-10 2022-03-11 华为技术有限公司 Audio control system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9632748B2 (en) * 2014-06-24 2017-04-25 Google Inc. Device designation for audio input monitoring

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106254185A (en) * 2015-06-05 2016-12-21 苹果公司 Voice data route between the equipment of multiple wireless connections
CN114173309A (en) * 2020-09-10 2022-03-11 华为技术有限公司 Audio control system
CN114040373A (en) * 2021-11-19 2022-02-11 Oppo广东移动通信有限公司 Audio service processing method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN116088787A (en) 2023-05-09

Similar Documents

Publication Publication Date Title
CN113225693B (en) Bluetooth connection method, equipment and system
CN112789866B (en) Audio data transmission method and equipment applied to TWS earphone single-ear and double-ear switching
CN114915880B (en) Point-to-multipoint data transmission method and electronic equipment
US20210337610A1 (en) Wireless communication method, terminal, audio component, device, and storage medium
CN112042212B (en) Audio data transmission method and electronic equipment
JP7468830B2 (en) Energy efficient display processing method and device - Patents.com
CN111601199A (en) Wireless earphone box and system
CN112469010B (en) Bluetooth connection method and related device
CN111212412B (en) Near field communication method and device, computer readable storage medium and electronic equipment
WO2024037134A1 (en) Communication method and related apparatus
CN115002934B (en) Audio service processing system, electronic equipment and Bluetooth headset
CN112806092B (en) Microphone MIC switching method and device
CN112771828B (en) Audio data communication method and electronic equipment
CN114079892A (en) Bluetooth communication method, wearable device and system
CN112740728B (en) Bluetooth communication method and electronic equipment
CN113992663B (en) Method for sending file, electronic device and readable storage medium
WO2023088209A1 (en) Cross-device audio data transmission method and electronic devices
CN114554012B (en) Incoming call answering method, electronic equipment and storage medium
CN116088787B (en) Audio stream processing method and related device
EP4336356A1 (en) Screen projection method and related apparatus
CN113678481B (en) Wireless audio system, audio communication method and equipment
CN117917899A (en) Audio service processing method, electronic equipment and computer storage medium
CN118283014A (en) Audio stream transmission method and device
CN118158598A (en) Audio playing method, audio playing device 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