Audio data processing method and electronic equipment

文档序号:452559 发布日期:2021-12-28 浏览:4次 中文

阅读说明:本技术 一种音频数据处理方法及电子设备 (Audio data processing method and electronic equipment ) 是由 郑轶民 宋以祥 郭恒 于 2021-09-18 设计创作,主要内容包括:本申请提供一种音频数据处理方法,所述方法包括:在至少一个目标应用处于运行状态、且通过第一数据通路输出音频数据的情况下,如果检测到至少一个外置音频设备的连接事件,获得参数信息;其中,处于运行状态的所述目标应用具有音频输出功能;如果所述参数信息表征所述外置音频设备对应于第二数据通路,确定所述电子设备处于第一模式;在所述第一模式下,通过所述第二数据通路和所述第一数据通路分别输出所述目标应用的音频数据,所述第一数据通路和所述第二数据通路分别表征不同的音频设备。同时,本申请还提供一种电子设备。(The application provides an audio data processing method, which comprises the following steps: under the condition that at least one target application is in a running state and audio data are output through a first data path, if a connection event of at least one external audio device is detected, parameter information is obtained; wherein the target application in a running state has an audio output function; if the parameter information indicates that the external audio equipment corresponds to a second data path, determining that the electronic equipment is in a first mode; in the first mode, the audio data of the target application is output through the second data path and the first data path respectively, and the first data path and the second data path respectively represent different audio devices. Simultaneously, this application still provides an electronic equipment.)

1. A method of audio data processing, the method comprising:

under the condition that at least one target application is in a running state and audio data are output through a first data path, if a connection event of at least one external audio device is detected, parameter information is obtained; wherein the target application in a running state has an audio output function;

if the parameter information indicates that the external audio equipment corresponds to a second data path, determining that the electronic equipment is in a first mode;

in the first mode, the audio data of the target application is output through the second data path and the first data path respectively, and the first data path and the second data path respectively represent different audio devices.

2. The method of claim 1, the obtaining parameter information comprising:

and obtaining parameter information representing the type of the audio interface connected with the external audio equipment.

3. The method of claim 2, the obtaining parameter information, further comprising:

obtaining parameter information characterizing the audio device type.

4. The method of claim 1, the first data path and the second data path each characterizing a different audio device, comprising:

the first data path characterizes a first wired audio device, the second data path characterizes a second wired audio device; the first wired audio equipment comprises built-in audio equipment and external audio equipment;

alternatively, the first data path characterizes a first wireless audio device and the second data path characterizes a second wireless audio device;

alternatively, the first data path characterizes a wired audio device and the second data path characterizes a wireless audio device; the wired audio equipment comprises built-in audio equipment and external audio equipment;

alternatively, the first data path characterizes a wireless audio device and the second data path characterizes a wired audio device, wherein the wired audio device includes an internal audio device and an external audio device.

5. The method of claim 1, further comprising:

if the target applications in the running state have at least two target applications, determining the starting sequence of the at least two target applications;

determining that the first data path corresponds to a first target application of the at least two target applications and the second data path corresponds to a second target application of the at least two target applications according to the opening sequence of the at least two target applications;

outputting first audio data of the first target application through the first data path; outputting second audio data of the second target application through the second data path; wherein the first audio data and the second audio data are of different types.

6. The method of claim 1, further comprising:

under the condition that the first data path outputs audio data through built-in audio equipment, if disconnection between the second data path and target audio equipment is detected, first prompt information is output through a display interface of the electronic equipment to prompt that the target audio equipment is disconnected, wherein the first prompt information carries an audio equipment identifier.

7. The method of claim 1, further comprising:

under the condition that the first data path and the second data path are both connected with external audio equipment, if the first data path or the second data path is detected to be disconnected with target audio equipment, second prompt information is output through a display interface of the electronic equipment to prompt that the target audio equipment is disconnected, wherein the second prompt information carries an audio equipment identifier.

8. The method of claim 7, further comprising:

under the condition that the first data path or the second data path is disconnected with the target audio equipment, if an output instruction aiming at the target audio data is detected, third prompt information is output through a display interface of the electronic equipment to prompt the target audio equipment to be connected, wherein the third prompt information carries an audio equipment identifier.

9. An electronic device, the electronic device comprising:

the acquisition unit is used for acquiring the parameter information if a connection event of at least one external audio device is detected under the condition that at least one target application is in an operating state and audio data is output through a first data path; wherein the target application in a running state has an audio output function;

the determining unit is used for determining that the electronic equipment is in a first mode if the parameter information represents that the external audio equipment corresponds to a second data path;

an output unit, configured to output, in the first mode, the audio data of the target application through the second data path and the first data path, respectively, where the first data path and the second data path respectively represent different audio devices.

10. An electronic device, the electronic device comprising: a processor and a memory for storing a computer program operable on the processor, wherein the processor is operable to perform the method steps of any of claims 1 to 8 when the computer program is executed.

Technical Field

The present disclosure relates to data processing methods and electronic devices, and particularly, to an audio data processing method and an electronic device.

Background

At present, electronic devices with an android system can support multi-video or multi-audio multitask operation, for example, the same device can watch two videos simultaneously or two users listen to a song simultaneously, or watch videos and a call simultaneously, however, when outputting multi-video or multi-audio data, electronic devices in the prior art mix the multi-audio data together for output, the user hears a mixed sound, and the electronic devices do not support outputting different sound sources to different users as required, for example, there is a call dial-in while a video conference is opened, and the prior art cannot enable the user to clearly hear telephone content and video conference content.

Disclosure of Invention

In view of the foregoing, embodiments of the present application are intended to provide an audio data processing method and an electronic device.

In order to achieve the purpose, the technical scheme of the application is realized as follows:

according to an aspect of the present application, there is provided an audio data processing method, the method including:

under the condition that at least one target application is in a running state and audio data are output through a first data path, if a connection event of at least one external audio device is detected, parameter information is obtained; wherein the target application in a running state has an audio output function;

if the parameter information indicates that the external audio equipment corresponds to a second data path, determining that the electronic equipment is in a first mode;

in the first mode, the audio data of the target application is output through the second data path and the first data path respectively, and the first data path and the second data path respectively represent different audio devices.

In the foregoing solution, the obtaining parameter information includes:

obtaining parameter information characterizing a type of audio interface to which the audio device is connected.

In the foregoing scheme, the obtaining parameter information further includes:

obtaining parameter information representing the type of the audio equipment;

in the above solution, the first data path and the second data path respectively represent different audio devices, and the method includes:

the first data path characterizes a first wired audio device, the second data path characterizes a second wired audio device; the first wired audio equipment comprises built-in audio equipment and external audio equipment;

alternatively, the first data path characterizes a first wireless audio device and the second data path characterizes a second wireless audio device;

alternatively, the first data path characterizes a wired audio device and the second data path characterizes a wireless audio device; the wired audio equipment comprises built-in audio equipment and external audio equipment;

alternatively, the first data path characterizes a wireless audio device and the second data path characterizes a wired audio device, wherein the wired audio device includes an internal audio device and an external audio device.

In the above scheme, the method further comprises:

if the target applications in the running state have at least two target applications, determining the starting sequence of the at least two target applications;

determining that the first data path corresponds to a first target application of the at least two target applications and the second data path corresponds to a second target application of the at least two target applications according to the opening sequence of the at least two target applications;

outputting first audio data of the first target application through the first data path; outputting second audio data of the second target application through the second data path; wherein the first audio data and the second audio data are of different types.

In the above scheme, the method further comprises:

under the condition that the first data path outputs audio data through built-in audio equipment, if disconnection between the second data path and target audio equipment is detected, first prompt information is output through a display interface of the electronic equipment to prompt that the target audio equipment is disconnected, wherein the first prompt information carries an audio equipment identifier.

In the above scheme, the method further comprises:

under the condition that the first data path and the second data path are both connected with external audio equipment, if the first data path or the second data path is detected to be disconnected with target audio equipment, second prompt information is output through a display interface of the electronic equipment to prompt that the target audio equipment is disconnected, wherein the second prompt information carries an audio equipment identifier.

In the above scheme, the method further comprises:

under the condition that the first data path or the second data path is disconnected with the target audio equipment, if an output instruction aiming at the target audio data is detected, third prompt information is output through a display interface of the electronic equipment to prompt the target audio equipment to be connected, wherein the third prompt information carries an audio equipment identifier.

According to another aspect of the present application, there is provided an electronic apparatus including:

the acquisition unit is used for acquiring the parameter information if a connection event of at least one external audio device is detected under the condition that at least one target application is in an operating state and audio data is output through a first data path; wherein the target application in a running state has an audio output function;

