CN113709691B - Audio data playing method, device, equipment and storage medium - Google Patents

Audio data playing method, device, equipment and storage medium Download PDF

Info

Publication number
CN113709691B
CN113709691B CN202010425549.0A CN202010425549A CN113709691B CN 113709691 B CN113709691 B CN 113709691B CN 202010425549 A CN202010425549 A CN 202010425549A CN 113709691 B CN113709691 B CN 113709691B
Authority
CN
China
Prior art keywords
audio
channel
playing
user terminal
speaker
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010425549.0A
Other languages
Chinese (zh)
Other versions
CN113709691A (en
Inventor
杨超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202010425549.0A priority Critical patent/CN113709691B/en
Publication of CN113709691A publication Critical patent/CN113709691A/en
Application granted granted Critical
Publication of CN113709691B publication Critical patent/CN113709691B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/30Services specially adapted for particular environments, situations or purposes
    • H04W4/40Services specially adapted for particular environments, situations or purposes for vehicles, e.g. vehicle-to-pedestrians [V2P]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup

Abstract

The application discloses a playing method, device and equipment of audio data and a storage medium, and relates to the technical field of voice. The method is applied to the user terminal, and the specific implementation scheme is as follows: if a local audio playing event of an application program in the user terminal is monitored in the process that the user terminal and the vehicle-mounted terminal are in Bluetooth connection, switching from a Bluetooth channel to a loudspeaker channel; setting an audio mode of an audio manager of the user terminal to a call mode; and playing the audio of the application program through the speaker channel. According to the method and the device for playing the audio, the problem of abnormal audio playing caused by mutual conflict of audio to be played by the vehicle-mounted terminal can be solved, and a new thought is provided for audio data playing in the process that the user terminal is connected with the vehicle-mounted Bluetooth.

Description

Audio data playing method, device, equipment and storage medium
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a voice technology.
Background
With the development of bluetooth networking technology, when a user drives a vehicle, the user terminal can be selectively connected with the vehicle-mounted terminal by bluetooth, and then voice data transmitted by the user terminal, such as talking voice, songs, navigation guidance information and the like, are played through the vehicle-mounted bluetooth. However, during actual vehicle driving, there may be a problem of abnormal audio playback caused by the mutual conflict of audio to be played by the vehicle-mounted terminal, and improvement is needed.
Disclosure of Invention
Provided are a method, apparatus, device and storage medium for playing audio data.
According to a first aspect, there is provided a method for playing audio data, applied to a user terminal, the method comprising:
if a local audio playing event of an application program in the user terminal is monitored in the process that the user terminal and the vehicle-mounted terminal are in Bluetooth connection, switching from a Bluetooth channel to a loudspeaker channel;
setting an audio mode of an audio manager of the user terminal to a call mode;
and playing the audio of the application program through the speaker channel.
According to a second aspect, there is provided an apparatus for playing audio data, configured in a user terminal, the apparatus comprising:
the channel switching module is used for switching from a Bluetooth channel to a loudspeaker channel if a local audio playing event of an application program in the user terminal is monitored in the process that the user terminal and the vehicle-mounted terminal are in Bluetooth connection;
an audio mode setting module, configured to set an audio mode of an audio manager of the user terminal to a call mode;
and the audio playing module is used for playing the audio of the application program through the loudspeaker channel.
According to a third aspect, there is provided an electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of playing audio data according to any one of the embodiments of the present application.
According to a fourth aspect, a non-transitory computer readable storage medium storing computer instructions is provided. The computer instructions are configured to cause the computer to execute the method for playing audio data according to any embodiment of the present application.
According to the technology, the problem of abnormal audio playing caused by mutual conflict of audio to be played by the vehicle-mounted terminal is solved, and a new thought is provided for audio data playing in the process of connecting the vehicle-mounted Bluetooth with the user terminal.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for better understanding of the present solution and do not constitute a limitation of the present application. Wherein:
fig. 1 is a flowchart of a method for playing audio data according to an embodiment of the present application;
fig. 2A is a flowchart of another audio data playing method according to an embodiment of the present application;
FIGS. 2B-2D are interface diagrams of setup functions of a navigation application provided in accordance with embodiments of the present application;
fig. 3 is a flowchart of another audio data playing method according to an embodiment of the present application;
fig. 4 is a flowchart of another audio data playing method according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an audio data playing device according to an embodiment of the present application;
fig. 6 is a block diagram of an electronic device for implementing a method for playing audio data according to an embodiment of the present application.
Detailed Description
Exemplary embodiments of the present application are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present application to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a flowchart of a method for playing audio data according to an embodiment of the present application. The embodiment is suitable for the situation of how to play the audio data of the application program in the user terminal in the Bluetooth connection process of the user terminal and the vehicle-mounted terminal. The embodiment may be performed by a user terminal, in particular by a playback device of audio data configured in the user terminal, which device may be implemented in software and/or hardware. The user terminal may be an electronic device with bluetooth connection function, such as a smart phone, a tablet computer, a wearable device, etc. As shown in fig. 1, the method includes:
s101, if a local audio playing event of an application program in the user terminal is monitored in the process that the user terminal and the vehicle-mounted terminal are in Bluetooth connection, switching from a Bluetooth channel to a loudspeaker channel.
In this embodiment of the present application, the application program in the user terminal may be an application program installed on the user terminal and capable of playing audio, for example, may be a music application program, a video application program, a navigation application program, and the like. Alternatively, the application program in the embodiment of the present application may be all application programs installed in the user terminal and capable of playing audio, and may also be one or more target application programs specified from all application programs capable of playing audio. This embodiment is not limited. The local audio playing event of the application program may be an event triggered when the user terminal needs to locally play the audio of the application program in the process that the user terminal maintains bluetooth connection with the vehicle-mounted terminal.
Optionally, in this embodiment, the execution manner of detecting the local audio play event of the application program in the user terminal may be: in the process that the user terminal is connected with the Bluetooth of the vehicle-mounted terminal, a voice broadcasting function of the application program is started, and the vehicle-mounted terminal has audio being broadcast at the moment, so that a local audio broadcasting event of the application program can be triggered and monitored. For example, in the process of connecting the user terminal and the vehicle-mounted terminal through bluetooth, a navigation broadcasting function of the navigation application program is started, and the vehicle-mounted terminal is broadcasting a radio station at the moment, and in the scene, a local audio broadcasting event of the navigation application program can be triggered and monitored. The method can also be that the voice broadcasting function of the application program is started in the Bluetooth connection process of the user terminal and the vehicle-mounted terminal, and the fact that the user selects a loudspeaker to play in the playing configuration item is monitored, and at the moment, a local audio playing event of the application program is triggered and monitored. For example, in the process of connecting the user terminal and the vehicle-mounted terminal through Bluetooth, a navigation broadcasting function of the navigation application program is started, and a user starts a speaker broadcasting configuration item in a configuration item of the navigation application program in advance or when starting navigation, and in the scene, a local audio broadcasting event of the navigation application program can be triggered and monitored.
The speaker channel in the embodiment of the present application may be a channel for amplifying audio data locally and outwards by the user terminal. The bluetooth channel may be a channel through which the user terminal transmits data to the vehicle-mounted terminal after the user terminal is connected with the vehicle-mounted terminal via bluetooth. The bluetooth channels may include synchronous channels (Synchronous Connection Oriented, SCO) and asynchronous channels (Asynchronous Connectionless, ACL). It should be noted that, for the call audio (such as audio in the process of making a call) of the user terminal, the call audio is generally transmitted to the vehicle-mounted terminal through a synchronization channel for playing; for application audio (e.g., songs, navigation guidance information, etc.) of the user terminal, both channels (i.e., synchronous channel and asynchronous channel) may be transmitted to the vehicle terminal for playback.
Optionally, in the process that the user terminal and the vehicle-mounted terminal maintain bluetooth connection, if a local audio playing event of an application program in the user terminal is monitored, the embodiment of the application program may switch from a bluetooth channel to a speaker channel. Specifically, if the synchronous channel of the bluetooth channel is used in the process of maintaining the bluetooth connection between the current user terminal and the vehicle-mounted terminal, the synchronous channel of the bluetooth channel can be switched to the speaker channel at the moment; if the asynchronous channel of the Bluetooth channel is used in the process of keeping the Bluetooth connection between the current user terminal and the vehicle-mounted terminal, the asynchronous channel of the Bluetooth channel can be switched to the loudspeaker channel at the moment. When the synchronous channel of the Bluetooth channel is switched to the speaker channel, the synchronous channel is closed, the speaker channel is ensured to be in an open state, and at the moment, the synchronous channel of the Bluetooth channel can be switched to the speaker channel. When the asynchronous channel of the Bluetooth channel is switched to the loudspeaker channel, the asynchronous channel is in a normally open state, so that the asynchronous channel of the Bluetooth channel can be switched to the loudspeaker channel only by ensuring that the loudspeaker channel is in an open state. It should be noted that, a specific setting method for switching from a bluetooth channel to a speaker channel will be described in detail in the following embodiments.
S102, setting the audio mode of the audio manager of the user terminal as a call mode.
The audio manager may be a tool in the user terminal that can set audio related parameters, and the operation is to set an audio mode in the audio manager. Optionally, the audio modes in the audio manager may include: normal mode and talk mode.
Optionally, in the process that the user terminal and the vehicle-mounted terminal keep bluetooth connection, the user terminal system automatically sets the audio mode of the audio manager to a common mode, and when an application program of the user terminal is to play audio (such as songs, navigation guidance information and the like), the audio is transmitted to the vehicle-mounted terminal through an asynchronous channel of a bluetooth channel by default for playing; when a call event (such as telephone access) occurs, the user terminal system automatically sets the audio mode of the audio manager to be a call mode, and opens the synchronous channel of the Bluetooth channel, and at the moment, call audio is transmitted to the vehicle-mounted terminal for playing by default through the synchronous channel. In the process that the user terminal and the vehicle-mounted terminal keep Bluetooth connection, the local audio playing event is monitored and is not a call event, so that the user terminal system cannot default to automatically set an audio mode to be a call mode and also cannot default to automatically start a synchronous channel of a Bluetooth channel. So after S101 switches from the bluetooth channel to the speaker channel, playing the audio of the application program through the speaker channel of the user terminal still cannot be realized, and the audio mode of the audio manager needs to be set to the call mode by active triggering.
Optionally, the call mode further includes a telephone mode and a communication mode. Specifically, IN this embodiment, when setting the Audio Mode (Audio Mode) of the Audio Manager (Audio Manager) of the user terminal to the CALL Mode, it may be determined whether the interface version number (Android API) of the user terminal is smaller than a preset version number (e.g. 21), if so, the Audio Mode of the Audio Manager of the user terminal is set to be the phone Mode (mode_in_call), and if so, the Audio Mode of the Audio Manager of the user terminal is set to be the COMMUNICATION Mode (mode_in_communication).
S103, playing the audio of the application program through the speaker channel.
The audio of the application program may be audio data to be played by the application program, for example, when the application program is a navigation application program, the audio of the application program may be navigation induction information, that is, navigation voice played in a navigation process for guiding a user to travel.
Optionally, in the whole operation process of the embodiment of the present application, the user terminal and the vehicle bluetooth are always connected, S102 also sets the audio mode of the audio manager of the user terminal to a call mode, at this time, because the asynchronous channel of the bluetooth channel cannot play the audio of the application program in the call mode, and no call event triggers the synchronous channel of the bluetooth channel to start, at this time, the bluetooth channel cannot play the audio of the application program, and the user terminal can only play the audio of the application program through the speaker. Therefore, when a user drives the vehicle, the audio of the application program is played through the loudspeaker of the user terminal under the condition that the Bluetooth connection with the vehicle-mounted terminal is not disconnected, and the vehicle-mounted audio is played through the vehicle-mounted terminal. The situation that the vehicle-mounted audio frequency and the application program audio frequency conflict under the condition that the user terminal is connected with the vehicle-mounted Bluetooth is avoided, and the connection between the user terminal and the vehicle-mounted Bluetooth is not disconnected in the whole process, so that when a telephone is accessed, the user terminal can still answer through the vehicle-mounted equipment, and the driving safety is considered. Optionally, the application program of the user terminal in the embodiment of the present application is preferably a navigation application program, and audio of the application program is navigation guidance information. Therefore, the vehicle-mounted music (such as radio broadcasting) is listened to through the vehicle-mounted terminal, and the navigation induction information is listened to through the loudspeaker of the user terminal.
According to the technical scheme, in the process that the user terminal and the vehicle-mounted terminal are in Bluetooth connection, if a local audio playing event of an application program is monitored, a Bluetooth channel is switched to a speaker channel, an audio mode of an audio manager is set to be a call mode, and then audio of the application program is played through a speaker. According to the scheme, in the process that the Bluetooth connection process of the user terminal and the vehicle-mounted terminal is always kept, the speaker can play the audio of the application program, the vehicle-mounted terminal is supported to play the vehicle-mounted audio, the problem that the vehicle-mounted terminal simultaneously plays the vehicle-mounted audio and the audio of the application program conflicts when the user terminal is connected with the Bluetooth connection process of the vehicle-mounted terminal is solved, and a new idea is provided for audio data playing in the process that the user terminal is connected with the Bluetooth connection process of the vehicle-mounted terminal.
Further, in the embodiment of the present application, after switching from the bluetooth channel to the speaker channel, the method may further include: and setting the audio stream type of the media player of the user terminal as a music type. Among these, there are many types of audio streams (stem Type), which may include, for example, a call voice Type, a system alert Type, a bell sound Type, a music Type, and the like. When the audio volume control device is set to be of a certain type, the audio volume control device is only used for adjusting the audio volume of the certain type, and the influence on the audio volume of other types can be avoided. Alternatively, since the audio of the application belongs to the music playing sound, the present embodiment may set the audio stream type of the media player to the music type, for example, when the application is a navigation application, the audio stream type of the application is set to the music type for the navigation guidance information in the form of voice converted from the navigation guidance information in the form of text, which has the advantage that the user can flexibly control the size of the audio playing volume of the application through the volume adjustment key of the user terminal.
Further, in the embodiment of the present application, after switching from the bluetooth channel to the speaker channel, the method may further include: and if the speaker of the user terminal is detected to be closed, opening the speaker. Specifically, in order to avoid the situation that the speaker is turned off due to the failure of the user terminal system or software, it is ensured that after the bluetooth channel is switched to the speaker channel, the speaker of the user terminal can normally play the audio of the application program, that is, the user terminal monitors whether the speaker is turned off, and if so, the speaker is turned on from the audio manager, thereby ensuring that the audio of the application program can be normally played through the speaker.
Fig. 2A is a flowchart of another audio data playing method according to an embodiment of the present application; fig. 2B-2D are interface diagrams of a setup function of a navigation application provided according to an embodiment of the present application. The embodiment further optimizes the above embodiments, and gives a specific description of how to generate a local audio playback event of an application program in a user terminal, as shown in fig. 2A-2D, and the method includes:
s201, monitoring whether a speaker playing configuration item of the user terminal is in an on state or not when the user terminal and the vehicle-mounted terminal are in Bluetooth connection, and after a voice broadcasting function of an application program is started, and generating a local audio playing event according to a monitoring result.
The voice broadcast function of the application program may be a function of playing audio by the application program, for example, when the application program is a navigation application program, the navigation function is a voice broadcast function thereof.
Optionally, in an embodiment of the present application, a play channel configuration option is provided on a configuration interface of the application, where the play channel configuration option includes: speaker play configuration item, synchronous channel play configuration item and asynchronous channel play configuration item of bluetooth channel. For example, as shown in fig. 2B, which shows an effect schematic diagram of an auxiliary function setting interface of a navigation application, the bluetooth connection setting option in fig. 2B is a play channel configuration option, and the bluetooth device in the option broadcasts (recommends) an asynchronous channel play configuration item of a bluetooth channel; the Bluetooth equipment broadcasts (selectable when broadcasting silence) a synchronous channel play configuration item which is a Bluetooth channel; and broadcasting the speaker of the mobile phone to obtain a speaker playing configuration item. Optionally, the speaker play configuration item of the user terminal may be preset by the user in a setting page (such as the interface shown in fig. 2B) of the application client; the setting may also be set by the user in a setting option in the playing audio interface, for example, clicking on the "more settings" option in the navigation interface of the navigation application program shown in fig. 2C may also enter a setting interface (such as the interface shown in fig. 2D), where fig. 2D is similar to fig. 2B, and there is a bluetooth connection setting option.
Optionally, in this embodiment, when the user terminal monitors that the voice broadcast function of the application program is started in the process of maintaining the bluetooth connection between the user terminal and the vehicle-mounted device, whether the user selects a speaker play configuration item in advance in a setting page (an interface shown in fig. 2B) of the application program needs to be further monitored, and if so, the monitoring result is that the speaker play configuration item is in an on state. If the asynchronous channel playing configuration item or the synchronous channel playing configuration item is selected in advance in the setting page of the application program by the user, the monitoring result is that the loudspeaker playing configuration item is in a closed state. The embodiment includes the following two cases when generating an audio play event according to the monitoring result:
in the first case, if the speaker playing configuration item is in an on state, a local audio playing event is generated. Specifically, in this case, if the user terminal monitors that the user has preselected the speaker playing configuration item in the setting interface (such as the interface shown in fig. 2B) of the application program, the speaker playing configuration item is already in an on state due to the presettings, which indicates that the user's requirement is that the audio of the application program is selected to be played through the speaker under the condition that the user terminal is connected with the bluetooth of the vehicle-mounted terminal. At this point a local audio play event may be touched.
And secondly, if the speaker playing configuration item is in a closed state, responding to the switching operation of the speaker playing configuration item on the operation interface of the application program by a user, starting the speaker playing configuration item, and generating a local audio playing event. Specifically, in this case, if the user terminal monitors that the user does not select the speaker playing configuration item in the setting interface (such as the interface shown in fig. 2B) of the application program, the speaker playing configuration item is in a closed state at this time, which indicates that the user needs to select to play the audio of the application program through the vehicle-mounted terminal under the condition that the user terminal is connected with the vehicle-mounted terminal through bluetooth. The user terminal needs to play the audio of the application program at the vehicle-mounted terminal according to the play configuration item selected by the user at this time. In the audio playing process of the application program, if the switching operation of the loudspeaker playing configuration item triggered by the user on the operation interface of the application program, namely the operation interface of the voice broadcasting function of the application program, the switching operation of the loudspeaker playing configuration item is responded, the loudspeaker configuration item is started, and then a local audio playing event occurs in a touching mode.
For example, in the navigation process, the user clicks more setting keys on the navigation interface shown in fig. 2C, and after entering the more setting operation interface shown in fig. 2D, clicks the speaker play option of the mobile phone, at this time, the user terminal responds to the switching operation of clicking the speaker play option of the mobile phone by the user, opens the speaker play configuration item, and generates a local audio play event.
S202, if a local audio playing event of an application program in the user terminal is monitored, switching from a Bluetooth channel to a loudspeaker channel.
S203, setting the audio mode of the audio manager of the user terminal as a call mode.
S204, playing the audio of the application program through the speaker channel.
According to the technical scheme, in the process that the Bluetooth connection is kept between the user terminal and the vehicle-mounted terminal, after the voice broadcasting function of the application program is started, whether the loudspeaker playing configuration of the user terminal is in an on state or not is monitored, a local audio playing event is generated according to the monitoring result, after the local audio playing event of the application program is monitored, a Bluetooth channel is switched to a loudspeaker channel, an audio mode of an audio manager is set to be a call mode, and then application program audio is played through a loudspeaker. According to the scheme of the embodiment, whether the local audio playing event occurs is determined according to whether the broadcasting function of the application program and the loudspeaker playing configuration item are started or not, a user can select whether to start the loudspeaker playing configuration item or not according to own requirements, personalized requirements of the user can be better met, and whether to switch to a mobile phone loudspeaker channel to play the audio of the application program or not is selected according to actual requirements of the user. In addition, when the user selects whether to start the speaker playing configuration item, the speaker playing configuration item can be selected in advance, or can be selected in real time after the voice broadcasting function is started, so that the flexibility is higher. A new idea is provided for playing audio data in the process of connecting the user terminal with the vehicle-mounted Bluetooth.
Fig. 3 is a flowchart of another audio data playing method according to an embodiment of the present application. The embodiment is further optimized based on the above embodiments, and provides an introduction of how to answer the incoming call in the process of playing the audio of the application program through the speaker. As shown in fig. 3, the method includes:
s301, if a local audio playing event of an application program in the user terminal is monitored in the process that the user terminal and the vehicle-mounted terminal are in Bluetooth connection, switching from a Bluetooth channel to a loudspeaker channel.
S302, setting the audio mode of the audio manager of the user terminal as a call mode.
And S303, playing the audio of the application program through the speaker channel.
And S304, if the call event of the user terminal is monitored, stopping playing the audio of the application program.
The call event may be an event triggered and generated when the user terminal has a phone access.
Optionally, in the embodiment of the present application, if a call event of the user terminal is monitored during the process that the user terminal plays the audio of the application through the speaker, that is, when the user terminal has a phone access, in order to prevent a play conflict between the audio of the application and the phone audio, the audio of the application may be stopped, and a service of answering the phone is preferentially provided for the user.
S305, switching from the speaker channel to the synchronization channel of the bluetooth channel.
Optionally, in the process of executing the above S301-S303, although the audio of the application program is played through the speaker of the user terminal, the bluetooth connection between the user terminal and the vehicle-mounted terminal is not disconnected, and in this case, in order to ensure the driving safety of the vehicle, the embodiment should preferably provide a service of answering the call for the user through the synchronization channel of the bluetooth channel of the vehicle terminal. Since the user terminal plays audio through the speaker before the call event of the user terminal is monitored, the speaker channel of the user terminal is switched to the synchronous channel of the bluetooth channel at this time. Since the audio mode of the audio manager is set to the talk mode before the audio of the application program is played through the speaker channel and the required audio mode is also the talk mode when the talk audio is played through the synchronization channel in this embodiment, the audio mode may not be set at this time, or the operation of setting the audio mode of the audio manager of the user terminal to the talk mode may be performed again in order to ensure the accuracy of the audio mode.
Optionally, since the synchronization channel of the bluetooth channel of the user terminal is in a closed state during the audio playing process of the application program through the speaker channel, when the speaker channel is to be switched to the synchronization channel of the bluetooth channel, it is required to detect whether the user terminal supports the synchronization channel of the bluetooth channel, if so, the synchronization channel of the bluetooth channel is opened, and then the switching of the speaker channel to the synchronization channel of the bluetooth channel is performed.
Alternatively, when switching from the speaker channel to the synchronous channel of the bluetooth channel, the speaker of the user terminal may be turned on if the speaker is detected to be turned off. To avoid the situation that the speaker is turned off due to the malfunction of the user terminal or the application program. The loudspeaker of the user terminal is ensured to be in a normally-open state.
S306, transmitting the call audio of the user terminal to the vehicle-mounted terminal for playing through the synchronous channel.
Optionally, after the speaker channel is switched to the synchronization channel of the bluetooth channel, the current call audio of the user terminal can be sent to the vehicle-mounted terminal through the synchronization channel because the audio mode of the audio manager is also a call mode at this time, so that the vehicle-mounted terminal plays the call audio, and a call service is provided for the user.
Optionally, the user terminal in this embodiment may further monitor whether the call is finished in real time during the call passing, and if the call is finished and the voice broadcast of the application program is not finished yet, switch from the synchronization channel of the bluetooth channel to the speaker channel, and continue playing the audio of the application program through the speaker channel. The specific implementation process of switching from the synchronous channel of the bluetooth channel back to the speaker channel will be described in detail in the following embodiments.
According to the technical scheme, in the process that the user terminal and the vehicle-mounted terminal are in Bluetooth connection, if a local audio playing event of an application program is monitored, a Bluetooth channel is switched to a speaker channel, an audio mode of an audio manager is set to be a call mode, and then audio of the application program is played through a speaker. If the call event is detected when the audio of the application program is played, the audio of the application program is stopped being played, the loudspeaker channel is switched to the synchronous channel of the Bluetooth channel, and the call audio is played at the vehicle-mounted terminal through the synchronous channel. According to the scheme, after the local play event of the application program is monitored, although the audio of the application program is played locally at the user terminal through the loudspeaker, bluetooth connection between the user terminal and the vehicle-mounted terminal is not disconnected, when a call event is monitored, the synchronous channel of the Bluetooth channel is still automatically switched, and a call is answered through the vehicle-mounted device, so that the problem that the vehicle-mounted audio and the audio of the application program are in conflict when the vehicle-mounted terminal is simultaneously played under the condition that the user terminal is connected with the Bluetooth of the vehicle-mounted terminal is solved, and driving safety is also considered.
Preferably, in this embodiment, when switching from the speaker channel to the synchronization channel of the bluetooth channel, if the user terminal supports the synchronization channel of the bluetooth channel, the monitoring process is registered; setting the audio connection state of the synchronous channel of the audio manager to be on; if the audio connection state of the synchronous channel is monitored to be on through the monitoring process, setting the synchronous channel of the audio manager to be on; switching from a speaker channel to the synchronization channel. Specifically, a process broadcasted by the monitoring system may be registered first, and the process is used for monitoring whether the audio connection state of the synchronization channel is updated, such as whether the audio connection state is updated from a closed state to an open state. The audio connection state of the synchronization channel of the audio manager is then set to on. If the starting is successful, the process broadcasted by the monitoring system registered before monitors that the audio connection state of the synchronous channel is updated to be started, at the moment, the synchronous channel of the audio manager is set to be in the starting state, and then the synchronous channel is switched from the loudspeaker channel to the synchronous channel. The advantage of this arrangement is that it is possible to avoid that the synchronization channel in the closed state is erroneously set to the open state when the audio connection state of the synchronization channel of the audio manager fails to open. The situation that the call voice is played silently occurs, so that the call quality of answering the call through the vehicle-mounted terminal is ensured.
Fig. 4 is a flowchart of another audio data playing method according to an embodiment of the present application. The embodiment is further optimized based on the above embodiments, and an introduction of how to operate after the audio of the application program is played through the speaker is given. As shown in fig. 4, the method includes:
s401, if a local audio playing event of an application program in the user terminal is monitored in the process that the user terminal and the vehicle-mounted terminal are in Bluetooth connection, switching from a Bluetooth channel to a loudspeaker channel.
S402, setting the audio mode of the audio manager of the user terminal as a call mode.
S403, playing the audio of the application program through a speaker channel.
S404, if the audio playing end event of the application program is monitored, switching from the speaker channel to the asynchronous channel of the Bluetooth channel, and setting the audio mode of the audio manager to the normal mode.
The audio play end event of the application program may be an event triggered and generated when the application program exits, or may be an event triggered and generated when the audio play function of the application program is closed, for example, if the application program is a navigation application program, the audio play end event of the navigation application program may be triggered and generated when the navigation application program is closed; it is also possible to generate an audio play end event of the navigation application after each navigation end.
Optionally, when the user terminal is connected with the vehicle-mounted terminal by bluetooth, the user terminal system defaults to automatically open an asynchronous channel of the bluetooth channel, and when a call event is monitored, the system defaults to automatically open a synchronous channel. Therefore, when the audio playing end event of the application program is monitored, the embodiment needs to switch the speaker channel to the asynchronous channel which is normally opened by default, and the audio mode of the audio manager is set to the normal mode at this time because the asynchronous channel needs to play the audio data of the normal mode.
Alternatively, when the speaker channel is switched to the asynchronous channel, the audio stream type of the media player of the user terminal may be set to the music type. So that when the audio is played through the asynchronous channel later, the user can flexibly control the volume of the audio playing through the volume adjusting key of the user terminal. Alternatively, the speaker may be turned on if it is detected that the speaker of the user terminal is turned off. To avoid the situation that the speaker is turned off due to the malfunction of the user terminal or the application program. The loudspeaker of the user terminal is ensured to be in a normally-open state.
According to the technical scheme, in the process that the user terminal and the vehicle-mounted terminal are in Bluetooth connection, if a local audio playing event of an application program is monitored, a Bluetooth channel is switched to a speaker channel, an audio mode of an audio manager is set to be a call mode, and then audio of the application program is played through a speaker. Upon monitoring an audio playback end event of the application, switching from the speaker channel to the asynchronous channel of the bluetooth channel and setting the audio mode of the audio manager to the normal mode. When detecting a local audio playing event of an application program, the scheme of the embodiment switches to a loudspeaker to play the audio of the application program; after the audio playing is finished, the conventional Bluetooth asynchronous channel is restored. The method and the device can realize the flexible switching of the playing channel according to the user requirements in the Bluetooth connection process of the user terminal and the vehicle-mounted terminal, and provide a new idea for playing the audio data of the user terminal.
The present embodiment provides a description of a specific setting manner of the bluetooth channel and the speaker channel during switching based on the foregoing embodiments. Specifically, in this embodiment, the user terminal is taken as an Android (Android) system as an example to be described:
the asynchronous channel of the first scene and the Bluetooth channel is switched to the scene of the loudspeaker channel. The specific switching setting mode comprises the following three steps:
1) The audio mode of the audio manager of the user terminal is set to a talk mode. Specifically, it is determined whether the interface version number (Android API) of the user terminal is smaller than a preset version number (e.g., 21), if the interface version number is smaller than the preset version number, the audio MODE of the audio manager of the user terminal is set to be a phone MODE (mode_in_call), and if the interface version number is greater than or equal to the preset version number, the audio MODE of the audio manager of the user terminal is set to be a COMMUNICATION MODE (mode_in_communication).
2) It is determined whether a speaker of the audio manager is on (audiomanager. Ispeakephon), and if not, the speaker is turned on (audiomanager. Setspeaker).
3) The audio stream type of the media player of the user terminal is set as a music type, i.e., the audio stream type of the audio data to be played is set as a music type.
It should be noted that, the first scenario may be applicable to a scenario when a local audio playing event of an application program in the user terminal is monitored and the current channel is an asynchronous channel of the bluetooth channel during the process of maintaining the bluetooth connection between the user terminal and the vehicle-mounted terminal.
Scene two, the scene of the asynchronous channel of speaker passageway switching to bluetooth passageway. The specific switching setting mode comprises the following three steps:
1) The audio stream type of the media player of the user terminal is set as a music type, i.e., the audio stream type of the audio data to be played is set as a music type.
2) The audio mode of the audio manager of the user terminal is set to a NORMAL mode (NORMAL).
3) It is determined whether a speaker of the audio manager is on (audiomanager. Ispeakephon), and if not, the speaker is turned on (audiomanager. Setspeaker).
It should be noted that, the second scenario may be suitable for a scenario when an audio play end event of the application program is detected after the audio mode of the audio manager of the user terminal is set to the call mode.
And switching the synchronous channel of the third scene and the Bluetooth channel into the scene of the loudspeaker channel. The specific switching setting mode comprises the following eight steps:
1) The registration monitoring process is that the registration system broadcasts whether the audio connection state of the synchronous channel of the monitoring Bluetooth channel is updated.
2) The audio connection state of the synchronization channel of the audio manager is set to off.
3) And the monitoring process asynchronously monitors that the audio connection state of the synchronous channel is updated to be disconnected, and then the next step is executed.
4) The synchronization channel of the audio manager is set to an off state.
5) The audio mode of the audio manager of the user terminal is set to a talk mode. Specifically, it is determined whether the interface version number (Android API) of the user terminal is smaller than a preset version number (e.g., 21), if the interface version number is smaller than the preset version number, the audio MODE of the audio manager of the user terminal is set to be a phone MODE (mode_in_call), and if the interface version number is greater than or equal to the preset version number, the audio MODE of the audio manager of the user terminal is set to be a COMMUNICATION MODE (mode_in_communication).
6) The audio stream type of the media player of the user terminal is set as a music type, i.e., the audio stream type of the audio data to be played is set as a music type.
7) It is determined whether a speaker of the audio manager is on (audiomanager. Ispeakephon), and if not, the speaker is turned on (audiomanager. Setspeaker).
8) And logging out the monitoring process, namely logging out whether the audio connection state of the synchronous channel of the monitoring Bluetooth channel is updated.
It should be noted that, the third scenario may be applicable to a scenario when a local audio playing event of an application program in the user terminal is monitored and the current channel is a synchronous channel of the bluetooth channel in a process that the user terminal and the vehicle-mounted terminal maintain bluetooth connection.
And a fourth scene, wherein the speaker channel is switched to a synchronous channel scene of the Bluetooth channel. The specific switching setting mode comprises the following nine steps:
1) Judging whether the user terminal supports the synchronous channel of the Bluetooth channel, if so, continuing the next step.
2) The registration monitoring process is that the registration system broadcasts whether the audio connection state of the synchronous channel of the monitoring Bluetooth channel is updated.
3) The audio connection state of the synchronization channel of the audio manager is set to on.
4) And the monitoring process asynchronously monitors that the audio connection state of the synchronous channel is updated to be successful in connection, and then the next step is executed.
5) The synchronization channel of the audio manager is set to an open state.
6) The audio mode of the audio manager of the user terminal is set to a talk mode. Specifically, it is determined whether the interface version number (Android API) of the user terminal is smaller than a preset version number (e.g., 21), if the interface version number is smaller than the preset version number, the audio MODE of the audio manager of the user terminal is set to be a phone MODE (mode_in_call), and if the interface version number is greater than or equal to the preset version number, the audio MODE of the audio manager of the user terminal is set to be a COMMUNICATION MODE (mode_in_communication).
7) The audio stream type of the media player of the user terminal is set as a music type, i.e., the audio stream type of the audio data to be played is set as a music type.
8) It is determined whether a speaker of the audio manager is on (audiomanager. Ispeakephon), and if not, the speaker is turned on (audiomanager. Setspeaker).
9) And logging out the monitoring process, namely logging out whether the audio connection state of the synchronous channel of the monitoring Bluetooth channel is updated.
It should be noted that, the fourth scenario may be applicable to a scenario when the audio of the application program is continuously played by the synchronization channel in response to a trigger instruction triggered by the user to switch from the speaker channel to the synchronization channel after switching the audio playing channel of the user terminal to the speaker channel.
The technical scheme of the embodiment provides a specific parameter setting operation process when the Bluetooth channel and the speaker channel are switched in the process of playing the audio of the application program. The embodiment can switch the audio playing channel of the user terminal under the condition that the user terminal is connected with the Bluetooth of the vehicle-mounted terminal by switching the audio stream type of the media player and the audio mode in the audio manager for the system version below Android 4.4 and above Android5.1 based on the source code and the interface of the Android system. So as to ensure that the audio data of the user terminal can be normally played after the play channel is switched. In the embodiment of the application, in the process that the Bluetooth connection is always kept between the user terminal and the vehicle-mounted terminal, the bottom technical guarantee is provided for realizing the audio of the loudspeaker playing application program.
Fig. 5 is a schematic structural diagram of an audio data playing device according to an embodiment of the present application. The embodiment is suitable for the situation of how to play the audio data of the application program in the user terminal in the Bluetooth connection process of the user terminal and the vehicle-mounted terminal. The device is configured in a user terminal, and can implement the audio data playing method according to any of the foregoing embodiments of the present embodiment, where the device 500 specifically includes the following steps:
the channel switching module 501 is configured to switch from a bluetooth channel to a speaker channel if a local audio playing event of an application program in the user terminal is monitored during a process of maintaining bluetooth connection between the user terminal and the vehicle-mounted terminal;
an audio mode setting module 502, configured to set an audio mode of an audio manager of the user terminal to a call mode;
an audio playing module 503, configured to play the audio of the application program through the speaker channel.
Optionally, the apparatus further includes:
the speaker state monitoring module is used for monitoring whether a speaker play configuration item of the user terminal is in an on state or not after the voice broadcast function of the application program is started;
and the play event generation module is used for generating the local audio play event according to the monitoring result.
Optionally, the play event generating module is specifically configured to:
if the loudspeaker playing configuration item is in an on state, generating the local audio playing event;
and if the speaker playing configuration item is in a closed state, responding to speaker playing configuration item switching operation of a user on an operation interface of the application program, starting the speaker playing configuration item, and generating the local audio playing event.
Optionally, the audio playing module 503 is further configured to stop playing the audio of the application program if a call event of the user terminal is detected;
the channel switching module 501 is further configured to switch from the speaker channel to a synchronization channel of the bluetooth channel;
the audio playing module 503 is further configured to transmit, through the synchronization channel, call audio of the user terminal to the vehicle-mounted terminal for playing.
Optionally, the channel switching module 501 includes:
a monitoring process registration unit, configured to register a monitoring process if the user terminal supports a synchronization channel of the bluetooth channel;
an audio connection state setting unit configured to set an audio connection state of a synchronization channel of the audio manager to on;
A channel state setting unit, configured to set the synchronization channel of the audio manager to an on state if the audio connection state of the synchronization channel is monitored to be on by the monitoring process;
and a channel switching unit for switching from the speaker channel to the synchronization channel.
Optionally, the channel switching module 501 is further configured to switch from the speaker channel to an asynchronous channel of the bluetooth channel if an audio playing end event of the application is detected;
the audio mode setting module 502 is further configured to set an audio mode of the audio manager to a normal mode.
Optionally, the apparatus further includes:
and the audio stream setting module is used for setting the audio stream type of the media player of the user terminal as a music type.
Optionally, the apparatus further includes:
and the loudspeaker control module is used for opening the loudspeaker if the loudspeaker of the user terminal is detected to be closed.
Optionally, the application program in the user terminal is a navigation application program, and the audio of the application program is navigation induction information.
According to the technical scheme, in the process that the user terminal and the vehicle-mounted terminal are in Bluetooth connection, if a local audio playing event of an application program is monitored, a Bluetooth channel is switched to a speaker channel, an audio mode of an audio manager is set to be a call mode, and then audio of the application program is played through a speaker. According to the scheme, in the process that the Bluetooth connection process of the user terminal and the vehicle-mounted terminal is always kept, the speaker can play the audio of the application program, the vehicle-mounted terminal is supported to play the vehicle-mounted audio, the problem that the vehicle-mounted terminal simultaneously plays the vehicle-mounted audio and the audio of the application program conflicts when the user terminal is connected with the Bluetooth connection process of the vehicle-mounted terminal is solved, and a new idea is provided for audio data playing in the process that the user terminal is connected with the Bluetooth connection process of the vehicle-mounted terminal.
According to embodiments of the present application, an electronic device and a readable storage medium are also provided.
As shown in fig. 6, a block diagram of an electronic device according to a method for playing audio data according to an embodiment of the present application is shown. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the application described and/or claimed herein.
As shown in fig. 6, the electronic device includes: one or more processors 601, memory 602, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions executing within the electronic device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface. In other embodiments, multiple processors and/or multiple buses may be used, if desired, along with multiple memories and multiple memories. Also, multiple electronic devices may be connected, each providing a portion of the necessary operations (e.g., as a server array, a set of blade servers, or a multiprocessor system). One processor 601 is illustrated in fig. 6.
Memory 602 is a non-transitory computer-readable storage medium provided herein. The memory stores instructions executable by the at least one processor to cause the at least one processor to perform the method for playing audio data provided by the present application. The non-transitory computer readable storage medium of the present application stores computer instructions for causing a computer to execute the playback method of audio data provided by the present application.
The memory 602 is used as a non-transitory computer readable storage medium, and may be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules (e.g., the channel switching module 501, the audio mode setting module 502, and the audio playing module 503 shown in fig. 5) corresponding to the audio data playing method in the embodiments of the present application. The processor 601 executes various functional applications of the server and data processing, i.e., implements the playing method of audio data in the above-described method embodiment, by running non-transitory software programs, instructions, and modules stored in the memory 602.
The memory 602 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, at least one application program required for a function; the storage data area may store data created according to the use of the electronic device of the playing method of the audio data, and the like. In addition, the memory 602 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory 602 may optionally include a memory remotely located with respect to the processor 601, which may be connected to the electronic device of the method of playing audio data via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device of the audio data playing method may further include: an input device 603 and an output device 604. The processor 601, memory 602, input device 603 and output device 604 may be connected by a bus or otherwise, for example in fig. 6.
The input device 603 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device of the method of playing audio data, such as input devices for a touch screen, a keypad, a mouse, a track pad, a touch pad, a joystick, one or more mouse buttons, a track ball, a joystick, etc. The output means 604 may include a display device, auxiliary lighting means (e.g., LEDs), tactile feedback means (e.g., vibration motors), and the like. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device may be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASIC (application specific integrated circuit), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
These computing programs (also referred to as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented in a high-level procedural and/or object-oriented programming language, and/or in assembly/machine language. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
According to the technical scheme of the embodiment of the application, if the local audio playing event of the application program is monitored in the process that the user terminal and the vehicle-mounted terminal are in Bluetooth connection, the Bluetooth channel is switched to the speaker channel, the audio mode of the audio manager is set to be a call mode, and then the audio of the application program is played through the speaker. According to the scheme, in the process that the Bluetooth connection process of the user terminal and the vehicle-mounted terminal is always kept, the speaker can play the audio of the application program, the vehicle-mounted terminal is supported to play the vehicle-mounted audio, the problem that the vehicle-mounted terminal simultaneously plays the vehicle-mounted audio and the audio of the application program conflicts when the user terminal is connected with the Bluetooth connection process of the vehicle-mounted terminal is solved, and a new idea is provided for audio data playing in the process that the user terminal is connected with the Bluetooth connection process of the vehicle-mounted terminal.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present application may be performed in parallel, sequentially, or in a different order, provided that the desired results of the technical solutions disclosed in the present application can be achieved, and are not limited herein.
The above embodiments do not limit the scope of the application. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application are intended to be included within the scope of the present application.

Claims (20)

1. A method for playing audio data, which is applied to a user terminal, the method comprising:
in the process that the user terminal and the vehicle-mounted terminal are in Bluetooth connection, an audio mode of an audio manager is automatically set to be a common mode, and if a local audio playing event of an application program in the user terminal is monitored, a Bluetooth channel is switched to a loudspeaker channel; the Bluetooth channel is in a normally open state, and defaults to be used for transmitting application program audio for playing;
Setting an audio mode of an audio manager of the user terminal to a call mode, so that an asynchronous channel of a Bluetooth channel cannot play audio of the application program in the call mode at the moment;
and playing the audio of the application program through the speaker channel.
2. The method according to claim 1, wherein the method further comprises:
after the voice broadcasting function of the application program is started, whether a loudspeaker playing configuration item of the user terminal is in an on state or not is monitored, and the local audio playing event is generated according to a monitoring result.
3. The method of claim 2, wherein generating the local audio playback event based on the monitoring result comprises:
if the loudspeaker playing configuration item is in an on state, generating the local audio playing event;
and if the speaker playing configuration item is in a closed state, responding to speaker playing configuration item switching operation of a user on an operation interface of the application program, starting the speaker playing configuration item, and generating the local audio playing event.
4. The method of claim 1, further comprising, after setting the audio mode of the audio manager of the user terminal to a talk mode:
If the call event of the user terminal is monitored, stopping playing the audio of the application program;
a synchronization channel switching from the speaker channel to the bluetooth channel;
and transmitting the call audio of the user terminal to the vehicle-mounted terminal for playing through the synchronous channel.
5. The method of claim 4, wherein switching from the speaker channel to the synchronization channel of the bluetooth channel comprises:
if the user terminal supports the synchronous channel of the Bluetooth channel, registering a monitoring process;
setting the audio connection state of the synchronous channel of the audio manager to be on;
if the audio connection state of the synchronous channel is monitored to be on by the monitoring process, setting the synchronous channel of the audio manager to be on;
switching from the speaker channel to the synchronization channel.
6. The method of claim 1, further comprising, after playing the audio of the application through the speaker channel:
if the audio playing ending event of the application program is monitored, switching from the speaker channel to the asynchronous channel of the Bluetooth channel, and setting the audio mode of the audio manager to be a common mode.
7. The method of claim 1, further comprising, after switching from the bluetooth channel to the speaker channel:
and setting the audio stream type of the media player of the user terminal as a music type.
8. The method of claim 1, further comprising, after switching from the bluetooth channel to the speaker channel:
and if the speaker of the user terminal is detected to be closed, opening the speaker.
9. The method according to any of claims 1-8, wherein the application in the user terminal is a navigation application and the audio of the application is navigation guidance information.
10. An apparatus for playing audio data, configured in a user terminal, the apparatus comprising:
the channel switching module is used for automatically setting the audio mode of the audio manager to be a common mode in the process of keeping Bluetooth connection between the user terminal and the vehicle-mounted terminal, and switching from a Bluetooth channel to a loudspeaker channel if a local audio playing event of an application program in the user terminal is monitored; the Bluetooth channel is in a normally open state, and defaults to be used for transmitting application program audio for playing;
An audio mode setting module, configured to set an audio mode of an audio manager of the user terminal to a call mode, so that an asynchronous channel of a bluetooth channel cannot play audio of the application program in the call mode at this time;
and the audio playing module is used for playing the audio of the application program through the loudspeaker channel.
11. The apparatus of claim 10, wherein the apparatus further comprises:
the speaker state monitoring module is used for monitoring whether a speaker play configuration item of the user terminal is in an on state or not after the voice broadcast function of the application program is started;
and the play event generation module is used for generating the local audio play event according to the monitoring result.
12. The apparatus of claim 11, wherein the play event generation module is specifically configured to:
if the loudspeaker playing configuration item is in an on state, generating the local audio playing event;
and if the speaker playing configuration item is in a closed state, responding to speaker playing configuration item switching operation of a user on an operation interface of the application program, starting the speaker playing configuration item, and generating the local audio playing event.
13. The apparatus as recited in claim 10, further comprising:
the audio playing module is further configured to stop playing the audio of the application program if a call event of the user terminal is detected;
the channel switching module is also used for switching from the loudspeaker channel to the synchronous channel of the Bluetooth channel;
the audio playing module is further configured to transmit the call audio of the user terminal to the vehicle-mounted terminal for playing through the synchronization channel.
14. The apparatus of claim 13, wherein the channel switching module comprises:
a monitoring process registration unit, configured to register a monitoring process if the user terminal supports a synchronization channel of the bluetooth channel;
an audio connection state setting unit configured to set an audio connection state of a synchronization channel of the audio manager to on;
a channel state setting unit, configured to set the synchronization channel of the audio manager to an on state if the audio connection state of the synchronization channel is monitored to be on by the monitoring process;
and a channel switching unit for switching from the speaker channel to the synchronization channel.
15. The apparatus as recited in claim 10, further comprising:
the channel switching module is further configured to switch from the speaker channel to an asynchronous channel of the bluetooth channel if an audio play end event of the application is detected;
the audio mode setting module is further configured to set an audio mode of the audio manager to a normal mode.
16. The apparatus of claim 10, wherein the apparatus further comprises:
and the audio stream setting module is used for setting the audio stream type of the media player of the user terminal as a music type.
17. The apparatus of claim 10, wherein the apparatus further comprises:
and the loudspeaker control module is used for opening the loudspeaker if the loudspeaker of the user terminal is detected to be closed.
18. The apparatus according to any of claims 10-17, wherein the application in the user terminal is a navigation application and the audio of the application is navigation guidance information.
19. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of playing audio data according to any one of claims 1-9.
20. A non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the method of playing audio data according to any one of claims 1-9.
CN202010425549.0A 2020-05-19 2020-05-19 Audio data playing method, device, equipment and storage medium Active CN113709691B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010425549.0A CN113709691B (en) 2020-05-19 2020-05-19 Audio data playing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010425549.0A CN113709691B (en) 2020-05-19 2020-05-19 Audio data playing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113709691A CN113709691A (en) 2021-11-26
CN113709691B true CN113709691B (en) 2024-04-02

Family

ID=78645350

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010425549.0A Active CN113709691B (en) 2020-05-19 2020-05-19 Audio data playing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113709691B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002373484A (en) * 2001-06-15 2002-12-26 Alpine Electronics Inc Portable audio equipment and on-vehicle audio equipment
KR20080062488A (en) * 2006-12-29 2008-07-03 엘지전자 주식회사 Apparatus and method for informing calling signal using blootuth mobile communication terminal
CN101867657A (en) * 2010-06-24 2010-10-20 中兴通讯股份有限公司 Method and device for switching audio output equipment on mobile phone
CN103929695A (en) * 2014-03-12 2014-07-16 杭州罗孚音响有限公司 Household embedded Bluetooth music playing system and method
CN106031131A (en) * 2014-03-04 2016-10-12 高通股份有限公司 Managing features associated with a user equipment based on a location of the user equipment within a vehicle
WO2019090726A1 (en) * 2017-11-10 2019-05-16 华为技术有限公司 Method for selecting bluetooth device, terminal, and system
CN110087215A (en) * 2019-05-06 2019-08-02 北京百度网讯科技有限公司 Information broadcasting method and device based on Bluetooth connection, terminal and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160188290A1 (en) * 2014-12-30 2016-06-30 Anhui Huami Information Technology Co., Ltd. Method, device and system for pushing audio
US10540970B2 (en) * 2017-12-12 2020-01-21 Amazon Technologies, Inc. Architectures and topologies for vehicle-based, voice-controlled devices

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002373484A (en) * 2001-06-15 2002-12-26 Alpine Electronics Inc Portable audio equipment and on-vehicle audio equipment
KR20080062488A (en) * 2006-12-29 2008-07-03 엘지전자 주식회사 Apparatus and method for informing calling signal using blootuth mobile communication terminal
CN101867657A (en) * 2010-06-24 2010-10-20 中兴通讯股份有限公司 Method and device for switching audio output equipment on mobile phone
CN106031131A (en) * 2014-03-04 2016-10-12 高通股份有限公司 Managing features associated with a user equipment based on a location of the user equipment within a vehicle
CN103929695A (en) * 2014-03-12 2014-07-16 杭州罗孚音响有限公司 Household embedded Bluetooth music playing system and method
WO2019090726A1 (en) * 2017-11-10 2019-05-16 华为技术有限公司 Method for selecting bluetooth device, terminal, and system
CN110087215A (en) * 2019-05-06 2019-08-02 北京百度网讯科技有限公司 Information broadcasting method and device based on Bluetooth connection, terminal and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
蓝牙智能骑行头盔Android终端软件的设计与实现;黄思远;周渊平;苗青;;现代计算机(专业版);20181115(第32期);全文 *

Also Published As

Publication number Publication date
CN113709691A (en) 2021-11-26

Similar Documents

Publication Publication Date Title
US11800002B2 (en) Audio data routing between multiple wirelessly connected devices
CN106953990B (en) Incoming call answering method of mobile terminal and mobile terminal
US8588849B2 (en) System and method for resuming media
KR102091003B1 (en) Method and apparatus for providing context aware service using speech recognition
US20040091090A1 (en) System and method for effectively managing telephone functionality by utilizing a settop box
CN103999371A (en) Method and apparatus for operating mobile terminal
CN109936481A (en) Principal and subordinate's server switching method, device, electronic equipment and storage medium
KR102095533B1 (en) Electronic device and method for providing notification information selectively
US10073672B2 (en) Method, system, and computer storage medium for voice control of a split-screen terminal
CN104793991B (en) A kind of audio output apparatus switching method and device
KR102043641B1 (en) Operating Method For Nearby Function and Electronic Device supporting the same
CN115190197B (en) Bluetooth headset-based communication method and device and storage medium
CN111988653A (en) Interaction method, device, equipment and storage medium for multi-video screen projection information
KR20140094951A (en) Supporting Method for Communication Call Rejection and Electronic Device supporting the same
CN105873179A (en) Wireless network accessing method and device
CN111736785A (en) Control method, device and equipment for screen projection playing and computer storage medium
CN113411759A (en) Voice call transfer method and electronic equipment
CN111881005B (en) Information display method, device, equipment and storage medium
CN113709691B (en) Audio data playing method, device, equipment and storage medium
CN113271376A (en) Communication control method, electronic equipment and earphone
US11057702B1 (en) Method and system for reducing audio feedback
CN111277697A (en) Audio processing method and device, storage medium and electronic equipment
US20190068771A1 (en) External device for communicating with conferencing client using notification api
KR20130133389A (en) Terminal and method for controlling the same
CN115474238A (en) Data stream transmission method, device, communication device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant