CN112181353B - Audio playing method and device, electronic equipment and storage medium - Google Patents

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

Info

Publication number
CN112181353B
CN112181353B CN202011105792.0A CN202011105792A CN112181353B CN 112181353 B CN112181353 B CN 112181353B CN 202011105792 A CN202011105792 A CN 202011105792A CN 112181353 B CN112181353 B CN 112181353B
Authority
CN
China
Prior art keywords
audio
audio output
audio input
input devices
devices
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
CN202011105792.0A
Other languages
Chinese (zh)
Other versions
CN112181353A (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202011105792.0A priority Critical patent/CN112181353B/en
Publication of CN112181353A publication Critical patent/CN112181353A/en
Priority to PCT/CN2021/113242 priority patent/WO2022078056A1/en
Application granted granted Critical
Publication of CN112181353B publication Critical patent/CN112181353B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/16Sound input; Sound output
    • G06F3/165Management of the audio stream, e.g. setting of volume, audio stream path
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units
    • G06F3/1454Digital output to display device ; Cooperation and interconnection of the display device with other functional units involving copying of the display data of a local workstation or window to a remote workstation or window so that an actual copy of the data is displayed simultaneously on two or more displays, e.g. teledisplay

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Circuit For Audible Band Transducer (AREA)

Abstract

The application discloses an audio playing method, an audio playing device, electronic equipment and a storage medium, wherein the method is applied to the electronic equipment, the electronic equipment comprises at least one built-in audio output device and at least one external audio output device, the audio output devices respectively comprise a plurality of audio output sound channels, and the method comprises the following steps: acquiring the number of a plurality of audio input devices and audio output devices; allocating at least one audio output channel of at least one audio output device to each audio input device based on the number of the plurality of audio input devices and the number of the audio output devices, wherein the allocated audio output channels of each audio input device are different; acquiring audio data transmitted by a plurality of audio input devices; and playing the audio data transmitted by each audio input device based on the audio output channel allocated to each audio input device. The method can be convenient for users to clearly distinguish the sound input by different audio input devices, and improves the user experience.

Description

Audio playing method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of audio technologies, and in particular, to an audio playing method and apparatus, an electronic device, and a storage medium.
Background
With the development of the technology level, the screen projection function has been widely applied to electronic devices. For example, a user may project a video screen in a resource providing device (e.g., a smart phone) to a resource display device (e.g., a television) for display, so that the user can view display content in the resource providing device on the resource display device conveniently. In addition, with the development of screen projection technology, in a screen projection application scene, video pictures played in a plurality of resource providing devices can be projected to the same resource display device for display. However, when the electronic device displays videos projected by multiple devices, audio data in the videos projected by the multiple devices are usually mixed and then played, so that a sound playing effect when the videos are projected on a screen is poor, and user experience is affected.
Disclosure of Invention
In view of the foregoing problems, the present application provides an audio playing method, an audio playing apparatus, an electronic device, and a storage medium.
In a first aspect, an embodiment of the present application provides an audio playing method applied to an electronic device, where the electronic device includes at least one built-in audio output device and at least one external audio output device, where the audio output devices each include a plurality of audio output channels, and the method includes: acquiring a plurality of audio input devices and the number of audio output devices, wherein the number of the audio input devices is used as a first number, and the number of the audio output devices is used as a second number; assigning at least one audio output channel of at least one audio output device to each audio input apparatus based on the first number and the second number; acquiring audio data transmitted by the plurality of audio input devices; and playing the audio data transmitted by each audio input device based on the audio output channel allocated to each audio input device.
In a second aspect, an embodiment of the present application provides an audio playing apparatus, which is applied to an electronic device, where the electronic device includes at least one built-in audio output apparatus and at least one external audio output apparatus, where the audio output apparatuses each include a plurality of audio output channels, and the apparatus includes: the device comprises a number determination module, an audio distribution module, an audio acquisition module and a playing module, wherein the number determination module is used for acquiring the number of a plurality of audio input devices and the number of audio output devices, the number of the plurality of audio input devices is used as a first number, and the number of the audio output devices is used as a second number; the audio allocation module is configured to allocate at least one audio output channel of at least one audio output device to each audio input apparatus based on the first number and the second number; the audio acquisition module is used for acquiring audio data transmitted by the plurality of audio input devices; the playing module is used for playing the audio data transmitted by each audio input device based on the audio output sound channel distributed to each audio input device.
In a third aspect, an embodiment of the present application provides an electronic device, including: one or more processors; a memory; one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the audio playback method provided by the first aspect above.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where a program code is stored in the computer-readable storage medium, and the program code may be called by a processor to execute the audio playing method provided in the first aspect.
According to the scheme, at least one audio output channel of at least one audio output device is distributed to each audio input device according to the number of the audio input devices and the number of the audio output devices, then audio data transmitted by the plurality of audio input devices are obtained, and based on the audio output channels distributed to each audio input device, the audio data transmitted by each audio input device is played, so that different audio output channels are distributed to different audio input devices, a user can conveniently and clearly distinguish sounds input by different audio input devices, and user experience is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 shows an architectural diagram of an application environment provided by an embodiment of the present application.
Fig. 2 shows another architecture diagram of an application environment provided by the embodiment of the present application.
Fig. 3 shows a flow chart of an audio playing method according to an embodiment of the application.
Fig. 4 shows a flow chart of an audio playing method according to another embodiment of the present application.
Fig. 5 shows a first schematic diagram of an audio playing method according to another embodiment of the present application.
Fig. 6 shows a second schematic diagram of an audio playing method according to another embodiment of the present application.
Fig. 7 is a schematic diagram illustrating a third principle of an audio playing method according to another embodiment of the present application.
Fig. 8 is a schematic diagram illustrating a fourth principle of an audio playing method according to another embodiment of the present application.
Fig. 9 is a schematic diagram illustrating a fifth principle of an audio playing method according to another embodiment of the present application.
Fig. 10 shows a sixth schematic diagram of an audio playing method according to another embodiment of the present application.
Fig. 11 shows a seventh schematic diagram of an audio playing method according to another embodiment of the present application.
Fig. 12 is a diagram illustrating an eighth schematic diagram of an audio playing method according to another embodiment of the present application.
Fig. 13 shows a flow chart of an audio playing method according to yet another embodiment of the present application.
Fig. 14 shows a flow chart of an audio playing method according to yet another embodiment of the present application.
Fig. 15 is a schematic diagram illustrating an audio playing method according to still another embodiment of the present application.
Fig. 16 shows a flow chart of an audio playing method according to yet another embodiment of the present application.
Fig. 17 shows a flowchart of an audio playback method according to yet another embodiment of the present application.
Fig. 18 shows a block diagram of an audio playback device according to an embodiment of the present application.
Fig. 19 is a block diagram of an electronic device for executing an audio playing method according to an embodiment of the present application.
Fig. 20 is a storage unit for storing or carrying program codes for implementing an audio playing method according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
At present, the screen projection function is widely applied in life, and a user can project contents displayed in one device to another device for display and can transmit audio data to another device for playing. For example, when a user plays a video through a smart phone, the video played on the mobile terminal can be projected to another device (e.g., a smart television) for display, and audio data of the video is transmitted to another device for playing, so that the user can have better video watching experience; for another example, when the user plays music through the smart watch, the user may project the audio playing interface displayed on the smart watch onto the computer for displaying, and output the played music through the computer.
Gradually, some electronic devices can display contents projected by multiple devices and play audio data input by the multiple devices, but when playing audio data input by the multiple devices, the electronic devices usually mix and output the audio input by the multiple devices, but when playing the audio data after mixing, a user cannot distinguish the audio input by each device, which causes a confusing feeling, and a poor playing effect is caused.
In view of the above problems, the inventor proposes an audio playing method, an audio playing apparatus, an electronic device, and a storage medium provided in the embodiments of the present application, which can allocate different audio output channels to different audio input devices, so as to facilitate a user to clearly distinguish sounds input by different audio input devices, thereby improving user experience. The specific audio playing method is described in detail in the following embodiments.
An application environment of the video rendering method provided by the embodiment of the present application is described below.
Referring to fig. 1, fig. 1 shows an architecture diagram of an application scenario for an embodiment of the present application, which may include an electronic device 100 and a plurality of input devices 200. The electronic device 100 may be a smart television as shown in fig. 1, and of course, the electronic device 100 may also be other devices with a display function, for example, a desktop computer, a notebook computer, and the like, which is not limited herein. The input device 200 may be a smart phone, a tablet computer, a smart watch, a computer, or the like. In this application scenario, the input device 200 may serve as a resource providing device, and project the display content to the electronic device 100 for display, and of course, the input device 200 may also transmit the audio content to the electronic device 100 for playing.
In some embodiments, electronic device 100 and input device 200 may communicate to accomplish data interaction. The electronic device 100 and the input device 200 may communicate via a Local Area Network (LAN) or a Wide Area Network (WAN). For example, the electronic device 100 and the input device 200 may be connected to a router at the same time, and the electronic device 100 and the input device 200 may communicate through a local area network provided by the router; for another example, the electronic device 100 and the input device 200 may communicate with a cloud, and implement data interaction between the two through the cloud; for another example, the electronic device 100 and the input device 200 may also establish an end-to-end network connection (i.e., a P2P network connection) through a communication manner such as bluetooth, Zigbee, WebRTC, and the like, and perform communication through the established network connection. Of course, the communication mode between the electronic device 100 and the input device 200 may not be limited.
In some scenarios, the electronic device 100 may be a large-screen device (e.g., a smart television shown in fig. 1), and a user may project display content on a small-screen device such as a smart phone, a tablet computer, and a smart watch to the large-screen device for displaying, so as to improve experience of the user when viewing the display content. In addition, the electronic device 100 can receive the content projected by the plurality of input devices 200 at the same time and display the content projected by the plurality of input devices 200, so that the content projected by the plurality of input devices 200 can be displayed on the electronic device 100, a user can view the content projected by the plurality of input devices 200 at the same time, and user experience is greatly improved.
In some embodiments, the electronic device 100 may perform a display layout (for example, a layout position, a size of a display area, and the like) on the display contents input by the plurality of input devices according to the received display contents of the plurality of input devices 100, and then render the display contents input by the plurality of input devices based on the display layout and then display the rendered display contents on the display screen.
In some embodiments, the electronic device 100 may include a content receiving module, a first capability negotiation module, a layout generation module, and a display rendering module; the input device 200 may include a content acquisition module, a content transmission module, and a second capability negotiation module.
The input device 200 may first acquire content as content to be displayed through the content acquisition module, and then transmit the content to be displayed to the electronic device 100 through the content transmission module in a wireless manner, and the content reception module is responsible for receiving the content at the electronic device 100. Meanwhile, the second capability negotiation module of the input device 200 and the first capability negotiation module of the electronic device 100 are responsible for negotiating the software and hardware capabilities of both parties, and at the same time, the electronic device 100 dynamically negotiates optimal display parameters (such as resolution/bit rate/frame rate) according to the path number of the current picture, that is, the size of the display area, and feeds back the optimal display parameters to the input device 200 for adaptive adjustment. The layout generating module of the electronic device 100 dynamically generates a display layout according to the layout principle by comprehensively considering various factors according to the current constraint conditions (e.g., the number of the input devices connected, the display parameter information of the input devices, the display parameter information of the electronic device, etc.). After the current layout mode is generated, the display rendering module draws and displays the content to be displayed according to the layout.
Referring to fig. 2, the electronic device 100 may include at least one built-in first audio output device 140 and at least one external second audio output device 150. Wherein the first audio output device 141 comprises at least one first audio output channel 142 and the second audio output device 143 comprises at least one second audio output channel 144. It should be noted that the number of the first audio output devices 141 may not be limited (only 1 is shown in fig. 2), the number of the second audio output devices 143 may not be limited (only 2 is shown in fig. 2), the number of the first audio output channels of the first audio output devices 141 may not be limited (only 4 is shown in fig. 2), and the number of the second audio output channels of the second audio output devices 143 may not be limited (only 2 is shown in fig. 2). The electronic device 100 may output sound through the audio output channels of the above audio output apparatuses, and when the electronic device 100 receives and outputs audio data input by the plurality of input devices 200, the electronic device 100 may allocate at least one audio output channel of at least one audio output apparatus to the plurality of input devices 200, and ensure that the audio output channels allocated to each input device 200 are different, so that the audio data of each input device 200 may not share the same audio output channel to output the audio data, and a user may distinguish sounds corresponding to the audio data of different input devices.
Referring to fig. 3, fig. 3 is a flowchart illustrating an audio playing method according to an embodiment of the present application. In a specific embodiment, the audio playing method is applied to the audio playing apparatus 400 shown in fig. 18 and the electronic device 100 (fig. 19) equipped with the audio playing apparatus 400. The electronic equipment comprises at least one built-in audio output device and at least one external audio output device, wherein the audio output devices comprise a plurality of audio output sound channels. The following will describe a specific flow of the embodiment by taking an electronic device as an example, and it is understood that the electronic device applied in the embodiment may be a smart television, a notebook computer, a desktop computer, and the like, which is not limited herein. As will be described in detail with respect to the flow shown in fig. 3, the audio playing method may specifically include the following steps:
step S110: and acquiring a plurality of audio input devices and the number of the audio output devices, wherein the number of the audio input devices is used as a first number, and the number of the audio output devices is used as a second number.
In this embodiment, the electronic device may receive input audio data from a plurality of audio input devices, and play the received audio data based on an audio output channel of a built-in audio output apparatus and an external audio output apparatus.
In some embodiments, the audio input device may be an input device in a screen-projection scene, and the audio input device may input audio data to the electronic device for playing, or may input display content to the electronic device for displaying.
In some implementations, the electronic device can establish a network connection with the respective audio input device to receive input data from the audio input device according to the established network connection. The electronic device may establish a network connection with the audio input device in a wireless communication manner, for example, the network connection may be established in a bluetooth manner, a WiFi network manner, and the specific communication manner may not be limited.
For example, when the electronic device establishes a network connection with the audio input device through a WiFi network, the electronic device may display a device list under the same WiFi network, detect a selection operation of the device by the user, and establish a network connection with the device selected by the user according to the detected selection operation. Similarly, the network connection between the electronic device and the audio input device may also be established according to the operation of the user on the audio input device, for the audio input device, such as a smart phone, the audio input device may also display a device list of the electronic devices in the same WiFi network, then detect the selection operation of the user on the device, and establish the network connection with the electronic device selected by the user according to the detected selection operation.
In this embodiment of the application, when the electronic device plays audio data input by the audio input device, the number of the audio input devices that input the audio data at this time and the number of the audio output apparatuses of the electronic device may be determined, so as to allocate audio output channels corresponding to the audio input device according to the determined number of the audio input devices and the determined number of the audio output apparatuses. Wherein the determined number of audio input devices may be a first number and the determined number of audio output apparatuses may be a second number.
In some implementations, the electronic device can determine the number of audio input devices based on the audio input devices currently having a network connection established. The electronic equipment can detect the external audio output devices, determine the number of the built-in audio output devices, and then obtain the sum of the number of the external audio output devices and the number of the built-in audio output devices, namely obtain the number of the audio output devices. As one mode, when the electronic device establishes a network connection with the audio input device, the audio input device does not necessarily start to project a screen or input audio to the electronic device, so that the electronic device may determine the number of the audio input devices that actually perform screen projection or input audio data to the electronic device, for example, the electronic device may determine the number of the audio input devices that send a screen projection instruction to the electronic device and establish a network connection with the electronic device.
Step S120: assigning at least one audio output channel of at least one audio output device to each audio input device based on the first number and the second number, wherein the assigned audio output channels are different for each audio input device.
In this embodiment, after determining the number of the audio input devices and the number of the audio output apparatuses, the electronic device may allocate audio output channels to the audio input devices according to the first number and the second number. Wherein the electronic device may assign at least one audio output channel of the at least one audio output means to each audio input device based on the first number and the second number.
In some embodiments, the electronic device may try to ensure that all audio output channels of one audio output device are allocated to the audio input device according to a principle of preferentially allocating the entire audio output device to the audio input device; when the number of the audio output devices cannot guarantee that all audio output channels of one audio output device can be allocated to the audio input devices, different channels of the audio output device are allocated to different audio input devices, and it is guaranteed that the audio output channels allocated to each audio input device are different, so that at least part of audio data of the audio input devices can be played by the complete audio output device (namely all channels of the audio output device are used for playing the audio data of one audio input device), and a user can conveniently distinguish playing sounds corresponding to the audio data of different audio input devices.
Step S130: and acquiring audio data transmitted by the plurality of audio input devices.
In the embodiment of the present application, after the electronic device allocates the audio output channel to each audio input device, the electronic device may acquire the audio data input by the audio input devices for playing. The electronic device can receive the audio data transmitted by the audio input device according to the network connection established with the audio input device, namely, the audio data to be played is obtained. In some embodiments, the audio data input by the audio input device may be audio data of music, video, game, and the like, which is not limited herein.
Step S140: and playing the audio data transmitted by each audio input device based on the audio output channel allocated to each audio input device.
In this embodiment of the application, after acquiring the audio data input by the multiple audio input devices, the electronic device may demultiplex the audio data, decode the audio data, and play the audio data transmitted by each audio input device according to the audio output channel allocated to each audio input device.
According to the audio playing method provided by the embodiment of the application, at least one audio output channel of at least one audio output device is allocated to each audio input device according to the number of the audio input devices and the number of the audio output devices, then the audio data transmitted by the plurality of audio input devices is obtained, and the audio data transmitted by each audio input device is played based on the audio output channels allocated to each audio input device, so that different audio output channels are allocated to different audio input devices, a user can conveniently and clearly distinguish sounds input by different audio input devices, and the user experience is improved. In addition, because the electronic equipment is not only internally provided with the audio output device, but also externally connected with the audio output device, and each audio output device comprises a plurality of audio output channels, when the number of the audio input equipment is large, the audio data input by the audio input equipment can be ensured to be played on different audio output channels, and the sound playing effect is improved.
Referring to fig. 4, fig. 4 is a flowchart illustrating an audio playing method according to another embodiment of the present application. The audio playing method is applied to the electronic device, and will be described in detail with reference to the flow shown in fig. 4, where the audio playing method may specifically include the following steps:
step S200: and acquiring a plurality of audio input devices and the number of the audio output devices, wherein the number of the audio input devices is used as a first number, and the number of the audio output devices is used as a second number.
In the embodiment of the present application, the step S200 may refer to the contents of the foregoing embodiments, and is not described herein again.
Step S210: it is determined whether the second number is greater than the first number.
In this embodiment, the electronic device may ensure that all audio output channels of one audio output device are allocated to the audio input device as much as possible according to a principle that the entire audio output device is preferentially allocated to the audio input device. After acquiring the first number of audio input devices and the second number of audio output devices, the electronic device may compare the second number with the first number, and then determine whether the second number is smaller than the first number according to a comparison result. It is understood that if the second number is greater than or equal to the first number, it means that the number of audio output devices is greater than or equal to the number of audio input devices, and thus each audio input device can be assigned to at least one complete audio output device; if the second number is smaller than the first number, it means that the number of audio output devices is smaller than the number of audio input devices, and thus it cannot be guaranteed that each audio input device can be assigned to at least one complete audio output device.
Step S220: if the second number is greater than or equal to the first number, all audio output channels of at least one audio output device are allocated to each audio input device.
In this embodiment, if the electronic device determines that the second number is greater than or equal to the first number, the number of the audio output apparatuses at this time may ensure that each audio input device is allocated to obtain at least one complete audio output apparatus, that is, for one audio input device, all audio output channels of the allocated audio output apparatus are used for playing the audio data of the audio input device. In this case, therefore, the electronic device may assign all audio output channels of at least one audio output apparatus to each audio input device and ensure that the assigned audio output apparatuses are different for each audio input device.
For example, referring to fig. 5, when the number of the audio input devices 200 is 1 and the audio output devices include the first audio output device 140a and the second audio output device 140b, the number of the audio output devices is 2, and the number of the audio input devices is 1, so that the first audio output device 140a and the second audio output device 140b can be allocated to the audio input device 200, and the audio data input by the audio input device 200 can be played by all the audio output channels of the first audio output device 140a and the second audio output device 140b at the same time.
For example, referring to fig. 6, the audio input device includes: the audio output devices include a first audio input device 201 and a second audio input device 202, where the number of audio output devices is 2, the number of audio input devices is 2, and the number of audio output devices just satisfies that each audio input device is assigned a complete audio output device, so that the first audio input device 201 can be assigned the first audio output device 140a, and the second audio input device 202 can be assigned the second audio output device 140b, so that audio data input by the first audio input device 201 can be played by all audio output channels of the first audio output device 140a, and audio data input by the second audio input device 202 can be played by all output channels of the second audio output device 140 b.
Illustratively, referring to fig. 7, the audio input device includes: the audio output devices include a first audio input device 201, a second audio input device 202 and a third audio input device 203, the audio output devices include a first audio output device 140a, a second audio output device 140b and a third audio output device 140c, the number of the audio output devices is 3, the number of the audio input devices is 3, and the number of the audio output devices just satisfies that each audio input device is allocated with a complete audio output device, so that the first audio input device 201 can be allocated with the first audio output device 140a, the second audio input device 202 is allocated with the second audio output device 140b, and the third audio input device 203 is allocated with the third audio output device 140c, so that the audio data input by the first audio input device 201 can be played by all audio output channels of the first audio output device 140a, and the audio data input by the second audio input device 202 can be played by all audio output channels of the second audio output device 140b The output channels are played, and the audio data inputted by the third audio input device 203 can be played by all the output channels of the second audio output apparatus 140 c.
Similarly, referring to fig. 8, when the number of the audio input devices is 4 and the number of the audio output devices is 4, one audio output device can be allocated to each audio input device, so that the audio data input by each audio input device is played by all the audio output channels of one audio output device.
Step S230: and if the second number is smaller than the first number, acquiring the number of the audio output channels of all the audio output devices as a third number.
In this embodiment, if the electronic device determines that the second number is smaller than the first number, the number of the audio output devices is not enough to allocate each audio input device to at least one complete audio output device. In this case, the electronic device may determine whether all audio output channels of at least one complete audio output apparatus can be assigned to a part of the audio input device, and then assign the audio output channels.
In some embodiments, the number of audio output channels per audio output device is the same, e.g., all 2, all 4, etc. The electronic apparatus may determine the number of audio output channels of all the audio output devices as the third number when it is judged that the second number is smaller than the first number. As one way, the electronic apparatus may acquire device information of each audio output device and then determine the number of audio output channels from the device information.
Step S240: obtaining a ratio of the third quantity to the first quantity.
Step S250: and if the ratio is larger than a set threshold value, distributing all audio output channels of at least one audio output device to part of the audio input devices.
In the embodiment of the present application, after acquiring the number of audio output channels of all audio output apparatuses, the electronic device may acquire a ratio between the third number of all audio output channels and the first number of all audio input apparatuses, so as to determine whether all audio output channels of at least one complete audio output apparatus may be allocated to a part of the audio input apparatuses according to the ratio. After the ratio is obtained, the electronic device may compare the ratio with a set threshold, where the set threshold is determined according to the number of audio output channels of the single audio output device. When the ratio is greater than the set threshold, the number of audio output channels is more, and all audio output channels of at least one complete audio output device can be distributed to at least part of audio input equipment; when the ratio is not greater than the set threshold, it means that there are fewer audio output channels, and if all audio output channels of at least one complete audio output device are allocated to at least some audio input devices, other audio input devices cannot be allocated to at least one audio output channel, or the audio output channels are allocated unevenly, resulting in uneven loudness of the audio input by each audio input device heard by the user, and poor experience.
In some embodiments, when the above ratio is greater than the set threshold, the electronic device allocates all audio output channels of at least one complete audio output apparatus to at least part of the audio input devices, the number of audio input devices to which the complete audio output apparatus can be allocated may be determined, and then the number of audio input devices is allocated to all audio output channels of at least one audio output apparatus, and it is ensured that the audio output apparatuses allocated to the audio input devices are different.
Optionally, each of the audio input devices of the number of audio input devices may allocate all audio output channels of one audio output apparatus, so as to avoid that the audio output channels allocated to the other audio input devices to which the complete audio output apparatus cannot be allocated are fewer, and that the sound loudness of the audio input by each audio input device heard by the user is uneven, which results in poor experience.
In some embodiments, the electronic device assigning all audio output channels of the at least one audio output apparatus to some of the plurality of audio input devices may include:
determining the number of audio input devices of the plurality of audio input devices that allocate all audio output channels of one audio output apparatus as a fourth number; acquiring the priority of each audio input device in the plurality of audio input devices; determining the fourth number of audio input devices from the plurality of audio input devices as the partial audio input devices based on the priority of each audio input device, wherein the partial audio input devices have a higher priority than the other audio input devices; all audio output channels of an audio output device are assigned to the part of the audio input apparatus.
In this embodiment, the electronic device assigns all audio output channels of one audio output apparatus to each of the partial audio input devices. After the electronic equipment determines the number of the audio input equipment capable of distributing complete audio output devices, the electronic equipment determines the number of the audio input equipment with relatively higher priority as the audio input equipment capable of distributing one audio output device according to the priority of the audio input equipment, and then distributes all audio output channels for audio output promotion to the audio input equipment. Therefore, the audio input equipment with relatively high priority can be distributed with a complete audio output device, and when the audio is played, the audio input equipment can be different from the audio input equipment input by other audio input equipment, so that the requirements of users can be better met, and the user experience is improved.
As an embodiment, the priority of the audio input device may be set according to the user's needs. For example, the electronic device may present an interface for setting the priority of the respective audio input devices for the user to set the priority of the respective audio input devices.
As another embodiment, the priority of the audio input device may be determined based on the type of audio input device. Illustratively, the audio input devices may be classified into: the priority of the audio input device is sequentially reduced according to the sequence of the desktop computer, the notebook computer, the tablet computer, the smart phone and the smart watch, and the above is only an example and does not represent the limitation on the actual priority.
In some embodiments, the electronic device determines the number of audio input devices of the plurality of audio input devices that allocate all audio output channels of an audio output apparatus, and may determine the number according to the above ratio. For example, the integer part of the ratio may be taken as the number, so that more audio input devices may be assigned to all audio output channels of one audio output apparatus; for another example, the value obtained by subtracting 1 from the integer part of the ratio may be used as the number, so that some audio input devices may be assigned to all audio output channels of one audio output apparatus, and the occurrence of uneven sound volume may be avoided.
In some embodiments, the above threshold setting is determined according to the number of audio output channels of a single audio output device, and since the number of audio output channels of each audio output device is the same, the threshold setting may be determined by the number of audio output channels of any one audio output device. For example, if the number of audio output channels of a single audio output device is 4, the set threshold may be 2. Of course, the specific determination mode for setting the threshold may not be limited.
For example, referring to fig. 9, the audio input device includes: the audio output devices include a first audio output device 140a and a second audio output device 140b, and the number of audio output channels of the first audio output device 140a and the second audio output device 140b is 4. At this time, the number of all audio output devices is 8, the number of audio input apparatuses is 3, and the ratio of the number of all audio output devices to the number of audio input apparatuses is greater than 2, so that the first audio input apparatus 201 may be assigned the first audio output device 140a, the second audio input apparatus 202 may be assigned the audio output channels b1 and b2 of the second audio output device 140b, and the third audio input apparatus 203 may be assigned the audio output channels b3 and b4 of the second audio output device.
Illustratively, referring to fig. 10, the audio input device includes: the audio output devices include a first audio output device 140a, a second audio output device 140b and a third audio output device 140c, and the number of audio output channels of the first audio output device 140a, the second audio output device 140b and the third audio output device 140c is 4. At this time, the number of all audio output devices is 12, the number of audio input apparatuses is 4, and the ratio of the number of all audio output devices to the number of audio input apparatuses is greater than 2, so that it is possible to allocate the first audio input apparatus 201 to the first audio output device 140a, allocate the second audio input apparatus 202 to the second audio output device 140b, allocate the third audio input apparatus 203 to the audio output channels c1 and c2 of the third audio output device 140c, and allocate the fourth audio input apparatus 204 to the audio output channels c3 and c4 of the third audio output device 140 c.
Step S260: at least one audio output channel of the remaining audio output means is assigned to each of the other audio input devices.
In this embodiment, after allocating all audio output channels of one audio output apparatus to the above part of the audio input apparatuses, the electronic device may allocate at least one audio output channel of the remaining audio output apparatuses to each of the other audio input apparatuses, where the other audio input apparatuses are the audio input apparatuses other than the part of the audio input apparatuses in the plurality of audio input apparatuses, and ensure that the audio output channels allocated to the different audio input apparatuses in the other audio input apparatuses are different.
Step S270: and if the ratio is less than or equal to a set threshold, allocating at least one audio output channel to each audio input device in the plurality of audio input devices.
In the embodiment of the present application, if the electronic device determines that the ratio is smaller than or equal to the set threshold, it indicates that none of the audio input devices can be assigned with all audio output channels of an audio output apparatus, so that at least one audio output channel can be assigned to each audio input device according to a principle that ensures that each audio input device is assigned with at least one audio output channel.
For example, referring to fig. 11, the audio input device includes: the audio output devices include a first audio output device 140a and a second audio output device 140b, and the number of audio output channels of the first audio output device 140a and the second audio output device 140b is 4. At this time, the number of all audio output apparatuses is 8, the number of audio input devices is 4, and the ratio of the number of all audio output apparatuses to the number of audio input devices is equal to 2, so that it is possible to allocate the audio output channels a1 and a2 of the first audio output apparatus 140a to the first audio input device 201, the audio output channels a3 and a4 of the first audio output apparatus 140a to the second audio input device 202, the audio output channels b1 and b2 of the second audio output apparatus 140b to the third audio input device 203, and the audio output channels b3 and b4 of the second audio output apparatus 140b to the fourth audio input device 204.
In some embodiments, since the above is performed based on the case that the number of audio output channels of each audio output device is the same when the second number is smaller than the first number, the electronic apparatus may further determine whether the number of audio output channels of each audio output device is the same before performing the step S230 to acquire the number of audio output channels of all audio output devices, and perform the acquisition of the number of audio output channels of all audio output devices when the number is the same; if the audio input devices are different, the audio output channels can be allocated to the audio input devices according to the principle that all the audio output channels of one audio output device are allocated to some audio input devices as much as possible.
Step S280: and acquiring audio data transmitted by the plurality of audio input devices.
Step S290: and playing the audio data transmitted by each audio input device based on the audio output channel allocated to each audio input device.
In the embodiment of the present application, step S280 and step S290 may refer to the contents of the foregoing embodiments, and are not described herein again.
In some embodiments, the electronic device may have no external audio output apparatus, and in this case, the electronic device may have only one audio output apparatus, and in this case, the at least one audio output channel may be allocated to the audio input devices according to a principle that ensures that the at least one audio output channel is allocated to each audio input device. Illustratively, referring to fig. 12, the audio input device includes: first audio input device 201 and second audio input device 202, the audio output means comprising first audio output device 140a, in which case the audio output channels a1 and a2 of first audio output device 140a may be assigned to first audio input device 201, and the audio output channels a3 and a4 of first audio output device 140a may be assigned to second audio input device 202.
According to the audio playing method provided by the embodiment of the application, when a plurality of audio input devices input audio to the electronic device for playing, according to the principle that all audio output channels of at least one audio output device are preferentially allocated to the audio input devices, different audio output channels are allocated to the audio input devices based on the relation between the number of the audio input devices and the number of the audio output devices, so that the audio data of different audio input devices can be played through different audio output channels, the audio data of the audio input devices can be preferentially output through all audio output channels of at least one audio output device, and the audio playing effect is improved.
Referring to fig. 13, fig. 13 is a flowchart illustrating an audio playing method according to another embodiment of the present application. The audio playing method is applied to the electronic device, and will be described in detail with reference to the flow shown in fig. 13, where the audio playing method may specifically include the following steps:
step S310: and acquiring a plurality of audio input devices and the number of the audio output devices, wherein the number of the audio input devices is used as a first number, and the number of the audio output devices is used as a second number.
In the embodiment of the present application, the step S310 may refer to the contents of the foregoing embodiments, and is not described herein again.
Step S320: and acquiring the relative position relation between each audio input device and the electronic device.
In embodiments of the present application, the relative positional relationship may be used to characterize the relative distance and relative angle of the audio input device and the electronic device.
In this embodiment, the audio input device may be located right in front of the electronic device, may be located left in front of the electronic device, may be located right in front of the electronic device, may be located upper in front of the electronic device, may be located lower in front of the electronic device, and the like, and the second source device may be located right in front of the electronic device, may be located left in front of the electronic device, may be located right in front of the electronic device, may be located upper in front of the electronic device, may be located lower in front of the electronic device, and the like, which is not limited herein.
As a first mode, the electronic device may include an Ultra Wide Band (UWB) sensor, and the audio input device may also include an ultra wide band sensor, so that the electronic device may obtain a relative position relationship between the audio input device and the electronic device through the ultra wide band sensors of the electronic device and the ultra wide band sensor.
As a second way, the electronic device may include an image capturing device, and then the relative position relationship between the audio input device and the electronic device may be obtained through the image capturing device.
Step S330: and allocating at least one audio output channel of at least one audio output device to each audio input device based on the first number, the second number and the relative position relationship between each audio input device and the electronic equipment, wherein the allocated audio output channel of each audio input device corresponds to the relative position relationship.
In the embodiment of the present application, when the electronic device assigns an audio output channel to each audio input device, the electronic device may refer to the relative positional relationship between the audio input device and the electronic device, in addition to the number of audio output apparatuses and the number of audio input devices. Similarly, the electronic device may allocate all audio output channels of one audio output device to the audio input device as far as possible according to the principle of preferentially allocating the entire audio output device to the audio input device; when the number of the audio output devices cannot guarantee that all audio output channels of one audio output device can be allocated to the audio input devices, different channels of the audio output devices are allocated to different audio input devices, and it is guaranteed that the audio output channels allocated to each audio input device are different, so that at least part of audio data of the audio input devices can be played by the complete audio output devices (namely all channels of the audio output devices are used for playing the audio data of one audio input device), and a user can conveniently distinguish playing sounds corresponding to the audio data of different audio input devices. Besides, when the electronic device allocates the audio output channel, the audio output channel allocated to the audio input device can be made to be close to the audio input device according to the above relative position relationship, for example, if the audio input device 1 is located on the left side of the electronic device, the audio output channel on the left side can be allocated to the audio input device 1; the audio input device 2 is located on the right side of the electronic device, and the right audio output channel may be assigned to the audio input device 2.
In some embodiments, the electronic device may allocate, according to the first number and the second number, a corresponding number of audio output channels to each audio input device, and then allocate, according to a relative position relationship between the audio input device and the electronic device and a position of the audio output channels, a corresponding number of audio output channels to the audio input device.
Step S340: and acquiring audio data transmitted by the plurality of audio input devices.
Step S350: and playing the audio data transmitted by each audio input device based on the audio output channel allocated to each audio input device.
In the embodiment of the present application, step S340 and step S350 may refer to the contents of the foregoing embodiments, and are not described herein again.
According to the audio playing method provided by the embodiment of the application, when a plurality of audio input devices input audio to the electronic device for playing, according to the principle that all audio output channels of at least one audio output device are preferentially allocated to the audio input devices, different audio output channels are allocated to the audio input devices based on the number of the audio input devices, the number of the audio output devices and the relative position relationship between the audio input devices and the electronic device, so that the audio data of different audio input devices are played through different audio output channels, and the audio output channels can be ensured to correspond to the relative position relationship, so that a user can distinguish the playing sound of the audio data of different audio input devices conveniently, and the audio playing effect is improved.
Referring to fig. 14, fig. 14 is a flowchart illustrating an audio playing method according to still another embodiment of the present application. The audio playing method is applied to the electronic device, and will be described in detail with reference to the flow shown in fig. 14, where the audio playing method may specifically include the following steps:
step S410: and acquiring a plurality of audio input devices and the number of the audio output devices, wherein the number of the audio input devices is used as a first number, and the number of the audio output devices is used as a second number.
In the embodiment of the present application, step S410 may refer to the contents of the foregoing embodiments, and is not described herein again.
Step S420: and acquiring the distance of each audio input device relative to the electronic device.
In the embodiment of the application, the electronic device may further obtain a distance of each audio input device relative to the electronic device. As one way, the electronic device may obtain the distance of each audio input device relative to the electronic device through a distance sensor; as another mode, the electronic device may be provided with a plurality of depth cameras, and the distance between each audio input device and the electronic device may be determined through the depth images collected by the depth cameras.
Step S430: allocating at least one audio output channel of at least one audio output device to each audio input device based on the first number, the second number and the distance of each audio input device relative to the electronic device, wherein the number of the audio output channels allocated to each audio input device is positively correlated with the distance.
In the embodiment of the application, when the electronic device allocates the audio output channels to each audio input device, the electronic device may refer to the distance between the audio input device and the electronic device in addition to the number of the audio output apparatuses and the number of the audio input devices. Similarly, the electronic device may allocate the entire audio output device to the audio input device according to a principle of preferentially allocating the entire audio output device to the audio input device, and the distance between the audio input device and the electronic device is referred to, so that the audio output channels allocated to each audio input device are different, and the number of the audio output channels allocated to each audio input device is positively correlated to the distance. That is, the greater the distance, the greater the number of audio output channels allocated, and the different numbers of audio output channels allocated, the different volumes of sound produced, thereby enabling the user to easily sensorially distinguish the audio sounds of different audio input devices.
In some embodiments, the electronic device may preferentially determine, according to the distance, the number of audio output channels allocated by each audio input device, and the number of audio output channels allocated by each audio input device is positively correlated to the distance. On the basis, under the condition that the number of the audio output channels distributed by each audio input device is not changed, the audio output channels of all the audio output devices are distributed to the audio input devices according to the first number and the second number, so that the condition that as many audio input devices as possible are distributed to the complete audio output devices, namely all the audio output channels of at least one audio deleting device is ensured.
Step S440: and acquiring audio data transmitted by the plurality of audio input devices.
Step S450: and playing the audio data transmitted by each audio input device based on the audio output channel allocated to each audio input device.
In the embodiment of the present application, step S440 and step S450 may refer to the contents of the foregoing embodiments, and are not described herein again.
According to the audio playing method provided by the embodiment of the application, when a plurality of audio input devices input audio to the electronic device for playing, all audio output channels of at least one audio output device are allocated to the audio input devices according to the principle that the audio input devices are preferentially allocated with all audio output channels, different audio output channels are allocated to the audio input devices based on the number of the audio input devices, the number of the audio output devices and the distance between the audio input devices and the electronic device, it is ensured that audio data of different audio input devices are played through different audio output channels, and the number of the audio output channels corresponds to the distance, so that a user can distinguish playing sounds of the audio data of different audio input devices conveniently, and an audio playing effect is improved.
Referring to fig. 15, fig. 15 is a flowchart illustrating an audio playing method according to yet another embodiment of the present application. The audio playing method is applied to the electronic device, and will be described in detail with reference to the flow shown in fig. 15, where the audio playing method may specifically include the following steps:
step S510: and acquiring a plurality of audio input devices and the number of the audio output devices, wherein the number of the audio input devices is used as a first number, and the number of the audio output devices is used as a second number.
In the embodiment of the present application, the content of the foregoing embodiment can be referred to in step S510, and details are not repeated herein.
Step S520: and displaying and distributing the resources to be displayed corresponding to each audio input device.
In this embodiment of the application, the audio input device may be an input device in a screen projection scene, and the audio input device may not only input display content to the electronic device for display, but also input audio data to the electronic device for playing. In a screen projection scene, the electronic device may perform display layout on the resource to be displayed corresponding to each audio input device, so that when the resource to be displayed is displayed, the resource to be displayed input by the plurality of input devices is displayed according to the display layout. Wherein the display layout may include at least: the position of each video in the preset window, the size of the area of each video in the preset window, and the like, which are not limited herein. The resource to be displayed may include video, music, documents, games, etc., and is not limited herein.
In some embodiments, the obtaining, by the electronic device, a display layout of resources to be displayed of the plurality of audio input devices in a preset window may include: acquiring the number of resources to be displayed of a plurality of audio input devices; and generating a display layout of the resources to be displayed of the plurality of audio input devices in the interface based on the number.
In this embodiment, the electronic device may divide the display interface into a plurality of regions based on the number of resources to be displayed of the plurality of audio input devices, and then correspond each of the plurality of regions to one video, thereby generating a display layout of the resources to be displayed of each audio input device in the display interface. The ratio of the sum of the areas occupied by the resources to be displayed of the plurality of audio input devices in the display interface to the area of the display interface can be the largest. The positions and the sizes of the resources to be displayed of the audio input devices in the display interface are arranged in the layout mode, so that the proportion of the resources to be displayed of the audio input devices in the display interface can be the largest, and the area in the display interface can be fully utilized.
In other embodiments, the electronic device may also generate the display layout based on display parameters of resources to be displayed of the plurality of audio input devices in their corresponding audio input devices. Similarly, the ratio of the sum of the areas occupied by the resources to be displayed of the plurality of audio input devices in the display interface to the area of the display interface can be maximized. The display parameters may include size information and a display state of the resource to be displayed of each audio input device in the audio input device, where the size information may include "length", "width", "aspect ratio", "area", and the like, and the display state may include a landscape display state and a portrait display state.
As a manner, the audio input device corresponding to the resource to be displayed may use JavaScript to determine that the audio input device is in the landscape display state or the portrait display state, and specifically, the audio input device generally supports the window orientation parameter, and then the audio input device may determine the display state thereof through the window orientation parameter, and send the display state to the electronic device. In addition, the electronic device can acquire the size information of the video, that is, the electronic device can acquire the size information of the video, such as "length", "width", "aspect ratio", "area", and the like. As one way, the audio input device may obtain its resizable information using JavaScript and send the size information to the electronic device.
In this embodiment, the electronic device determines the display layout by obtaining display parameters for resources to be displayed for the plurality of audio input devices, the display interface may be divided into a plurality of areas according to the above size information and display state, and allocates each region to the resources to be displayed of one audio input device so that the relationship between the size of the regions to be displayed of different audio input devices to which the resources to be displayed are allocated can correspond to the size relationship between the size information in the audio input devices, for example, the size information of the resource to be displayed of the audio input device A in the audio input device A is larger than the size information of the resource to be displayed of the audio input device B in the audio input device B, the size of the area allocated by the resource to be displayed of the audio input device a is larger than the size allocated by the resource to be displayed of the audio input device B; and the display state of the resource to be displayed of each audio input device in the display interface also corresponds to the display state in the audio input device, for example, if the resource to be displayed of the audio input device a is displayed in a landscape mode in the audio input device, the allocated area should also be in a landscape mode.
In still other embodiments, the electronic device may also obtain a relative positional relationship between the electronic device and the audio input device corresponding to the resource to be displayed of each audio input device, and then determine the display layout based on the relative positional relationship. Wherein the relative positional relationship may be used to characterize the relative distance and relative angle of the audio input device and the electronic device.
In this embodiment, the audio input device may be located right in front of the electronic device, may be located left in front of the electronic device, may be located right in front of the electronic device, may be located upper in front of the electronic device, may be located lower in front of the electronic device, and the like, and the second source device may be located right in front of the electronic device, may be located left in front of the electronic device, may be located right in front of the electronic device, may be located upper in front of the electronic device, may be located lower in front of the electronic device, and the like, which is not limited herein.
As a first mode, the electronic device may include an Ultra Wide Band (UWB) sensor, and the audio input device may also include an ultra wide band sensor, so that the electronic device may obtain a relative position relationship between the audio input device and the electronic device through the ultra wide band sensors of the electronic device and the ultra wide band sensor.
As a second way, the electronic device may include an image capturing device, and then the relative position relationship between the audio input device and the electronic device may be obtained through the image capturing device.
In this embodiment, after acquiring the relative positional relationship between the electronic device and the audio input device, the display layout may be determined based on the relative positional relationship. By one approach, when the first audio input device is in front left of the electronic device and the second audio input device is in front right of the electronic device, then the display layout determined based on the relative positional relationship may include: the position of the resource to be displayed of the first audio input device in the display interface is located in the left area of the display interface, the position of the resource to be displayed of the second audio input device in the display interface is located in the right area of the display interface, and the like, which are not limited herein.
In the above embodiment, the electronic device may also determine the display layout of each video in the display interface by combining the number of resources to be displayed of the multiple audio input devices, the display parameters of the resources to be displayed, and the relative position relationship between the audio input devices and the electronic device.
Step S530: assigning at least one audio output channel of at least one audio output device to each audio input device based on the first number, the second number, and the display layout, wherein the assigned audio output channel of each audio input device corresponds to the display layout.
In the embodiment of the present application, when the electronic device assigns an audio output channel to each audio input device, in addition to referring to the number of audio output apparatuses and the number of audio input devices, the above display unevenness may be referred to. Similarly, the electronic device may allocate all audio output channels of one audio output device to the audio input device as far as possible according to the principle of preferentially allocating the entire audio output device to the audio input device; when the number of the audio output devices cannot guarantee that all audio output channels of one audio output device can be allocated to the audio input devices, different channels of the audio output devices are allocated to different audio input devices, and it is guaranteed that the audio output channels allocated to each audio input device are different, so that at least part of audio data of the audio input devices can be played by the complete audio output devices (namely all channels of the audio output devices are used for playing the audio data of one audio input device), and a user can conveniently distinguish playing sounds corresponding to the audio data of different audio input devices. In addition, the electronic device may enable the audio output channel allocated to the audio input device to be close to the display position of the resource to be displayed of the audio input device according to the above display layout when the audio output channel is allocated. For example, referring to fig. 16, if the resource a1 to be displayed corresponding to the audio input device 1 is located on the left side of the display interface of the electronic device, a left audio output channel may be allocated to the audio input device 1; the resource a2 to be displayed corresponding to the audio input device 2 is located on the right side of the display interface of the electronic device, and then the right audio output channel may be allocated to the audio input device 2.
Step S540: and acquiring audio data transmitted by the plurality of audio input devices.
Step S550: and playing the audio data transmitted by each audio input device based on the audio output channel allocated to each audio input device.
In the embodiment of the present application, step S540 and step S550 may refer to the contents of the foregoing embodiments, and are not described herein again.
The audio playing method provided by the embodiment of the application can be used for simultaneously inputting the display content and the audio data to the electronic equipment by a plurality of audio input equipment for displaying and playing, the display layout of the display contents of the plurality of audio input devices is performed, according to the principle that all audio output channels of at least one audio output device are preferentially distributed to the audio input devices, based on the number of the audio input devices, the number of the audio output devices and the uneven display of the audio input devices, different audio output channels are distributed to the audio input equipment, so that the audio data of different audio input equipment can be played through different audio output channels, and the audio output sound channel can be ensured to be corresponding to the display layout, so that the user can distinguish the playing sound of the audio data of different audio input devices conveniently, and the audio playing effect is improved.
Referring to fig. 17, fig. 17 is a flowchart illustrating an audio playing method according to yet another embodiment of the present application. The audio playing method is applied to the electronic device, and will be described in detail with reference to the flow shown in fig. 17, where the audio playing method may specifically include the following steps:
step S610: and acquiring a plurality of audio input devices and the number of the audio output devices, wherein the number of the audio input devices is used as a first number, and the number of the audio output devices is used as a second number.
Step S620: assigning at least one audio output channel of at least one audio output device to each audio input device based on the first number and the second number, wherein the assigned audio output channels are different for each audio input device.
Step S630: and acquiring audio data transmitted by the plurality of audio input devices.
Step S640: and playing the audio data transmitted by each audio input device based on the audio output channel allocated to each audio input device.
In the embodiment of the present application, steps S610 to S640 may refer to the contents of the foregoing embodiments, and are not described herein again.
Step S650: and when the number of the audio input devices for inputting the audio data to the electronic equipment is changed, re-allocating at least one audio output channel of at least one audio output device to each audio input device based on the changed number of the audio input devices and the second number.
In this embodiment of the application, in the process that the electronic device plays the audio data input by each audio input device according to the allocated audio output channels, the number of the audio input devices that input the audio data to the electronic device may be monitored, and when the number of the audio input devices that input the audio data to the electronic device changes, the audio output channels are allocated to each audio input device again based on the changed number of the audio input devices and the second number, so that the allocated audio output channels can be adapted to the current audio input device. In this embodiment, the manner of reassigning the audio output channels to each audio input device according to the changed number of audio input devices and the second number may be referred to as the manner of reassigning at least one audio output channel to each audio input device according to the first number and the second number.
Step S660: and playing the audio data transmitted by each audio input device based on the audio output channels redistributed to each audio input device.
In the embodiment of the present application, after the audio output channels are reallocated, the audio data transmitted by each audio input device may be played based on the reallocated audio output channels.
According to the audio playing method provided by the embodiment of the application, when the number of the audio input devices for inputting the audio data to the electronic device changes, the audio output channels are allocated to each audio input device again based on the changed number of the audio input devices and the second number, so that the real-time allocation of the audio output channels is ensured, and the user can be guaranteed to distinguish the audio input by different audio input devices.
Referring to fig. 18, a block diagram of an audio playing apparatus 400 according to an embodiment of the present application is shown. The audio playing apparatus 400 employs the above-mentioned electronic device, the electronic device includes at least one built-in audio output device and at least one external audio output device, the audio output devices include a plurality of audio output channels, the audio playing apparatus 400 includes: a number determination module 410, an audio distribution module 420, an audio acquisition module 430, and a play module 440. The number determining module 410 is configured to obtain a number of the plurality of audio input devices and a number of the audio output apparatuses, where the number of the plurality of audio input devices is used as a first number, and the number of the audio output apparatuses is used as a second number; the audio allocation module 420 is configured to allocate at least one audio output channel of at least one audio output apparatus to each audio input device based on the first number and the second number, wherein the allocated audio output channels of each audio input device are different; the audio acquiring module 430 is configured to acquire audio data transmitted by the plurality of audio input devices; the playing module 440 is configured to play the audio data transmitted by each audio input device based on the audio output channel allocated to each audio input device.
In some implementations, the audio distribution module 420 can include: a quantity judging unit and a first distributing unit. The number judging unit is used for judging whether the second number is smaller than the first number; the first allocation unit is configured to allocate all audio output channels of at least one audio output device to each of the audio input devices if the second number is greater than or equal to the first number, where the audio output devices allocated to each of the audio input devices are different.
In this embodiment, the audio distribution module 420 may further include: a number of channels acquiring unit, a ratio acquiring unit, a second allocating unit, and a third allocating unit. The sound channel quantity obtaining unit is used for obtaining the quantity of the audio output sound channels of all the audio output devices as a third quantity if the second quantity is smaller than the first quantity; the ratio acquiring unit is used for acquiring the ratio of the third quantity to the first quantity; the second allocating unit is used for allocating all audio output channels of at least one audio output device to part of the audio input devices if the ratio is greater than a set threshold, wherein the audio output devices allocated to different audio input devices in the part of the audio input devices are different; the third allocation unit is configured to allocate one audio output channel of the remaining audio output devices to each of the other audio input devices, where the other audio input devices are the audio input devices of the plurality of audio input devices except the part of the audio input devices, and the audio output channels allocated to the different audio input devices of the other audio input devices are different.
In this manner, the second allocation unit may be specifically configured to: determining the number of audio input devices of the plurality of audio input devices that allocate all audio output channels of one audio output apparatus as a fourth number; acquiring the priority of each audio input device in the plurality of audio input devices; determining the fourth number of audio input devices from the plurality of audio input devices as the partial audio input devices based on the priority of each audio input device, wherein the partial audio input devices have a higher priority than the other audio input devices; all audio output channels of at least one audio output device are assigned to the part of the audio input apparatus.
In this embodiment, the audio distribution module 420 may further include: and a fourth distribution unit. The fourth distribution unit is used for distributing at least one audio output channel to each audio input device in the plurality of audio input devices if the ratio is smaller than or equal to a set threshold value.
In other embodiments, the audio distribution module 420 may also include: a positional relationship acquisition unit and a fifth distribution unit. The position relation acquisition unit is used for acquiring the relative position relation between each audio input device and the electronic device; the fifth distribution unit is used for distributing at least one audio output channel of at least one audio output device to each audio input device based on the first number, the second number and the relative position relationship between each audio input device and the electronic device, wherein the audio output channel distributed by each audio input device corresponds to the relative position relationship.
In still other embodiments, the audio distribution module 420 may also include: a distance acquisition unit and a sixth distribution unit. The distance acquisition unit is used for acquiring the distance of each audio input device relative to the electronic equipment; the sixth allocating unit is configured to allocate at least one audio output channel of at least one audio output apparatus to each audio input device based on the first number, the second number, and a distance of each audio input device from the electronic device, where the number of audio output channels allocated to each audio input device is positively correlated to the distance.
In still other embodiments, the audio input device is further configured to transmit the resource to be displayed to the electronic device for display. The audio playing apparatus 400 may further include a display layout module, configured to perform display layout on the to-be-displayed resource corresponding to each audio input device before allocating, to each audio input device, at least one audio output channel of at least one audio output apparatus based on the first number and the second number. The audio distribution module 420 may also be specifically configured to: assigning at least one audio output channel of at least one audio output device to each audio input device based on the first number, the second number, and the display layout, wherein the assigned audio output channel of each audio input device corresponds to the display layout.
In some embodiments, the audio allocation module 420 is further configured to, when the number of audio input devices inputting audio data to the electronic device changes, reallocate at least one audio output channel of at least one audio output apparatus to each audio input device based on the changed number of audio input devices and the second number.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses and modules may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, the coupling between the modules may be electrical, mechanical or other type of coupling.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
To sum up, the scheme that this application provided, through the quantity according to audio input device to and audio output device's quantity, at least one audio output channel of at least one audio output device is assigned to every audio input device, then acquire the audio data of a plurality of audio input device transmissions, based on the audio output channel to every audio input device assignment, play the audio data of every audio input device transmission, thereby realize assigning different audio output channels to different audio input devices, convenience of customers clearly distinguishes the sound of different audio input device inputs, promote user experience.
Referring to fig. 19, a block diagram of an electronic device according to an embodiment of the present disclosure is shown. The electronic device 100 may be an electronic device capable of running an application, such as a smart television, a notebook computer, a desktop computer, or the like. The electronic device 100 in the present application may include one or more of the following components: a processor 110, a memory 120, a display 130, an audio output device 140, and one or more applications, wherein the one or more applications may be stored in the memory 120 and configured to be executed by the one or more processors 110, the one or more programs configured to perform the methods as described in the aforementioned method embodiments.
Processor 110 may include one or more processing cores. The processor 110 interfaces with various components throughout the electronic device 100 using various interfaces and lines to perform various functions of the electronic device 100 and process data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 120 and invoking data stored in the memory 120. Alternatively, the processor 110 may be implemented in hardware using at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 110 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing display content; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 110, but may be implemented by a communication chip.
The Memory 120 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). The memory 120 may be used to store instructions, programs, code sets, or instruction sets. The memory 120 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like. The data storage area may also store data created by the electronic device 100 during use (e.g., phone book, audio-video data, chat log data), and the like.
The Display 130 is used for displaying information input by a user, information provided to the user, and various graphical user interfaces of the electronic device 100, which may be formed by graphics, text, icons, numbers, videos, and any combination thereof, and in one example, the Display 130 may be a Liquid Crystal Display (LCD) or an Organic Light-Emitting Diode (OLED), which is not limited herein.
The audio output device 140 is used for converting digital audio information into an analog audio signal output and also for converting an analog audio input into a digital audio signal. The audio output device 140 may also be used to encode and decode audio signals. In some embodiments, the audio output device 140 may include a speaker, a receiver, a microphone, and the like, which is not limited herein.
Referring to fig. 20, a block diagram of a computer-readable storage medium provided in an embodiment of the present application is shown. The computer-readable medium 800 has stored therein a program code that can be called by a processor to execute the method described in the above-described method embodiments.
The computer-readable storage medium 800 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Alternatively, the computer-readable storage medium 800 includes a non-volatile computer-readable medium. The computer readable storage medium 800 has storage space for program code 810 to perform any of the method steps of the method described above. The program code can be read from or written to one or more computer program products. The program code 810 may be compressed, for example, in a suitable form.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not necessarily depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (10)