the determining unit is used for determining that the electronic equipment is in a first mode if the parameter information represents that the external audio equipment corresponds to a second data path;

an output unit, configured to output, in the first mode, the audio data of the target application through the second data path and the first data path, respectively, where the first data path and the second data path respectively represent different audio devices.

In the above scheme, the electronic device is further configured to execute any method step of the audio data processing method.

According to a third aspect of the present application, there is provided an electronic device comprising: a processor and a memory for storing a computer program operable on the processor, wherein the processor is operable to perform the method steps of any of the above audio data processing methods when executing the computer program.

The application provides an audio data processing method and electronic equipment, wherein under the condition that at least one target application is in an operating state and audio data are output through a first data path, if a connection event of at least one external audio equipment is detected, parameter information is obtained; wherein the target application in a running state has an audio output function; if the parameter information indicates that the external audio equipment corresponds to a second data path, determining that the electronic equipment is in a first mode; in the first mode, the audio data of the target application is output through the second data path and the first data path respectively, and the first data path and the second data path respectively represent different audio devices. Therefore, the audio data are output through different data paths, so that the listening experience of the user in different scenes can be met, the user can hear the target audio data clearly, and the listening effect of the audio data cannot be reduced.

Drawings

FIG. 1 is a schematic view of a flow implementation of an audio data processing method according to the present application;

FIG. 2 is a first schematic structural component diagram of an electronic device according to the present application;

fig. 3 is a structural schematic diagram of an electronic device in the present application.

Detailed Description

The technical solution of the present application is further described in detail with reference to the drawings and specific embodiments of the specification.

Fig. 1 is a schematic view of a flow implementation of an audio data processing method in the present application, as shown in fig. 1, including:

step 101, when at least one target application is in an operating state and audio data is output through a first data path, if a connection event of at least one external audio device is detected, obtaining parameter information; wherein the target application in a running state has an audio output function.

In the present application, the method may be applied to an electronic device with an audio output function, for example, the electronic device may be a mobile phone, a tablet computer, a desktop computer, a watch, a television, a game console, and so on. Software with an audio output function (such as music application programs, video application programs, game application programs, web class application programs and the like) can be installed in the electronic equipment, and the electronic equipment comprises at least two audio codec channels and two Bluetooth channels. When at least one target application (such as QQ music) in the electronic device is in an operating state and audio data is output through a first data path (such as the audio codec 1), if a connection event of at least one external audio device (such as an earphone) is detected, the electronic device can obtain parameter information representing the type of an audio interface connected with the external audio device, and can determine which audio interface (such as a wired interface or a wireless interface) the external audio device is connected with through the parameter information, so that based on the type of the audio interface connected with the external audio device, the electronic device can determine which data path to output the audio data (such as whether to output the audio data through the wireless data path or to output the audio data through the wired data path).

In the application, when the electronic device detects a connection event of at least one external audio device, the electronic device can obtain parameter information representing the type of an audio interface connected with the external audio device, and also can obtain parameter information representing the type of the external audio device, and can determine whether the external audio device is an earphone or a sound box, or a wireless device or a wired device according to the parameter information.

Step 102, if the parameter information indicates that the external audio device corresponds to a second data path, determining that the electronic device is in a first mode;

in this application, when the electronic device outputs audio data, it is usually output through a first data path by default (for example, the first data path is a wired data path, i.e., through the audio codec 1), and when the electronic device determines, according to the parameter information of the external audio device, that a data interface connected to the external audio device belongs to a second data path (for example, the second data path is a wired data path, i.e., through the audio codec 2), it determines that the electronic device is currently in the first mode. For example, the first mode is a two-way audio independent output mode or a one-way audio simultaneous two-way output mode.

In this application, the user may set the default data path by himself, for example, the second data path is set as the default path for outputting audio.

Step 103, in the first mode, the audio data of the target application is output through the second data path and the first data path respectively, and the first data path and the second data path respectively represent different audio devices.

In one implementation, if the electronic device outputs audio data of a target application through the second data path and the first data path, respectively, in the first mode, the first data path may characterize the first wired audio device, and the second data path may characterize the second wired audio device; the first wired audio equipment comprises built-in audio equipment and external audio equipment; the second wired audio device may also include a built-in audio device and an external audio device.

