Audio switching method and device and electronic equipment

By delaying the audio playback after the host device detects that the Bluetooth playback device has entered audio playback mode, the problem of pauses during sound switching is solved, achieving audio continuity and a user-friendly prompt mechanism.

CN118972488APending Publication Date: 2024-11-15VIVO MOBILE COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410600655.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-14
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

There is a brief pause and a sense of discontinuity when the sound is switched from the host device to the Bluetooth playback device, which makes it impossible to guarantee the continuity of the sound for the user.

Method used

After detecting that a Bluetooth playback device has entered audio playback mode, the host device delays for a period of time before continuing to play the audio signal and then stops, ensuring the continuity of audio switching, and displaying prompt information or adjusting the volume in case of communication failure.

Benefits of technology

It effectively avoids interruptions when switching audio playback sources, ensuring the continuity of the user's listening experience, and promptly alerts the user to device or network problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118972488A_ABST
    Figure CN118972488A_ABST
Patent Text Reader

Abstract

The invention discloses an audio switching method and device and electronic equipment, and belongs to the technical field of communication. The method comprises the steps that under the condition that first equipment plays an audio signal, if it is detected that second equipment in communication connection with the first equipment enters an audio playing state, the first moment when the second equipment enters the audio playing state is obtained, and the second equipment plays the audio signal transmitted by the first equipment in the audio playing state; and audio playing of the first device is stopped at a second moment, and the second moment is a moment of the first duration after the first moment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of terminal technology, and specifically relates to an audio switching method, device and electronic device. Background Art

[0002] Bluetooth playback devices refer to devices that can receive audio signals and play sounds through Bluetooth technology. These devices can be Bluetooth headsets, Bluetooth speakers, Bluetooth headsets, Bluetooth car audio, etc. They can be paired with other host devices equipped with Bluetooth functions (such as mobile phones, tablets, computers, etc.) to receive audio signals transmitted by the host device and play sounds.

[0003] Then, when the sound is switched from the host device to the Bluetooth playback device for playback, there will be a brief pause, which will cause the user to feel a more obvious sense of stagnation and disconnection, so the continuity of the user's listening to the sound cannot be guaranteed. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide an audio switching method, device and electronic device, which can solve the technical problem of discontinuous sound when the sound is switched from a host device to a Bluetooth playback device for playback.

[0005] In a first aspect, an embodiment of the present application provides an audio switching method, the method comprising:

[0006] When the first device plays an audio signal, if it is detected that the second device connected to the first device for communication enters an audio playing state, obtaining a first moment when the second device enters the audio playing state, in which the second device plays the audio signal transmitted by the first device;

[0007] Stop the audio playback of the first device at a second moment, wherein the second moment is a moment of a first duration after the first moment.

[0008] In a second aspect, an embodiment of the present application provides an audio switching device, the device comprising:

[0009] A first acquisition module is used for, when a first device plays an audio signal, if it is detected that a second device connected to the first device in communication enters an audio playback state, acquiring a first moment when the second device enters the audio playback state, in which the second device plays the audio signal transmitted by the first device;

[0010] The stop module is used to stop the audio playback of the first device at a second moment, wherein the second moment is a moment of a first duration after the first moment.

[0011] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the method provided in the first aspect are implemented.

[0012] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method provided in the first aspect are implemented.

[0013] In a fifth aspect, an embodiment of the present application provides a chip, the chip including a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the method provided in the first aspect.

[0014] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method provided in the first aspect.

[0015] In the audio switching method, device and electronic device of the present application, when a first device that is playing audio is in communication connection with a second device, and the second device receives an audio signal transmitted by the first device and starts playing it, the first device does not stop playing the audio immediately, but continues to play the audio for a short period of time before stopping the audio. In this way, pauses can be avoided when switching the audio playback source, thereby ensuring the continuity of the user's listening to the sound. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 It is a flowchart of an audio switching method provided by an embodiment of the present application;

[0017] Figure 2 is a structural schematic diagram of an audio switching device provided by another embodiment of the present application;

[0018] Figure 3 is a structural schematic diagram of an electronic device provided by another embodiment of the present application;

[0019] Figure 4 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0020] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0021] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0022] In order to solve the above technical problems, the present application provides an audio switching method. The audio switching method provided by the embodiment of the present application is described in detail below through specific embodiments and application scenarios in conjunction with the accompanying drawings.

[0023] like Figure 1 As shown, Figure 1 : is a flow chart of an audio switching method provided by an embodiment of the present application. The embodiment of the present application provides an audio switching method, which may include:

[0024] S101, when a first device plays an audio signal, if it is detected that a second device communicatively connected to the first device enters an audio playing state, determining a first moment when the second device enters the audio playing state, in which the second device plays the audio signal transmitted by the first device;

[0025] In this embodiment, the first device may be a host device with control and management functions, which may be a mobile phone, a tablet computer, or a computer. The host device may generate an audio signal and play the audio signal, or send the audio signal to an external device for playback via Bluetooth or other wireless or wired methods. The second device may be a Bluetooth playback device with Bluetooth function, which may receive an audio signal via Bluetooth and play the content of the audio signal. For example, Bluetooth headsets, Bluetooth speakers, and Bluetooth car audio systems are all Bluetooth playback devices.

[0026] When the first device is playing an audio signal, the presence of a Bluetooth playback device is detected, that is, the second device and the first device have established a communication connection, and the second device enters the audio playback state, then the first moment when the second device enters the audio playback state can be determined, that is, the moment when the second device starts to play the audio signal transmitted by the first device is determined as the first moment.

[0027] Specifically, the first device can determine the first moment when the second device enters the audio playback state by receiving various types of information sent by the second device. For example, when the second device starts to play the audio signal transmitted by the first device, it will send audio stream control information to the first device. The first device can detect the change of the playback state of the second device by monitoring the audio stream control information, and determine the moment when the audio stream control information is first received as the first moment. For another example, when the second device starts to play the audio signal transmitted by the first device, volume control information is usually transmitted to the first device. The first device can determine the change of the playback state by monitoring the change of the volume control information, and determine the moment when the volume control information is first received as the first moment.

[0028] S102: Stop the audio playback of the first device at a second moment, where the second moment is a moment a first time period after the first moment.

[0029] In an embodiment of the present application, after the first device monitors that the second device has entered the audio playback state, the audio playback on the first device is not stopped immediately, but the content of the audio signal continues to be played within a first time period after the first moment, until a second moment of the first time period after the first moment, the first device stops the audio playback, and the first time period can be 2 seconds, 5 seconds or 10 seconds.

[0030] In the present application, when a first device that is playing audio and a second device are in communication connection, and the second device receives the audio signal transmitted by the first device and starts playing it, the first device does not stop playing the audio immediately, but continues to play the audio for a short period of time before stopping the audio. In this way, pauses can be avoided when switching the audio playback source, thereby ensuring the continuity of the user's listening to the sound.

[0031] In some embodiments, the method further comprises:

[0032] In a case where it is detected that the first device and the second device establish a communication connection, determining a third time at which the first device and the second device establish a communication connection;

[0033] If the second device does not enter the audio playing state within a second time period after the third moment, a prompt message is displayed, where the prompt message is used to indicate that the second device cannot play the audio signal transmitted by the first device.

[0034] In this embodiment, there is a problem that the first device and the second device establish a communication connection, but the second device cannot play the audio signal in the first device.

[0035] For example, the first device is the host device and the second device is the Bluetooth playback device: although the host device is successfully connected to the Bluetooth playback device, the audio signal cannot be transmitted due to unstable connection or poor connection quality, so the Bluetooth playback device cannot play the audio signal content normally. Alternatively, even if the audio signal can be transmitted normally, the Bluetooth playback device needs to perform specific settings on the host device after connection before it can start playing audio. If the configuration is incorrect or incomplete, the audio cannot be played.

[0036] Therefore, when it is detected that the first device and the second device establish a communication connection, the third moment when the first device and the second device establish a communication connection can be determined, and a second duration can be set as a duration threshold. If the second device does not enter the audio playback state within the second duration after the communication connection is established, it can be considered that there is a fault in the device or the communication between the devices or an error in the configuration. In this case, the content of the audio information can continue to be played on the first device, that is, the audio playback of the first device is not stopped, and a prompt message is displayed on the first device to prompt the user that the second device cannot play the audio signal transmitted by the first device, so that the user can check the device and the network. The second duration can be 3 seconds, 5 seconds or 8 seconds.

[0037] In this embodiment, unlike the related art in which the audio playback of the first device is stopped once the first device and the second device establish a communication connection, it is also necessary to detect whether the second device starts playing the content of the audio signal transmitted by the first device. If the second device fails to play the content of the audio signal transmitted by the first device within a second time period after the communication connection is established, it is considered that there is a fault or configuration error in the device or communication network, and a prompt message is generated and displayed on the first device. This not only avoids sudden interruption of the sound source, but also reminds the user to promptly know the problems with the device or communication network.

[0038] In some embodiments, the method further comprises:

[0039] When a first device plays an audio signal, if it is detected that a second device that is communicatively connected to the first device has not entered an audio playback state within a second time period after a third moment, the audio signal is kept playing, wherein the third moment is the moment when the first device and the second device establish a communication connection.