1. An audio playing method is applied to electronic equipment, the electronic equipment comprises at least one built-in audio output device and at least one external audio output device, the audio output devices respectively comprise a plurality of audio output channels, and the number of the audio output channels of each audio output device is the same, the method comprises the following steps:
acquiring a plurality of audio input devices and the number of audio output devices, wherein the number of the audio input devices is used as a first number, and the number of the audio output devices is used as a second number;
judging whether the second number is smaller than the first number;
if the second number is larger than or equal to the first number, distributing all audio output channels of at least one audio output device to each audio input device, wherein the audio output devices distributed to each audio input device are different;
if the second number is smaller than the first number, acquiring the number of audio output channels of all the audio output devices as a third number;
obtaining the ratio of the third quantity to the first quantity;
if the ratio is greater than a set threshold, distributing all audio output channels of at least one audio output device to part of the audio input devices, wherein the audio output devices distributed to different audio input devices in the part of the audio input devices are different, and the set threshold is set according to the number of the audio output channels of a single audio output device;
allocating at least one audio output channel of the remaining audio output devices to each of the other audio input devices, wherein the other audio input devices are the audio input devices of the plurality of audio input devices except the part of the audio input devices, and the audio output channels allocated to different audio input devices of the other audio input devices are different;
acquiring audio data transmitted by the plurality of audio input devices;
and playing the audio data transmitted by each audio input device based on the audio output channel allocated to each audio input device.
2. The method of claim 1, wherein assigning all audio output channels of at least one audio output device to a portion of the plurality of audio input devices comprises:
determining the number of audio input devices of the plurality of audio input devices that allocate all audio output channels of one audio output apparatus as a fourth number;
acquiring the priority of each audio input device in the plurality of audio input devices;
determining the fourth number of audio input devices from the plurality of audio input devices as the partial audio input devices based on the priority of each audio input device, wherein the partial audio input devices have a higher priority than the other audio input devices;
all audio output channels of an audio output device are assigned to the part of the audio input apparatus.
3. The method of claim 1, wherein assigning at least one audio output channel of at least one audio output device to each audio input device based on the first number and the second number further comprises:
and if the ratio is less than or equal to a set threshold, allocating at least one audio output channel to each audio input device in the plurality of audio input devices.
4. The method of claim 1, wherein assigning at least one audio output channel of at least one audio output device to each audio input device based on the first number and the second number comprises:
acquiring the relative position relation between each audio input device and the electronic device;
and allocating at least one audio output channel of at least one audio output device to each audio input device based on the first number, the second number and the relative position relationship between each audio input device and the electronic equipment, wherein the allocated audio output channel of each audio input device corresponds to the relative position relationship.
5. The method of claim 1, wherein assigning at least one audio output channel of at least one audio output device to each audio input device based on the first number and the second number comprises:
acquiring the distance between each audio input device and the electronic device;
allocating at least one audio output channel of at least one audio output device to each audio input device based on the first number, the second number and the distance of each audio input device relative to the electronic device, wherein the number of the audio output channels allocated to each audio input device is positively correlated with the distance.
6. The method of claim 1, wherein the audio input devices are further configured to transmit resources to be displayed to the electronic device for display, and wherein before the allocating at least one audio output channel of at least one audio output apparatus to each audio input device based on the first number and the second number, the method further comprises:
displaying and distributing the resources to be displayed corresponding to each audio input device;
said assigning at least one audio output channel of at least one audio output device to each audio input apparatus based on said first number and said second number comprises:
assigning at least one audio output channel of at least one audio output device to each audio input device based on the first number, the second number, and the display layout, wherein the assigned audio output channel of each audio input device corresponds to the display layout.
7. The method according to any one of claims 1-6, further comprising:
and when the number of the audio input devices for inputting the audio data to the electronic equipment is changed, re-allocating at least one audio output channel of at least one audio output device to each audio input device based on the changed number of the audio input devices and the second number.
8. An audio playing apparatus, applied to an electronic device, the electronic device including at least one built-in audio output apparatus and at least one external audio output apparatus, each of the audio output apparatuses including a plurality of audio output channels, the audio playing apparatus comprising: the system comprises a quantity determining module, an audio distribution module, an audio acquisition module and a playing module, wherein the audio distribution module comprises a quantity judging unit, a first distribution unit, a sound channel quantity acquisition unit, a ratio acquisition unit, a second distribution unit and a third distribution unit,
the number determining module is configured to obtain a number of the plurality of audio input devices and a number of the audio output apparatuses, where the number of the plurality of audio input devices is used as a first number, and the number of the audio output apparatuses is used as a second number;
the number judging unit is used for judging whether the second number is smaller than the first number;
the first allocation unit is used for allocating all audio output channels of at least one audio output device to each audio input device if the second number is greater than or equal to the first number, wherein the allocated audio output devices of each audio input device are different;
the sound channel quantity obtaining unit is used for obtaining the quantity of the audio output sound channels of all the audio output devices as a third quantity if the second quantity is smaller than the first quantity;
the ratio acquiring unit is used for acquiring the ratio of the third quantity to the first quantity;
the second allocating unit is configured to allocate all audio output channels of at least one audio output device to a part of the audio input devices if the ratio is greater than a set threshold, where the audio output devices allocated to different audio input devices in the part of the audio input devices are different, and the set threshold is set according to the number of audio output channels of a single audio output device;
the third allocation unit is configured to allocate at least one audio output channel of the remaining audio output devices to each of the other audio input devices, where the other audio input devices are the audio input devices of the plurality of audio input devices except the partial audio input devices, and the audio output channels allocated to different audio input devices of the other audio input devices are different;
the audio acquisition module is used for acquiring audio data transmitted by the plurality of audio input devices;
the playing module is used for playing the audio data transmitted by each audio input device based on the audio output sound channel distributed to each audio input device.
9. An electronic device, comprising:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications configured to perform the method of any of claims 1-7.
10. A computer-readable storage medium, having stored thereon program code that can be invoked by a processor to perform the method according to any one of claims 1 to 7.
CN202011105792.0A 2020-10-15 2020-10-15 Audio playing method and device, electronic equipment and storage medium Active CN112181353B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202011105792.0A CN112181353B (en) 2020-10-15 2020-10-15 Audio playing method and device, electronic equipment and storage medium
PCT/CN2021/113242 WO2022078056A1 (en) 2020-10-15 2021-08-18 Audio playback method and apparatus, electronic device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011105792.0A CN112181353B (en) 2020-10-15 2020-10-15 Audio playing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112181353A CN112181353A (en) 2021-01-05
CN112181353B true CN112181353B (en) 2022-05-20