For example, the electronic device supports 4 built-in speakers, and normally may default to transmit the audio data to the 4 built-in speakers through the first data path for output, but when the electronic device is in the first mode, the electronic device may automatically allocate the 4 built-in speakers, for example, transmitting the audio data 1 to the 1 st and 2 nd built-in speakers through the first data path for output, and transmitting the audio data 2 to the 3 rd and 4 th built-in speakers through the second data path for output. Of course, if the electronic device is connected to the external audio device, the audio data 1 to 4 internal sound boxes may be transmitted through the first data path for output, and the audio data 2 may be transmitted through the second data path for output to the external audio device. As such, both the first data path and the second data path characterize the built-in audio device.

In another implementation, in a first mode, the electronic device outputs audio data of a target application through a second data path and a first data path, respectively, where the first data path may characterize the first wireless audio device, and the second data path characterizes the second wireless audio device; for example, the first data path represents bluetooth headset 1 and the second data path represents bluetooth headset 2.

In a third implementation manner, in the first mode, the electronic device respectively outputs audio data of the target application through a second data path and a first data path, where the first data path may represent the wired audio device, and the second data path may represent the wireless audio device; the wired audio equipment comprises built-in audio equipment and external audio equipment; for example, the wired audio device may be a wired earphone or a wired speaker, and the wireless audio device may be a bluetooth earphone or a bluetooth speaker.

In a fourth implementation manner, in the first mode, the electronic device outputs audio data of a target application through a second data path and a first data path, where the first data path may characterize the wireless audio device, and the second data path may characterize the wired audio device, where the wired audio device includes an internal audio device and an external audio device.

According to the method and the device, the audio data are respectively output through different data paths by different audio equipment, and various requirements of multiple scenes of a user can be met. For example, the user receives a call while watching a video, or two video data are simultaneously played on the main screen and the auxiliary screen through the same host, and the like. Two paths of audio data are mutually independent and output without mutual interference.

In the present application, the first physical line corresponding to the first data path and the second physical line corresponding to the second data path are different, but the types of the lines may be the same or different. For example, the first data path corresponds to a physical line 1, and the second data path corresponds to a physical line 2, where the physical line 1 and the physical line 2 do not belong to the same line, but the physical line 1 and the physical line 2 may both be a wired line, or may both be a wireless line, or may both be a wired line, or may both be a wireless line. Or, it can be said, that the first data path corresponds to a first audio codec and the second data path corresponds to a second audio codec, wherein the first audio codec and the second audio codec belong to two different audio codecs. Alternatively, the first data path may be said to correspond to a first bluetooth device and the second data path may be said to correspond to a second bluetooth device, wherein the first bluetooth device and the second bluetooth device belong to two different devices.

In this application, if there is only one target application in the electronic device in the running state, the audio data of the target application output by the electronic device through the second data path and the first data path may be the same.

For example, in an implementation scenario, a user a is in a living room, a user B is in a bedroom, and at this time, the user a and the user B want to listen to the same song through the same device at the same time in different spaces, then the user a or the user B can open a function of "single-channel audio and two-channel output" in an audio display interface of a computer, then an earphone 1 of the user a is connected to an earphone interface 1 of the computer, and an earphone 2 of the user B is connected to an earphone interface 2 of the computer, and at this time, the computer can simultaneously output audio data of the music through the earphone 1 and the earphone 2 when playing music, so that the requirement that the user a and the user B want to listen to the same song at the same time in different spaces is met, and because the device outputs audio data through two independent data channels, even if the two users are in different spaces, the same music can be simultaneously heard, and does not degrade the listening experience.

Here, one of the user a or the user B may also output audio data through a built-in speaker of the computer, and the other user may output audio data using headphones.

In this application, if there are at least two target applications in the running state, the electronic device may further determine an opening sequence of the at least two target applications; then, according to the opening sequence of the at least two target applications, it may be determined that the first data path corresponds to a first target application of the at least two target applications, and the second data path corresponds to a second target application of the at least two target applications; then, outputting first audio data of the first target application through the first data path; outputting second audio data of a second target application through the second data path; wherein the first audio data and the second audio data are of different types.

Here, the first audio data and the second audio data are different in type, including:

the first target application corresponding to the first audio data and the second target application corresponding to the second audio data are different in type. For example, the first target application is a video-class application and the second target application is a music-class application.

Here, the first audio data and the second audio data are different in type, and further include:

the developers of the first target application corresponding to the first audio data and the second target application corresponding to the second audio data are different. For example, the developer of the first target application is company a, and the developer of the second target application is company B.

The method and the device can output different types of audio data through different data paths by the same equipment at the same time, and can realize multi-audio multi-task operation, such as answering the call while a video conference is carried out by the same mobile phone.

In the application, the electronic device may further output first prompt information through a display interface of the electronic device to prompt that the target audio device is disconnected if the disconnection between the second data path and the target audio device is detected under the condition that the audio data is output by the built-in audio device in the first data path, where the first prompt information carries an audio device identifier. Therefore, the user can clearly know the connection state of the current external audio equipment and the terminal through the prompt message.

In this application, in the first mode, and under the condition that the electronic device outputs audio data through the internal audio device of the first data path, if a connection event between the external audio device and the audio interface of the first data path is detected, the electronic device may output a prompt message, where the prompt message is used to prompt a user of a correct audio interface that the external audio device should be currently connected to, for example, the prompt message is: please insert the headset into the headset 2. Therefore, the user can be reminded to insert the earphone into the correct earphone interface through the prompt message under the condition that the user inserts the wrong earphone interface, so that the audio data output is realized.

In this application, the electronic device may further be in the first mode, and under the condition that the audio data is output through the internal audio device of the first data path, if a connection event between the external audio device and the audio interface of the first data path is detected, the electronic device may further close the internal audio device of the first data path, and open the internal audio device of the second data path, so that the audio data is output through the internal audio device of the second data path and the external audio device of the first data path at the same time. Therefore, the data path of the built-in audio equipment can be automatically switched under the condition that the user inserts the wrong earphone interface, so that the normal use and the normal audio data output of the user are not influenced under the condition that the user inserts the wrong earphone interface.

In this application, under the condition that both the first data access and the second data access are connected with the external audio device, if it is detected that the first data access or the second data access is disconnected from the target audio device, the electronic device may output second prompt information through a display interface of the electronic device to prompt that the target audio device is disconnected, where the second prompt information carries an audio device identifier. Therefore, the user can know the connection state of the audio equipment and the terminal and which audio equipment is disconnected with the terminal at the first time through the prompt message.

In this application, when the first data path or the second data path is disconnected from the target audio device, if an output instruction for the target audio data is detected, the electronic device may further output third prompt information through a display interface of the electronic device to prompt connection of the target audio device, where the third prompt information carries an audio device identifier.

For example, when a user opens a first audio application, the audio codec 1 through the first data path outputs sound to a wired headset or to a wireless bluetooth headset through the bluetooth path 1; when the user opens the function of 'two-way audio independent output' in the system setting menu, the system jumps out of the prompt message 'please insert the earphone or connect the Bluetooth earphone'. After the user inserts or connects the second earphone, the system jumps out of the prompt message "the second earphone is connected". When the user opens the second audio application, the audio codec 2 of the second data path outputs the sound to the wired earphone or the bluetooth path 2 to the wireless bluetooth earphone; if the user disconnects the audio codec 2 or the earphone connected to the bluetooth path 2 first, the system will jump out the prompt message that "the second pair of earphones is disconnected", and at this time, only the first pair of earphones (corresponding to the first audio application) outputs sound, and the second audio application is in a pause state, and if the user continues to disconnect the earphone connected to the audio codec 1 or the bluetooth path 1, the electronic device may adjust to output sound from the built-in speaker. If the user clicks the second audio application continuous playing button, the system of the electronic equipment jumps out of a prompt box, namely, please insert the earphone or connect the Bluetooth earphone or close the two-way audio independent output function, the earphone is inserted, and the user clicks the second audio application continuous playing button again, so that the second audio application continues playing on the earphone connected with the audio codec 2 or the Bluetooth path 2; if the "two-way audio independent output" function is turned off, the user clicks the second audio application resume play button again, and both the second audio application and the first audio application resume play on the first set of headphones. If the user disconnects the audio codec 1 or the earphone connected with the bluetooth path 1 first, the display interface of the electronic device jumps out of the prompt bar that the first pair of earphones is disconnected, only the second pair of earphones (corresponding to the second audio application) sound at this time, the first audio application is in a pause state, and if the user continues to disconnect the earphone connected with the audio codec 2 or the bluetooth path 2, the electronic device is adjusted to the built-in sound box of the system to sound. If the user clicks the first audio application continuous playing button, the display interface of the electronic equipment jumps out of a prompt box, namely, please insert the earphone or connect the Bluetooth earphone or close the two-way audio independent output function, the earphone is inserted, and the user clicks the continuous playing button of the first audio application again, so that the first audio application continues playing on the earphone connected with the audio codec 1 or the Bluetooth path 1; if the two-way audio independent output function is closed, the user clicks the continue play button of the first audio application again, and both the first audio application and the second audio application continue to play on the second headphone set.

