Audio playing method and device, electronic equipment and medium
By restarting the preset connection mode when it fails to start, the problem of audio playing from the speaker after the audio device is connected is solved, thus achieving reliability and versatility of audio device playback.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2026-03-10
AI Technical Summary
During audio playback, after the audio device is connected to the electronic device, the audio may still be played from the electronic device's speaker, causing the electronic device to have an external audio playback problem.
If the preset connection mode fails to start, determine the target information related to the audio device and application, and restart the preset connection mode again if the target information meets the startup conditions, so as to play audio through the audio device.
This avoids audio being played from the electronic device's speaker, solving the problem of external audio playback and improving the reliability and versatility of audio playback.
Smart Images

Figure CN121645407A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of audio technology, and in particular to an audio playback method, apparatus, electronic device, and medium. Background Technology
[0002] With the development of wireless communication technology, audio devices can now connect wirelessly to electronic devices to play audio, greatly enhancing portability. However, when an audio device is connected during playback, the audio may still be played from the electronic device's speaker, leading to the problem of external audio output from the electronic device. Summary of the Invention
[0003] To overcome the problems existing in related technologies, this disclosure provides an audio playback method, apparatus, electronic device, and medium.
[0004] According to a first aspect of the present disclosure, an audio playback method is provided, the audio playback method comprising:
[0005] When an audio device is connected, the default connection mode is activated in response to the application's call command;
[0006] If the preset connection mode fails to start, determine the target information related to the audio device and the application;
[0007] If the target information meets the startup conditions, the preset connection mode will be restarted.
[0008] In the preset connection mode, the application's audio is played by the audio device.
[0009] In some embodiments of this disclosure, the application sends the invocation instruction upon receiving a first broadcast; the step of determining target information related to the audio device and the application in the event that the preset connection mode fails to start includes:
[0010] If the preset connection mode fails to start and a second broadcast is received, the target information is determined.
[0011] The first broadcast and the second broadcast are transmitted sequentially when the audio device is connected.
[0012] In some embodiments of this disclosure, the target information includes a startup identifier associated with the audio device; the audio playback method further includes:
[0013] Upon receiving the first broadcast, determine the connection status of the audio device mentioned in the first broadcast;
[0014] If the connection status is "connected", the startup identifier is set to the first identifier.
[0015] In some embodiments of this disclosure, the target information further includes application information related to the application; the audio playback method further includes:
[0016] When the launch identifier is the first identifier, the application's communication mechanism information and identification information are stored in the application information.
[0017] In some embodiments of this disclosure, the startup conditions include the startup identifier being the first identifier and the application information containing the communication mechanism information and the identifier information.
[0018] In some embodiments of this disclosure, the audio playback method further includes:
[0019] In response to the application's deletion command, the communication mechanism information and the identification information in the application information are deleted.
[0020] In some embodiments of this disclosure, the audio playback method further includes:
[0021] Upon receiving the second broadcast, the audio device identifier will be changed from the second identifier to the third identifier;
[0022] The second identifier is used to indicate that the audio device does not exist, and the third identifier is used to indicate that the audio device exists.
[0023] In some embodiments of this disclosure, the preset connection mode cannot be successfully started when the audio device identifier is the second identifier; the preset connection mode can be successfully started when the audio device identifier is the third identifier.
[0024] In some embodiments of this disclosure, the audio device is a Bluetooth audio device, and the preset connection mode is a synchronous connection-oriented mode.
[0025] According to a second aspect of the present disclosure, an audio playback device is provided, the audio playback device comprising:
[0026] A first startup module is configured to initiate a preset connection mode in response to a call command from an application when an audio device is connected.
[0027] A determination module is configured to determine target information related to the audio device and the application in the event that the preset connection mode fails to start;
[0028] The second startup module is configured to restart the preset connection mode when the target information meets the startup conditions.
[0029] In the preset connection mode, the application's audio is played by the audio device.
[0030] According to a third aspect of the present disclosure, an electronic device is provided, the electronic device comprising:
[0031] processor;
[0032] Memory used to store the processor's executable instructions;
[0033] The processor is configured to execute the audio playback method described above.
[0034] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, wherein when instructions in the storage medium are executed by a processor of a terminal, the terminal is enabled to perform the audio playback method as described above.
[0035] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects:
[0036] When an audio device is connected, the application needs to play audio through it. In response to the application's invocation, a preset connection mode is initiated to allow the audio device to play audio. If the preset connection mode fails to initiate, the audio device cannot play audio, and target information related to the audio device and the application is determined. If the target information meets the initiation conditions, audio playback through the audio device is still required, and the preset connection mode is initiated again. By restarting the preset connection mode to allow audio device playback when it fails to initiate, the problem of audio being played from the electronic device's speakers is solved, thus preventing audio from being played from the electronic device's speakers.
[0037] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0038] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0039] Figure 1 This is a diagram illustrating the process of calling up an audio device;
[0040] Figure 2 This is a flowchart illustrating an audio playback method according to an exemplary embodiment;
[0041] Figure 3 This is a flowchart illustrating an audio playback method according to another exemplary embodiment;
[0042] Figure 4 This is a flowchart illustrating an audio playback method according to another exemplary embodiment;
[0043] Figure 5 This is a block diagram of an audio playback device according to an exemplary embodiment;
[0044] Figure 6 This is a block diagram of an electronic device according to an exemplary embodiment.
[0045] In the picture:
[0046] 100 - First startup module; 200 - Determining module; 300 - Second startup module; 400 - Electronic device; 402 - Processing component; 404 - Memory; 406 - Power supply component; 408 - Multimedia component; 410 - Audio component; 412 - Input / output interface; 414 - Sensor component; 416 - Communication component; 420 - Processor. Detailed Implementation
[0047] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims. It should also be understood that the term “and / or” as used in this disclosure refers to and includes any or all possible combinations of one or more of the associated listed items.
[0048] With the development of wireless communication technology, audio devices can now connect wirelessly to electronic devices to play audio, greatly enhancing portability. For example, users can play music from their electronic devices using Bluetooth headsets or other similar devices, or make calls using them. During audio playback, users may connect an audio device to switch the electronic device's speaker to play audio from an application. Figure 1As shown, after the communication module of the audio device and the electronic device establishes a communication connection, the communication module successively sends a first broadcast reflecting a change in the connection state related to the audio device and a second broadcast reflecting a change in the activated device. Upon receiving the first broadcast, the application calls the interface in the audio module of the electronic device used to initiate Synchronous Connection Oriented (SCO) mode, causing the audio module to notify the communication module to initiate SCO mode to establish a link. Since the audio module does not receive the second broadcast, the audio device identifier, which indicates the existence of the audio device, remains a non-existent identifier. Because the audio device identifier is non-existent, the audio module does not notify the communication module to initiate SCO mode, causing the SCO mode initiation to fail, resulting in the application's audio continuing to play from the speaker. After the communication module sends the second broadcast, the audio module receives it and adjusts the audio device identifier to an existing identifier. Since the application does not call the audio module's interface again, the audio module does not notify the communication module to initiate SCO mode, causing the application's audio to continue playing from the speaker.
[0049] In related technologies, an audio playback method is provided where, in the event of a failure to initiate synchronous connection-oriented mode, the application calls the audio module's interface again after a certain period of time to re-initiate synchronous connection-oriented mode. During this period, the communication module sends a second broadcast, and the audio module, upon receiving the second broadcast, adjusts the audio device identifier to an existing identifier. Responding to the application's subsequent call instruction, and with the audio device identifier already present, the audio module notifies the communication module to initiate synchronous connection-oriented mode to establish a link. This method can reduce the duration of audio playback to some extent, preventing continuous audio playback from the speaker. However, for applications that do not support re-initiating synchronous connection-oriented mode, audio still plays from the speaker, resulting in the problem of audio playback issues in electronic devices.
[0050] To address the aforementioned technical issues, this disclosure provides an audio playback method that, when a preset connection mode fails to start but the target information meets the startup conditions, re-starts the preset connection mode to play audio from an application via an audio device. Since the preset connection mode can be automatically restarted without requiring application calls, audio playback from a speaker is avoided, thus solving the problem of external audio playback from electronic devices.
[0051] This disclosure provides an audio playback method, such as... Figure 2 As shown, the method includes:
[0052] S100: When an audio device is connected, the default connection mode is activated in response to the application's call command.
[0053] S200: In the event that the preset connection mode fails to start, determine the target information related to the audio device and the application.
[0054] S300. If the target information meets the startup conditions, restart the preset connection mode.
[0055] In the default connection mode, the application's audio is played by an audio device.
[0056] In this embodiment, when an audio device is connected, the application needs to play audio through the audio device. In response to the application's invocation command, a preset connection mode is initiated to allow the audio device to play audio within this mode. If the preset connection mode fails to initiate, the audio device cannot play audio, and target information related to the audio device and the application is determined. If the target information meets the initiation conditions, audio playback through the audio device is still required, and the preset connection mode is initiated again. By restarting the preset connection mode to allow the audio device to play audio when it fails to initiate, audio is prevented from being played from the electronic device's speaker, thus solving the problem of external audio playback from the electronic device.
[0057] For example, the application's invocation instruction can be an instruction for the application to invoke the interface of the audio module. The step S100 of activating the preset connection mode can be activating the preset connection mode on the communication module. The communication module can be a Bluetooth module, a Starlight module, etc.
[0058] For example, before the preset connection mode is successfully launched, the application's audio is played by the electronic device's speaker.
[0059] In one embodiment, the audio device is a Bluetooth audio device, and the preset connection mode is synchronous connection-oriented mode.
[0060] In this embodiment, since the Bluetooth audio device can be paired with a variety of electronic devices, the problem of external audio playback by various electronic devices can be solved by restarting the synchronous connection-oriented mode, thus improving the versatility of the audio playback method.
[0061] It is understandable that the audio device can be a Bluetooth audio device, or a StarFlash audio device, etc. The preset connection mode can be either synchronous connection-oriented mode or other connection modes used to establish a link.
[0062] In one embodiment, the application sends a call instruction upon receiving a first broadcast. In step S200, if the preset connection mode fails to start, the target information related to the audio device and the application can be determined in the following manner:
[0063] If the preset connection mode fails to start and a second broadcast is received, determine the target information.
[0064] The first and second broadcasts are delivered sequentially when the audio equipment is connected.
[0065] In this embodiment, since the first and second broadcasts are sent sequentially when the audio devices are connected, the application sends a call command upon receiving the first broadcast, but the audio module fails to receive the second broadcast, causing the preset connection mode to fail to start. To avoid frequent startups of the preset connection mode, when the preset connection mode fails to start but the second broadcast is received, target information is determined to restart the preset connection mode. By using the receipt of the second broadcast as the timing for restarting the preset connection mode, frequent and invalid startups of the preset connection mode are avoided, thereby improving the reliability of audio playback.
[0066] For example, the reason for the failure to start the preset connection mode in step S200 may be that the audio module does not notify the communication module to start the preset connection mode because it has not received the second broadcast, or the application cancels the playback of audio with the audio device, etc.
[0067] For example, upon receiving the first broadcast, the application calls the interface associated with the audio device to obtain information about the connected audio device. Having obtained the audio device information, it sends a call command to initiate a preset connection mode.
[0068] In one embodiment, the target information includes a startup identifier associated with the audio device. For example... Figure 3 As shown, the audio playback method also includes:
[0069] S400: Upon receiving a first broadcast, determine the connection status of the audio device in the first broadcast.
[0070] S410. When the connection status is "connected", set the startup flag to the first flag.
[0071] In this embodiment, since the first broadcast reflects whether the connection status of the audio device has changed, the connection status of the audio device in the first broadcast is determined upon receiving the first broadcast. If the connection status is "connected," there is a connected audio device and audio can be played through the audio device; therefore, the activation flag is set to the first flag. By adjusting the activation flag based on the first broadcast, it is possible to determine whether to restart the preset connection mode if the preset connection mode fails to start, thereby improving the reliability of audio playback.
[0072] For example, the audio module registers a broadcast upon startup and is able to listen to broadcasts to receive a first broadcast and a second broadcast.
[0073] For example, upon receiving a first broadcast, the information in the first broadcast reflecting whether the audio device is connected can be stored as a connected state.
[0074] For example, setting the startup identifier to the first identifier in step S410 can be performed if the startup fails in the preset connection mode, so as to avoid generating additional instructions.
[0075] In one embodiment, the target information further includes application information related to the application. The audio playback method also includes:
[0076] When the startup identifier is the first identifier, the application's communication mechanism information and identification information are stored in the application information.
[0077] In this embodiment, when the startup identifier is the first identifier, the audio device is in a connected state, and the application's audio can be played using the audio device. The application's communication mechanism information and identifier information are stored in the application information to store information about the application that needs to play audio. By storing the application information, it is possible to determine whether to restart the preset connection mode if the preset connection mode fails to start, thereby improving the reliability of audio playback.
[0078] For example, the identification information may include user identifier (UID), process identifier (PID), etc.
[0079] For example, storing the application's communication mechanism information and identification information in the application information in the above steps can be performed if the preset connection mode fails to start, so as to avoid generating additional instructions.
[0080] In one embodiment, the startup conditions include the startup identifier being a first identifier and the presence of communication mechanism information and identifier information in the application information.
[0081] In this embodiment, since the audio device is already connected and can be used to play audio when the startup identifier is the first identifier, the failure to start the preset connection mode is not due to the audio device not being connected, and the preset connection mode can be restarted. Because the application information contains communication mechanism information and identifier information, the application needs to play audio through the audio device, thus the preset connection mode can be restarted. By using the startup identifier as the first identifier and the presence of communication mechanism information and identifier information in the application information as startup conditions, the reliability of audio playback is improved by avoiding restarting the preset connection mode when audio playback is not required.
[0082] For example, if the startup conditions include the presence of communication mechanism information and identification information in the application information, the communication mechanism information and identification information can be verified to determine their validity. If the communication mechanism information and identification information are valid, the preset connection mode is restarted. If the communication mechanism information and identification information are invalid, the preset connection mode is not restarted.
[0083] In one embodiment, the audio playback method further includes:
[0084] In response to the application's deletion command, delete the communication mechanism information and identification information from the application information.
[0085] In this embodiment, since the user may or may not need to play the application's audio using an audio device, after the user performs an action that does not require playing the application's audio using an audio device, the application sends a deletion command to remove communication mechanism information and identification information from the application information to prevent the preset connection mode from being restarted. By deleting information from the application to prevent the audio device from playing audio, audio can be played in the way the user needs, thereby improving the reliability of audio playback.
[0086] In one embodiment, the audio playback method further includes:
[0087] Upon receiving a second broadcast, the audio device identifier is changed from the second identifier to the third identifier.
[0088] The second identifier is used to indicate that no audio device exists, and the third identifier is used to indicate that an audio device exists.
[0089] In this embodiment, if the second broadcast is not received, it cannot be determined whether the audio device is active, and the audio device identifier remains the second identifier to indicate that the audio device does not exist. If the second broadcast is received, it is determined that the audio device is active, and the audio device identifier is adjusted to the third identifier to indicate that the audio device exists. By adjusting the audio device identifier to indicate the existence of the audio device after receiving the second broadcast, the inability of the application to play audio is avoided, thereby improving the reliability of audio playback.
[0090] In one embodiment, the preset connection mode fails to start when the audio device identifier is the second identifier. The preset connection mode starts successfully when the audio device identifier is the third identifier.
[0091] In this embodiment, if the audio device identifier is the second identifier, no audio device exists and the preset connection mode is not initiated in the communication module, thus the preset connection mode cannot be successfully initiated. If the audio device identifier is the third identifier, an audio device exists and the preset connection mode is initiated in the communication module, thus the preset connection mode can be successfully initiated. By determining whether to initiate the preset connection mode in the communication module based on the audio device identifier, invalid links are avoided, preventing audio playback and thereby improving the reliability of audio playback.
[0092] For example, after determining the connection status of the audio device in the first broadcast in step S400, the audio playback method further includes:
[0093] If the connection status is not connected, set the startup flag to the fourth flag.
[0094] In one embodiment, in step S200, if the preset connection mode fails to start, determining the target information related to the audio device and the application can also be done in the following way:
[0095] If the preset connection mode fails to start and a preset time has elapsed, determine the target information.
[0096] In this embodiment, if the preset connection mode fails to start, the application's audio cannot be played via the audio device, and the preset connection mode needs to be restarted. After a preset time has elapsed, the cause of the preset connection mode failure may be eliminated, and the target information can be determined to restart the preset connection mode. By using a preset time as the timing for restarting the preset connection mode, timely restarting of the preset connection mode can be performed, thereby improving the reliability of audio playback.
[0097] For example, the preset time can range from 1s to 5s. The preset time can be 2s, 3s, 4s, etc.
[0098] For example, after determining the target information related to the audio device and application in step S200, the audio playback method further includes:
[0099] If the target information does not meet the startup conditions, the preset connection mode will not be started.
[0100] For example, if the preset connection mode fails to start, and the target information continues to meet the startup conditions, the preset connection mode will be restarted until the preset connection mode starts successfully.
[0101] This disclosure provides an audio playback method, such as... Figure 4 As shown, the method includes:
[0102] S500: Upon receiving the first broadcast, determine the connection status of the Bluetooth headset in the first broadcast.
[0103] S510, in response to the application's call command, initiates synchronous connection-oriented mode.
[0104] S520: If the synchronous connection-oriented mode fails to start, and the Bluetooth headset is already connected, then the startup flag is set to the first flag.
[0105] S530. When the startup identifier is the first identifier, the application's communication mechanism information and identifier information are stored in the application information.
[0106] S540. Upon receiving a second broadcast, the audio device identifier is changed from the second identifier to the third identifier.
[0107] S550, determine the startup identifier and application information.
[0108] S560. If the startup identifier is the first identifier and there is valid communication mechanism information and identifier information in the application information, restart the synchronous connection-oriented mode.
[0109] S570. If there is no valid communication mechanism information and identification information in the startup identifier (fourth identifier) and / or application information, the synchronous connection-oriented mode will not be started.
[0110] In this embodiment, when the Bluetooth headset is connected, the Bluetooth module sends a first broadcast and a second broadcast sequentially. Upon receiving the first broadcast, the connection status of the Bluetooth headset in the first broadcast is determined to ascertain whether the Bluetooth headset is connected. In response to the call command sent by the application under the first broadcast, a synchronous connection-oriented mode is initiated to play the application's audio through the Bluetooth headset. If the synchronous connection-oriented mode fails to start, and the Bluetooth headset is already connected, the start flag is set to the first flag. With the start flag set to the first flag, the application's communication mechanism information and identification information are stored in the application information to reflect that the application requires the Bluetooth headset to play audio. Upon receiving the second broadcast, the audio device flag is changed from the second flag to the third flag to confirm the presence of the Bluetooth headset, enabling the synchronous connection-oriented mode to start successfully. The start flag and application information are determined, and if the start flag is the first flag and valid communication mechanism information and identification information exist in the application information, the synchronous connection-oriented mode is restarted. If the start flag is the fourth flag and / or valid communication mechanism information and identification information do not exist in the application information, audio playback is not required from the Bluetooth headset, and the synchronous connection-oriented mode is not restarted. By restarting the synchronous connection-oriented mode in case of a failure to start the synchronous connection-oriented mode, the Bluetooth headset can play audio, thus preventing the audio from being played from the electronic device's speaker, thereby solving the problem of external audio playback from electronic devices.
[0111] In one exemplary embodiment, an audio playback device is provided for implementing the method described above. (Reference) Figure 5 As shown, the audio playback device may include a first startup module 100, a determination module 200, and a second startup module 300. During the implementation of the above method,
[0112] The first startup module 100 is configured to initiate a preset connection mode in response to a call command from an application when an audio device is connected.
[0113] The determination module 200 is configured to determine target information related to the audio device and application in the event that the preset connection mode fails to start.
[0114] The second startup module 300 is configured to restart the preset connection mode when the target information meets the startup conditions.
[0115] In the default connection mode, the application's audio is played by an audio device.
[0116] In one exemplary embodiment, an audio playback device is provided, wherein a determining module 200 is configured to:
[0117] If the preset connection mode fails to start and a second broadcast is received, determine the target information.
[0118] In one exemplary embodiment, an audio playback device is provided, wherein a determining module 200 is configured to:
[0119] Upon receiving the first broadcast, determine the connection status of the audio device in the first broadcast.
[0120] In one exemplary embodiment, an audio playback device is provided, the device further comprising:
[0121] The settings module is configured to set the startup flag to the first flag when the connection status is connected.
[0122] In one exemplary embodiment, an audio playback device is provided, the device further comprising:
[0123] The storage module is configured to store application communication mechanism information and identification information in the application information when the startup identifier is the first identifier.
[0124] In one exemplary embodiment, an audio playback device is provided, the device further comprising:
[0125] The deletion module is configured to delete communication mechanism information and identification information from the application information in response to a deletion command from the application.
[0126] In one exemplary embodiment, an audio playback device is provided, wherein a setting module is configured to:
[0127] Upon receiving a second broadcast, the audio device identifier is changed from the second identifier to the third identifier.
[0128] In one exemplary embodiment, an audio playback device is provided, wherein a determining module 200 is configured to:
[0129] If the preset connection mode fails to start and a preset time has elapsed, determine the target information.
[0130] In one exemplary embodiment, an electronic device is provided, such as a mobile phone, a laptop computer, a tablet computer, and a wearable device.
[0131] refer to Figure 6As shown, the electronic device 400 may include one or more of the following components: processing component 402, memory 404, power supply component 406, multimedia component 408, audio component 410, input / output (I / O) interface 412, sensor component 414, and communication component 416.
[0132] Processing component 402 typically controls the overall operation of electronic device 400, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 402 may include one or more processors 420 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 402 may include one or more modules to facilitate interaction between processing component 402 and other components. For example, processing component 402 may include a multimedia module to facilitate interaction between multimedia component 408 and processing component 402.
[0133] Memory 404 is configured to store various types of data to support the operation of electronic device 400. Examples of this data include instructions for any application or method operating on electronic device 400, contact data, phonebook data, messages, pictures, videos, etc. Memory 404 can be implemented by any type of volatile or non-volatile storage terminal or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0134] Power supply component 406 provides power to various components of electronic device 400. Power supply component 406 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 400.
[0135] Multimedia component 408 includes a screen that provides an output interface between electronic device 400 and user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 408 includes a front-facing camera module and / or a rear-facing camera module. When electronic device 400 is in an operating mode, such as shooting mode or video mode, the front-facing camera module and / or rear-facing camera module may receive external multimedia data. Each front-facing camera module and rear-facing camera module may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0136] Audio component 410 is configured to output and / or input audio signals. For example, audio component 410 includes a microphone (MIC) configured to receive external audio signals when electronic device 400 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 404 or transmitted via communication component 416. In some embodiments, audio component 410 also includes a speaker for outputting audio signals.
[0137] I / O interface 412 provides an interface between processing component 402 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0138] Sensor assembly 414 includes one or more sensors for providing state assessments of various aspects of electronic device 400. For example, sensor assembly 414 may detect the on / off state of electronic device 400, the relative positioning of components such as the display and keypad of electronic device 400, changes in position of electronic device 400 or a component of electronic device 400, the presence or absence of user contact with electronic device 400, orientation or acceleration / deceleration of electronic device 400, and temperature changes of electronic device 400. Sensor assembly 414 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 414 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 414 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.
[0139] Communication component 416 is configured to facilitate wired or wireless communication between electronic device 400 and other terminals. Electronic device 400 can access wireless networks based on communication standards, such as WiFi, 2G, 3G, 4G, 5G, or combinations thereof. In one exemplary embodiment, communication component 416 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 416 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0140] In an exemplary embodiment, the electronic device 400 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing terminals (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods shown in the above embodiments or combinations thereof.
[0141] In one exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 404 including instructions, which can be executed by a processor 420 of an electronic device 400 to perform the methods shown in the embodiments or combinations thereof. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage terminal, etc. When the instructions in the storage medium are executed by the processor of the terminal, the terminal is able to perform the methods shown in the embodiments or combinations thereof.
[0142] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.
[0143] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this disclosure. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0144] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this disclosure, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0145] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0146] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. An audio playback method, characterized by, The audio playing method comprises: In the case of audio device connection, starting a preset connection mode in response to a calling instruction of an application program; In the case of failure of starting the preset connection mode, determining target information related to the audio device and the application program; In the case that the target information meets a starting condition, starting the preset connection mode again; Wherein, in the preset connection mode, audio of the application program is played by the audio device.
2. The audio playback method of claim 1, wherein, The application program sends the calling instruction in the case of receiving a first broadcast; The case of failure of starting the preset connection mode, the determining target information related to the audio device and the application program comprises: In the case of failure of starting the preset connection mode and receiving a second broadcast, determining the target information; Wherein, the first broadcast and the second broadcast are emitted in sequence in the case of audio device connection.
3. The audio playback method of claim 2, wherein, The target information comprises a starting identifier related to the audio device; the audio playing method further comprises: In the case of receiving the first broadcast, determining a connection state of the audio device in the first broadcast; In the case that the connection state is a connected state, setting the starting identifier as a first identifier.
4. The audio playback method of claim 3, wherein, The target information further comprises application information related to the application program; the audio playing method further comprises: In the case that the starting identifier is the first identifier, storing communication mechanism information and identifier information of the application program in the application information.
5. The audio playback method of claim 4, wherein, The starting condition comprises that the starting identifier is the first identifier and the communication mechanism information and the identifier information exist in the application information.
6. The audio playback method of claim 4, wherein, The audio playing method further comprises: In response to a deleting instruction of the application program, deleting the communication mechanism information and the identifier information in the application information.
7. The audio playback method of claim 2, wherein, The audio playing method further comprises: In the case of receiving the second broadcast, adjusting an audio device identifier from a second identifier to a third identifier; Wherein, the second identifier is used to represent that the audio device does not exist, and the third identifier is used to represent that the audio device exists.
8. The audio playback method of claim 7, wherein, In the case that the audio device identifier is the second identifier, the preset connection mode cannot be successfully started; in the case that the audio device identifier is the third identifier, the preset connection mode can be successfully started.
9. The audio playing method of any one of claims 1-8, wherein, The audio device is a Bluetooth audio device, and the preset connection mode is a synchronous connection-oriented mode.
10. An audio playback device, characterized by The audio playing device comprises: A first starting module configured to start a preset connection mode in response to a calling instruction of an application program in the case of audio device connection; A determining module configured to determine target information related to the audio device and the application program in the case of failure of starting the preset connection mode; A second starting module configured to start the preset connection mode again in the case that the target information meets a starting condition; Wherein, in the preset connection mode, audio of the application program is played by the audio device.
11. An electronic device, comprising: The electronic device comprises: A processor; a memory for storing the processor-executable instructions; wherein the processor is configured to perform the audio playing method according to any one of claims 1 to 9.
12. A non-transitory computer-readable storage medium, comprising: The storage medium, when the instructions in the storage medium are executed by a processor of a terminal, enables the terminal to perform the audio playing method according to any one of claims 1 to 9.