Family

ID=73950542

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011105792.0A Active CN112181353B (en) 2020-10-15 2020-10-15 Audio playing method and device, electronic equipment and storage medium

Country Status (2)

Country Link
CN (1) CN112181353B (en)
WO (1) WO2022078056A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112181353B (en) * 2020-10-15 2022-05-20 Oppo广东移动通信有限公司 Audio playing method and device, electronic equipment and storage medium
CN113050916A (en) * 2021-04-09 2021-06-29 深圳Tcl新技术有限公司 Audio playing method, device and storage medium
CN113422865A (en) * 2021-06-01 2021-09-21 维沃移动通信有限公司 Directional recording method and device
CN113676720B (en) * 2021-08-04 2023-11-10 Oppo广东移动通信有限公司 Multimedia resource playing method and device, computer equipment and storage medium
CN113885827A (en) * 2021-10-09 2022-01-04 Oppo广东移动通信有限公司 Audio playing method and device, electronic equipment, computer readable medium and product

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104657099A (en) * 2015-01-15 2015-05-27 小米科技有限责任公司 Method, device and system for screen projection
CN105812887A (en) * 2016-03-18 2016-07-27 深圳创维-Rgb电子有限公司 Multi-screen display television and multi-screen play method
CN106325798A (en) * 2016-08-23 2017-01-11 努比亚技术有限公司 Method and device for achieving multi-screen content display
CN110381197A (en) * 2019-06-27 2019-10-25 华为技术有限公司 Many-one throws the processing method of screen sound intermediate frequency data, apparatus and system
CN111263233A (en) * 2020-02-20 2020-06-09 腾讯科技(深圳)有限公司 Television multi-window processing method and device, computer equipment and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100405832C (en) * 2004-12-17 2008-07-23 Tcl王牌电子(深圳)有限公司 TV set apparatus capable of simultaneously receiving and playing multi-channel programs
US20090207098A1 (en) * 2007-07-05 2009-08-20 Himax Display, Inc. Portable electronic device and displaying method thereof
CN103593111A (en) * 2013-11-14 2014-02-19 三星电子(中国)研发中心 Screen sharing method for mobile terminals and mobile terminals
US10097902B2 (en) * 2015-05-06 2018-10-09 Blackfire Research Corporation System and method for using multiple audio input devices for synchronized and position-based audio
KR20170031392A (en) * 2015-09-11 2017-03-21 삼성전자주식회사 Electronic apparatus, sound system and audio output method
CN112181353B (en) * 2020-10-15 2022-05-20 Oppo广东移动通信有限公司 Audio playing method and device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104657099A (en) * 2015-01-15 2015-05-27 小米科技有限责任公司 Method, device and system for screen projection
CN105812887A (en) * 2016-03-18 2016-07-27 深圳创维-Rgb电子有限公司 Multi-screen display television and multi-screen play method
CN106325798A (en) * 2016-08-23 2017-01-11 努比亚技术有限公司 Method and device for achieving multi-screen content display
CN110381197A (en) * 2019-06-27 2019-10-25 华为技术有限公司 Many-one throws the processing method of screen sound intermediate frequency data, apparatus and system
CN111263233A (en) * 2020-02-20 2020-06-09 腾讯科技(深圳)有限公司 Television multi-window processing method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
WO2022078056A1 (en) 2022-04-21
CN112181353A (en) 2021-01-05

Similar Documents

Publication Publication Date Title
CN112181353B (en) Audio playing method and device, electronic equipment and storage medium
CN109408223B (en) Resource allocation method, device, terminal and storage medium
CN109525853B (en) Live broadcast room cover display method and device, terminal, server and readable medium
CN109076304B (en) Application programming interface for adaptive audio rendering
CN114501062B (en) Video rendering coordination method, device, equipment and storage medium
CN109542614B (en) Resource allocation method, device, terminal and storage medium
US20210322874A1 (en) Dynamic adjustment of cloud game data streams to output device and network quality
CN111263233A (en) Television multi-window processing method and device, computer equipment and storage medium
CN110740346B (en) Video data processing method, device, server, terminal and storage medium
CN113676741A (en) Data transmission method, device, storage medium and electronic equipment
CN110752999B (en) Screen broadcasting method, device, system, electronic equipment and storage medium
KR20110074039A (en) Display apparatus and control method of contents thereof
CN114205359A (en) Video rendering coordination method, device and equipment
CN105224185B (en) Data sharing method and mobile terminal
US10091458B2 (en) Communication system
CN111857515A (en) Image processing method, image processing device, storage medium and electronic equipment
CN109309805B (en) Multi-window display method, device, equipment and system for video conference
US20110271195A1 (en) Method and apparatus for allocating content components to different hardward interfaces
EP4145269A1 (en) Screen projection control method, storage medium, and communication device
KR102011834B1 (en) display device
CN110572697A (en) remote teaching method and device for multiple video channels and server
CN112738445B (en) Multi-line plug flow method and device, storage medium and electronic equipment
JP5392661B2 (en) Electronics
CN113766164B (en) Display equipment and signal source interface display method
WO2023108468A1 (en) Streaming media processing method, system and device

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