The audio data are output through different audio devices corresponding to different data paths through improvement on hardware, so that listening experience of a user in different scenes can be met, and the listening effect of the audio data cannot be reduced.

Fig. 2 is a schematic structural composition diagram of an electronic device in the present application, as shown in fig. 2, the electronic device includes:

the acquiring unit 201 is configured to acquire parameter information if a connection event of at least one external audio device is detected, in a case where at least one target application is in an operating state and audio data is output through a first data path; wherein the target application in a running state has an audio output function;

a determining unit 202, configured to determine that the electronic device is in a first mode if the parameter information indicates that the external audio device corresponds to a second data path;

an output unit 203, configured to output, in the first mode, the audio data of the target application through the second data path and the first data path, respectively, where the first data path and the second data path respectively represent different audio devices.

In this application, the obtaining unit 201 is specifically configured to obtain parameter information representing a type of an audio interface connected to the external audio device. And obtaining parameter information characterizing the audio device type.

In this application, the first data path and the second data path respectively represent different audio devices, including:

the first data path characterizes a first wired audio device, the second data path characterizes a second wired audio device; the first wired audio equipment comprises built-in audio equipment and external audio equipment;

alternatively, the first data path characterizes a first wireless audio device and the second data path characterizes a second wireless audio device;

alternatively, the first data path characterizes a wired audio device and the second data path characterizes a wireless audio device; the wired audio equipment comprises built-in audio equipment and external audio equipment;

alternatively, the first data path characterizes a wireless audio device and the second data path characterizes a wired audio device, wherein the wired audio device includes an internal audio device and an external audio device.

In this application, the determining unit 202 is further configured to determine, if there are at least two target applications in the running state, an opening order of the at least two target applications; and determining that the first data path corresponds to a first target application of the at least two target applications and the second data path corresponds to a second target application of the at least two target applications according to the opening sequence of the at least two target applications;

an output unit 203, specifically configured to output first audio data of the first target application through the first data path; outputting second audio data of the second target application through the second data path; wherein the first audio data and the second audio data are of different types.

In this application, the output unit 203 is further configured to, under the condition that the first data path outputs audio data through a built-in audio device, if it is detected that the second data path is disconnected from the target audio device, output first prompt information through a display interface of the electronic device to prompt that the target audio device is disconnected, where the first prompt information carries an audio device identifier.

In this application, the output unit 203 is further configured to, under the condition that the first data path and the second data path are both connected to external audio equipment, if it is detected that the first data path or the second data path is disconnected from the target audio equipment, output second prompt information through a display interface of the electronic equipment to prompt that the target audio equipment is disconnected, where the second prompt information carries an audio equipment identifier.

In this application, the output unit 203 is further configured to, in a case that the first data path or the second data path is disconnected from the target audio device, output third prompt information through a display interface of the electronic device to prompt connection of the target audio device if an output instruction for the target audio data is detected, where the third prompt information carries an audio device identifier.

It should be noted that: in the electronic device provided in the above embodiment, when outputting and processing audio data, only the division of the above program modules is exemplified, and in practical applications, the above processing may be distributed to different program modules according to needs, that is, the internal structure of the device may be divided into different program modules to complete all or part of the above described processing. In addition, the electronic device provided by the above embodiment and the audio data processing method embodiment provided by the above embodiment belong to the same concept, and specific implementation processes thereof are detailed in the method embodiment and are not described herein again.

An embodiment of the present application further provides an electronic device, including: a processor and a memory for storing a computer program capable of running on the processor,

wherein the processor is configured to execute, when running the computer program: under the condition that at least one target application is in a running state and audio data are output through a first data path, if a connection event of at least one external audio device is detected, parameter information is obtained; wherein the target application in a running state has an audio output function;

if the parameter information indicates that the external audio equipment corresponds to a second data path, determining that the electronic equipment is in a first mode;