[0040] In this embodiment, as described above, there is a problem that the first device and the second device establish a communication connection, but the second device cannot play the audio signal in the first device.

[0041] Therefore, if the first device is continuously playing the audio signal and detects that the first device and the second device have established a communication connection, the third moment when the first device and the second device establish a communication connection can be determined, and a second duration can be set as the duration threshold. If the second device does not enter the audio playback state within the second duration after the communication connection is established, it can be considered that there is a fault in the device or the communication between the devices or an error in the configuration. At this time, since the second device cannot play the audio signal, the audio signal is kept playing on the first device, so as to avoid sudden interruption of the sound source and improve the user's hearing experience.

[0042] In some embodiments, the above S102 includes:

[0043] The playback volume of the audio signal on the first device is reduced according to a preset manner until the playback volume is reduced to 0.

[0044] In this embodiment, the method of stopping the audio playback on the first device can be personalized according to the needs of the user, and the volume can be reduced according to the preset method.

[0045] For example, the preset method may be to set the volume to N levels in advance, and reduce a fixed volume level at fixed intervals, thereby gradually reducing the volume until the volume is reduced to 0. The preset method may also be to gradually reduce the volume of the first device based on a sound fade-out effect, so that the audio is smoothly reduced to silence. The preset method may also be to immediately reduce the playback volume of the first device to 0.

[0046] Through the above method, the personalized demands of different users for volume reduction can be met, thereby improving user satisfaction.

[0047] In some embodiments, the method further comprises:

[0048] After detecting that the prompt tone of the second device ends, the state of the second device is determined to be an audio playing state, and the prompt tone is used to indicate that the second device and the first device establish a communication connection.

[0049] In this embodiment, the second device may be a Bluetooth playback device. The prompt tone refers to a sound signal emitted by the second device after establishing a communication connection with the first device, which is used to indicate the working status of the second device. For example, the prompt tone may be a short "beep" sound; or it may be a voice output, and the content of the voice output may be "A Bluetooth connection has been established with the first device".

[0050] Therefore, it can be considered that after the prompt tone is played, the second device will play the content of the audio signal transmitted by the first device. Therefore, when the prompt tone of the second device is detected to be finished, the state of the second device is determined to be the audio playing state.

[0051] Through the above method, the status of the second device can be accurately known through the prompt sound, so as to further adjust the playing status of the first device.

[0052] In some embodiments, the method further comprises:

[0053] In the case that the second device is a Bluetooth headset, if it is detected that the second device is in a worn state and the prompt sound of the second device ends, the state of the second device is determined to be an audio playback state, and the prompt sound is used to indicate that the second device and the first device establish a communication connection.

[0054] In this embodiment, when the second device is a Bluetooth headset, the Bluetooth headset will play audio only when the Bluetooth headset is in a wearing state. Similarly, the prompt tone refers to a sound signal emitted after the Bluetooth headset and the first device establish a communication connection, which is used to indicate the working state of the Bluetooth headset. Therefore, it can be considered that after the second device is in a wearing state and the prompt tone is played, the second device will play the content of the audio signal transmitted by the first device. Therefore, when it is detected that the second device is in a wearing state and the prompt tone of the second device ends, the state of the second device is determined to be an audio playback state.

[0055] For example, a Bluetooth headset can be equipped with a gyroscope sensor. When the first device and the second device are in a communication connection, the gyroscope sensor will periodically send the tilt angle information and direction information of the second device to the first device. The first device can determine whether the second device is in a wearing state based on the tilt angle information and direction information.

[0056] For example, a distance measuring sensor may be further provided in the Bluetooth headset, and the distance measuring sensor may detect the distance between an object and the sensor. Therefore, the second device may be used to detect whether the Bluetooth headset is close to the head, thereby determining whether the Bluetooth headset is in a wearing state.

[0057] In this embodiment, the first device can accurately know the state of the second device through the wearing state and prompt sound information of the second device, so as to further adjust the playing state of the first device.

[0058] Figure 2 is a structural diagram of an audio switching device provided by another embodiment of the present application, such as Figure 2 As shown, the audio switching device may include:

[0059] The first acquisition module 201 is used for, when the first device plays an audio signal, if it is detected that the second device connected to the first device in communication enters the audio playing state, to acquire the first moment when the second device enters the audio playing state, in which the second device plays the audio signal transmitted by the first device in the audio playing state;

[0060] The stopping module 202 is configured to stop the audio playing of the first device at a second moment, wherein the second moment is a moment of a first duration after the first moment.

[0061] In the present application, when a first device that is playing audio and a second device are in communication connection, and after the second device receives the audio signal transmitted by the first device and starts playing it, the first device does not stop playing the audio immediately, but continues to play the audio for a short period of time before stopping the audio. In this way, pauses can be avoided when switching the audio playback source, thereby ensuring the continuity of the user's listening to the sound.

[0062] In another optional example, the audio switching device includes:

[0063] A second acquisition module, configured to acquire a third time at which the first device and the second device establish a communication connection when it is detected that the first device and the second device establish a communication connection;

[0064] A generating module is used to display a prompt message when the second device does not enter the audio playing state within a second time period after the third moment, wherein the prompt message is used to indicate that the second device cannot play the audio signal transmitted by the first device.

[0065] In another optional example, the audio switching device includes:

[0066] A playback module is used to maintain the playback of the audio signal when a first device plays an audio signal and if it is detected that a second device that is communicatively connected to the first device has not entered an audio playback state within a second time period after a third moment, wherein the third moment is the moment when the first device and the second device establish a communication connection.

[0067] In another optional example, the device further includes:

[0068] The reduction module is used to reduce the playback volume of the audio signal on the first device according to a preset method until the playback volume is reduced to 0.

[0069] In another optional example, the device further includes:

[0070] The first determination module is used to determine the state of the second device as an audio playing state when it is detected that the prompt tone of the second device ends, wherein the prompt tone is used to indicate that the second device and the first device establish a communication connection.

[0071] In another optional example, the device further includes:

[0072] The second determination module is used to determine the state of the second device as the audio playback state when the second device is a Bluetooth headset and it is detected that the second device is in a wearing state and the prompt sound of the second device ends. The prompt sound is used to indicate that the second device and the first device establish a communication connection.

[0073] The audio switching device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or it can be other devices other than the terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a car-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., and the embodiment of the present application is not specifically limited.

[0074] The audio switching device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an IOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0075] The audio switching device provided in the embodiment of the present application can achieve Figure 1 To avoid repetition, the various processes implemented by the method embodiment are not described here.

[0076] Alternatively, if Figure 3 As shown, an embodiment of the present application also provides an electronic device 100, including a processor 110, a memory 119, and a program or instruction stored in the memory 119 and executable on the processor 110. When the program or instruction is executed by the processor 110, each process of the above-mentioned audio switching method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0077] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.

[0078] Please refer to Figure 4 , Figure 4 The hardware structure diagram of an electronic device for implementing an embodiment of the present application is shown in FIG. The electronic device 100 includes, but is not limited to, a radio frequency unit 121, a network module 122, an audio output unit 123, an input unit 124, a sensor 125, a display unit 126, a user input unit 127, an interface unit 128, a memory 129, and a processor 120.

[0079] Those skilled in the art will appreciate that the electronic device 120 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 120 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 4 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0080] The processor 120 is configured to, when the first device plays an audio signal, obtain a first moment when the second device enters the audio playing state if it is detected that the second device in communication connection with the first device enters the audio playing state, and in the audio playing state, the second device plays the audio signal transmitted by the first device;

[0081] The processor 120 is configured to stop the audio playback of the first device at a second moment, wherein the second moment is a moment of a first duration after the first moment.

[0082] In the present application, when a first device that is playing audio and a second device are in communication connection, and after the second device receives the audio signal transmitted by the first device and starts playing it, the first device does not stop playing the audio immediately, but continues to play the audio for a short period of time before stopping the audio. In this way, pauses can be avoided when switching the audio playback source, thereby ensuring the continuity of the user's listening to the sound.

[0083] In another optional example, the processor 120 is configured to, when detecting that the first device and the second device establish a communication connection, obtain a third time at which the first device and the second device establish a communication connection;

[0084] The processor 120 is further configured to display a prompt message when the second device does not enter the audio playback state within a second time period after the third moment, wherein the prompt message is configured to indicate that the second device cannot play the audio signal transmitted by the first device.

[0085] In another optional example, the processor 120 is also used to, when the first device is playing an audio signal, maintain the playback of the audio signal if it is detected that the second device communicatively connected to the first device has not entered the audio playback state within a second time period after a third moment, wherein the third moment is the moment when the first device and the second device establish a communication connection.

[0086] In another optional example, the processor 120 is configured to reduce the playback volume of the audio signal on the first device in a preset manner until the playback volume is reduced to 0.

[0087] In another optional example, the processor 120 is used to determine the state of the second device as an audio playback state upon detecting that the prompt tone of the second device ends, and the prompt tone is used to indicate that the second device and the first device establish a communication connection.

[0088] In another optional example, the processor 120 is also used to, when the second device is a Bluetooth headset, determine the state of the second device as an audio playback state if it is detected that the second device is in a worn state and the prompt sound of the second device ends, and the prompt sound is used to indicate that the second device and the first device establish a communication connection.

[0089] It should be understood that in the embodiment of the present application, the input unit 124 may include a graphics processor (Graphics Processing Unit, GPU) 1241 and a microphone 1242, and the graphics processor 1241 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 126 may include a display panel 1261, and the display panel 1261 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 127 includes a touch panel 1271 and at least one of other input devices 1272. The touch panel 1271 is also called a touch screen. The touch panel 1271 may include two parts: a touch detection device and a touch controller. Other input devices 1272 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0090] The memory 129 can be used to store software programs and various data. The memory 129 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 129 may include a volatile memory or a non-volatile memory, or the memory 129 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 129 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0091] The processor 120 may include one or more processing units; optionally, the processor 120 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 120.

[0092] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned audio switching method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0093] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0094] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned audio switching method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0095] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0096] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned audio switching method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0097] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0098] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0099] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. An audio switching method, characterized in that: The method is performed by a first device and includes: When the first device plays an audio signal, if it is detected that the second device connected to the first device for communication enters an audio playing state, obtaining a first moment when the second device enters the audio playing state, in which the second device plays the audio signal transmitted by the first device; Stop the audio playback of the first device at a second moment, wherein the second moment is a moment of a first duration after the first moment.

2. The method according to claim 1, characterized in that The method further comprises: When it is detected that the first device and the second device establish a communication connection, acquiring a third time at which the first device and the second device establish a communication connection; If the second device does not enter the audio playing state within a second time period after the third moment, a prompt message is displayed, where the prompt message is used to indicate that the second device cannot play the audio signal transmitted by the first device.

3. The method according to claim 1, characterized in that The method further comprises: When a first device plays an audio signal, if it is detected that a second device that is communicatively connected to the first device has not entered an audio playback state within a second time period after a third moment, the audio signal of the first device is kept playing, wherein the third moment is the moment when the first device and the second device establish a communication connection.

4. The method according to claim 1, characterized in that: The stopping the audio playing of the first device includes: The playback volume of the audio signal on the first device is reduced according to a preset manner until the playback volume is reduced to 0.

5. The method according to claim 1, characterized in that: The method further comprises: After detecting that the prompt tone of the second device ends, the state of the second device is determined to be an audio playing state, and the prompt tone is used to indicate that the second device and the first device establish a communication connection.

6. The method according to claim 1, characterized in that The method further comprises: In the case that the second device is a Bluetooth headset, if it is detected that the second device is in a worn state and the prompt sound of the second device ends, the state of the second device is determined to be an audio playback state, and the prompt sound is used to indicate that the second device and the first device establish a communication connection.

7. An audio switching device, characterized in that: include: A first acquisition module is used for, when a first device plays an audio signal, if it is detected that a second device connected to the first device in communication enters an audio playback state, acquiring a first moment when the second device enters the audio playback state, in which the second device plays the audio signal transmitted by the first device; The stop module is used to stop the audio playback of the first device at a second moment, wherein the second moment is a moment of a first duration after the first moment.

8. The device according to claim 7, characterized in that The device also includes: A second acquisition module, configured to acquire a third time at which the first device and the second device establish a communication connection when it is detected that the first device and the second device establish a communication connection; A generating module is used to display a prompt message when the second device does not enter the audio playing state within a second time period after the third moment, wherein the prompt message is used to indicate that the second device cannot play the audio signal transmitted by the first device.

9. The device according to claim 7, characterized in that The device also includes: A playback module is used to maintain the playback of the audio signal when a first device plays an audio signal and if it is detected that a second device that is communicatively connected to the first device has not entered an audio playback state within a second time period after a third moment, wherein the third moment is the moment when the first device and the second device establish a communication connection.

10. The device according to claim 7, characterized in that The device also includes: The reduction module is used to reduce the playback volume of the audio signal on the first device according to a preset method until the playback volume is reduced to 0.

11. The device according to claim 7, characterized in that The device also includes: The first determination module is used to determine the state of the second device as an audio playing state when it is detected that the prompt tone of the second device ends, wherein the prompt tone is used to indicate that the second device and the first device establish a communication connection.

12. The device according to claim 7, characterized in that The device also includes: The second determination module is used to determine the state of the second device as the audio playback state when the second device is a Bluetooth headset and it is detected that the second device is in a wearing state and the prompt sound of the second device ends. The prompt sound is used to indicate that the second device and the first device establish a communication connection.

13. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the audio switching method as described in any one of claims 1 to 6 are implemented.