in the first mode, the audio data of the target application is output through the second data path and the first data path respectively, and the first data path and the second data path respectively represent different audio devices.

The processor is further configured to, when executing the computer program, perform: and obtaining parameter information representing the type of the audio interface connected with the external audio equipment.

The processor is further configured to, when executing the computer program, perform: obtaining parameter information characterizing the audio device type.

The processor is further configured to, when executing the computer program, perform: the first data path characterizes a first wired audio device, the second data path characterizes a second wired audio device; the first wired audio equipment comprises built-in audio equipment and external audio equipment;

alternatively, the first data path characterizes a first wireless audio device and the second data path characterizes a second wireless audio device;

alternatively, the first data path characterizes a wired audio device and the second data path characterizes a wireless audio device; the wired audio equipment comprises built-in audio equipment and external audio equipment;

alternatively, the first data path characterizes a wireless audio device and the second data path characterizes a wired audio device, wherein the wired audio device includes an internal audio device and an external audio device.

The processor is further configured to, when executing the computer program, perform: if the target applications in the running state have at least two target applications, determining the starting sequence of the at least two target applications;

determining that the first data path corresponds to a first target application of the at least two target applications and the second data path corresponds to a second target application of the at least two target applications according to the opening sequence of the at least two target applications;

outputting first audio data of the first target application through the first data path; outputting second audio data of the second target application through the second data path; wherein the first audio data and the second audio data are of different types.

The processor is further configured to, when executing the computer program, perform: under the condition that the first data path outputs audio data through built-in audio equipment, if disconnection between the second data path and target audio equipment is detected, first prompt information is output through a display interface of the electronic equipment to prompt that the target audio equipment is disconnected, wherein the first prompt information carries an audio equipment identifier.

The processor is further configured to, when executing the computer program, perform: under the condition that the first data path and the second data path are both connected with external audio equipment, if the first data path or the second data path is detected to be disconnected with target audio equipment, second prompt information is output through a display interface of the electronic equipment to prompt that the target audio equipment is disconnected, wherein the second prompt information carries an audio equipment identifier.

The processor is further configured to, when executing the computer program, perform: under the condition that the first data path or the second data path is disconnected with the target audio equipment, if an output instruction aiming at the target audio data is detected, third prompt information is output through a display interface of the electronic equipment to prompt the target audio equipment to be connected, wherein the third prompt information carries an audio equipment identifier.

Fig. 3 is a schematic structural component diagram of an electronic device 300 in the present application, where the electronic device 300 may be a mobile phone, a computer, a digital broadcast terminal, an information transceiver, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, an earphone, a recorder, or other terminals with an audio acquisition function. The electronic device 300 shown in fig. 3 includes: at least one processor 301, memory 302, at least one network interface 304, and a user interface 303. The various components in electronic device 300 are coupled together by a bus system 305. It will be appreciated that the bus system 305 is used to enable communications among the components connected. The bus system 505 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 305 in fig. 3.

The user interface 303 may include, among other things, a display, a keyboard, a mouse, a trackball, a click wheel, a key, a button, a touch pad, or a touch screen.

It will be appreciated that the memory 302 can be either volatile memory or nonvolatile memory, and can include both volatile and nonvolatile memory. Among them, the nonvolatile Memory may be a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a magnetic random access Memory (FRAM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical disk, or a Compact Disc Read-Only Memory (CD-ROM); the magnetic surface storage may be disk storage or tape storage. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of illustration and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Enhanced Synchronous Dynamic Random Access Memory (Enhanced DRAM), Synchronous Dynamic Random Access Memory (SLDRAM), Direct Memory (DRmb Access), and Random Access Memory (DRAM). The memory 302 described in embodiments herein is intended to comprise, without being limited to, these and any other suitable types of memory.

The memory 302 in the embodiments of the present application is used to store various types of data to support the operation of the electronic device 300. Examples of such data include: any computer programs for operating on the electronic device 300, such as an operating system 3021 and application programs 3022; contact data; telephone book data; a message; a picture; audio, etc. Operating system 3021 includes various system programs, such as a framework layer, a core library layer, a driver layer, and the like, for implementing various basic services and for processing hardware-based tasks. The application programs 3022 may contain various application programs such as a Media Player (Media Player), a Browser (Browser), etc. for implementing various application services. A program for implementing the method according to the embodiment of the present application may be included in the application program 3022.

The method disclosed in the embodiment of the present application may be applied to the processor 301, or implemented by the processor 301. The processor 301 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 301. The Processor 301 may be a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. The processor 301 may implement or perform the methods, steps, and logic blocks disclosed in the embodiments of the present application. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed in the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium located in the memory 302, and the processor 301 reads the information in the memory 302 and performs the steps of the aforementioned methods in conjunction with its hardware.

In an exemplary embodiment, the electronic Device 300 may be implemented by one or more Application Specific Integrated Circuits (ASICs), DSPs, Programmable Logic Devices (PLDs), Complex Programmable Logic Devices (CPLDs), Field Programmable Gate Arrays (FPGAs), general purpose processors, controllers, Micro Controllers (MCUs), microprocessors (microprocessors), or other electronic components for performing the aforementioned methods.

In an exemplary embodiment, the present application further provides a computer readable storage medium, such as a memory 302, comprising a computer program, which is executable by a processor 301 of an electronic device 300 to perform the steps of the foregoing method. The computer readable storage medium can be Memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface Memory, optical disk, or CD-ROM; or may be a variety of devices including one or any combination of the above memories, such as a mobile phone, computer, tablet device, personal digital assistant, etc.

A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, performs: under the condition that at least one target application is in a running state and audio data are output through a first data path, if a connection event of at least one external audio device is detected, parameter information is obtained; wherein the target application in a running state has an audio output function;

if the parameter information indicates that the external audio equipment corresponds to a second data path, determining that the electronic equipment is in a first mode;

in the first mode, the audio data of the target application is output through the second data path and the first data path respectively, and the first data path and the second data path respectively represent different audio devices.

The computer program, when executed by the processor, further performs: and obtaining parameter information representing the type of the audio interface connected with the external audio equipment.

The computer program, when executed by the processor, further performs: obtaining parameter information characterizing the audio device type.

The computer program, when executed by the processor, further performs: the first data path characterizes a first wired audio device, the second data path characterizes a second wired audio device; the first wired audio equipment comprises built-in audio equipment and external audio equipment;

alternatively, the first data path characterizes a first wireless audio device and the second data path characterizes a second wireless audio device;

alternatively, the first data path characterizes a wired audio device and the second data path characterizes a wireless audio device; the wired audio equipment comprises built-in audio equipment and external audio equipment;

alternatively, the first data path characterizes a wireless audio device and the second data path characterizes a wired audio device, wherein the wired audio device includes an internal audio device and an external audio device.

The computer program, when executed by the processor, further performs: if the target applications in the running state have at least two target applications, determining the starting sequence of the at least two target applications;

determining that the first data path corresponds to a first target application of the at least two target applications and the second data path corresponds to a second target application of the at least two target applications according to the opening sequence of the at least two target applications;

outputting first audio data of the first target application through the first data path; outputting second audio data of the second target application through the second data path; wherein the first audio data and the second audio data are of different types.

The computer program, when executed by the processor, further performs: under the condition that the first data path outputs audio data through built-in audio equipment, if disconnection between the second data path and target audio equipment is detected, first prompt information is output through a display interface of the electronic equipment to prompt that the target audio equipment is disconnected, wherein the first prompt information carries an audio equipment identifier.

The computer program, when executed by the processor, further performs: under the condition that the first data path and the second data path are both connected with external audio equipment, if the first data path or the second data path is detected to be disconnected with target audio equipment, second prompt information is output through a display interface of the electronic equipment to prompt that the target audio equipment is disconnected, wherein the second prompt information carries an audio equipment identifier.

The computer program, when executed by the processor, further performs: under the condition that the first data path or the second data path is disconnected with the target audio equipment, if an output instruction aiming at the target audio data is detected, third prompt information is output through a display interface of the electronic equipment to prompt the target audio equipment to be connected, wherein the third prompt information carries an audio equipment identifier.

In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.

The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.

The methods disclosed in the several method embodiments provided in the present application may be combined arbitrarily without conflict to obtain new method embodiments.

Features disclosed in several of the product embodiments provided in the present application may be combined in any combination to yield new product embodiments without conflict.

The features disclosed in the several method or apparatus embodiments provided in the present application may be combined arbitrarily, without conflict, to arrive at new method embodiments or apparatus embodiments.

The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

17页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种具备感光功能的会议机

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类