CN113885827A - Audio playing method and device, electronic equipment, computer readable medium and product - Google Patents

Audio playing method and device, electronic equipment, computer readable medium and product Download PDF

Info

Publication number
CN113885827A
CN113885827A CN202111177786.0A CN202111177786A CN113885827A CN 113885827 A CN113885827 A CN 113885827A CN 202111177786 A CN202111177786 A CN 202111177786A CN 113885827 A CN113885827 A CN 113885827A
Authority
CN
China
Prior art keywords
audio
played
target
playing
target audio
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.)
Pending
Application number
CN202111177786.0A
Other languages
Chinese (zh)
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 CN202111177786.0A priority Critical patent/CN113885827A/en
Publication of CN113885827A publication Critical patent/CN113885827A/en
Pending legal-status Critical Current

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

Landscapes

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

Abstract

The application discloses an audio playing method, an audio playing device, electronic equipment, a computer readable medium and a product, which relate to the technical field of mobile terminals and are used for responding to the connection with audio playing equipment and acquiring audio to be played; determining a first target audio sent to the loudspeaker and a second target audio sent to the audio playing device based on the audio to be played; and sending the first target audio to the loudspeaker, and sending the second target audio to the audio playing device, so that the audio playing device plays the second target audio under the condition that the loudspeaker plays the first target audio. Therefore, when the electronic equipment is connected with the audio playing equipment, the loudspeaker and the audio playing equipment of the electronic equipment can play audio, and the situation that the loudspeaker stops playing audio due to the fact that the electronic equipment is connected with the audio playing equipment can be avoided.

Description

Audio playing method and device, electronic equipment, computer readable medium and product
Technical Field
The present application relates to the field of mobile terminal technologies, and in particular, to an audio playing method and apparatus, an electronic device, a computer-readable medium, and a product.
Background
With the maturation of the multi-channel bluetooth audio transmission technology, the number of bluetooth audio devices (wireless devices) that can be simultaneously connected to the mobile phone terminal is increasing. A plurality of bluetooth audio equipment constitute audio amplifier system, and the technique that expands cell-phone audio frequency use scene, promote space audio effect is more and more paid attention to. At present, after a mobile phone is connected with a Bluetooth audio device (such as a Bluetooth sound box), sound is played only through the sound box, the mobile phone is placed outside and does not work any more, and the user requirements cannot be met.
Disclosure of Invention
The application provides an audio playing method, an audio playing device, an electronic device, a computer readable medium and a product, so as to overcome the defects.
In a first aspect, an embodiment of the present application provides an audio playing method, which is applied to an electronic device, where the electronic device includes a speaker, and the method includes: responding to the connection with audio playing equipment, and acquiring audio to be played; determining a first target audio sent to the loudspeaker and a second target audio sent to the audio playing device based on the audio to be played; and sending the first target audio to the loudspeaker, and sending the second target audio to the audio playing device, so that the audio playing device plays the second target audio under the condition that the loudspeaker plays the first target audio.
In a second aspect, an embodiment of the present application further provides an audio playing apparatus, which is applied to an electronic device, where the electronic device includes a speaker, and the audio playing apparatus includes: the device comprises an acquisition unit, a determination unit and a sending unit. And the acquisition unit is used for responding to the connection with the audio playing equipment and acquiring the audio to be played. The determining unit is used for determining a first target audio sent to the loudspeaker and a second target audio sending unit sent to the audio playing device based on the audio to be played, and is used for sending the first target audio to the loudspeaker and sending the second target audio to the audio playing device, so that the audio playing device plays the second target audio under the condition that the loudspeaker plays the first target audio.
In a third aspect, an embodiment of the present application further provides an electronic device, including: one or more processors; a memory; a speaker; 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 above-described method.
In a fourth aspect, the present application also provides a computer-readable storage medium, where a program code executable by a processor is stored, and when executed by the processor, the program code causes the processor to execute the above method.
In a fifth aspect, the present application further provides a computer product, which includes program code executable by a processor, and when executed by the processor, causes the processor to execute the above method.
The audio playing method, the audio playing device, the electronic equipment, the computer readable medium and the product provided by the application respond to the connection with the audio playing equipment, obtain the audio to be played, and determine a first target audio and a second target audio based on the audio to be played, wherein the loudspeaker and the external audio playing equipment are taken as total playing equipment; and sending the first target audio to the loudspeaker, and sending the second target audio to the audio playing device, so that the audio playing device plays the second target audio under the condition that the loudspeaker plays the first target audio. Therefore, when the electronic equipment is connected with the audio playing equipment, the loudspeaker of the electronic equipment and the audio playing equipment can both play audio, and the situation that the loudspeaker of the electronic equipment stops playing the audio due to the fact that the electronic equipment is connected with the audio playing equipment can be avoided.
Additional features and advantages of embodiments of the present application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of embodiments of the present application. The objectives and other advantages of the embodiments of the application may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
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 is a schematic diagram of an audio playing system provided by an embodiment of the present application;
FIG. 2 is a schematic diagram of an audio playback system provided in another embodiment of the present application;
FIG. 3 is a flowchart illustrating a method of playing audio according to an embodiment of the present application;
FIG. 4 is a schematic diagram illustrating an audio playback interface provided by an embodiment of the present application;
FIG. 5 is a flowchart illustrating a method of playing audio according to another embodiment of the present application;
FIG. 6 is a schematic diagram of an audio playback system provided by yet another embodiment of the present application;
FIG. 7 is a schematic diagram of an audio playback system provided by yet another embodiment of the present application;
FIG. 8 is a flowchart illustrating a method of playing audio provided by another embodiment of the present application;
FIG. 9 is a diagram illustrating a data flow of audio playback provided by an embodiment of the present application;
FIG. 10 is a schematic diagram illustrating a data flow of audio playback provided by another embodiment of the present application;
FIG. 11 is a schematic diagram illustrating a data flow of audio playback provided by another embodiment of the present application;
fig. 12 shows a block diagram of an audio playing apparatus provided in an embodiment of the present application;
fig. 13 is a block diagram illustrating an electronic device according to an embodiment of the present application;
FIG. 14 illustrates a schematic diagram of a computer-readable storage medium provided by an embodiment of the present application;
FIG. 15 is a diagram illustrating a computer product provided by an embodiment of the present application.
Detailed Description
In order to make the technical solutions of the present application better understood, 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, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
Along with the abundance of life contents of people, more and more electronic equipment owned by users are provided, and the technology of Bluetooth communication is rapidly improved. Currently, in order to facilitate work and life of a user, a certain electronic device may be bluetooth connected to a plurality of other external devices at the same time, so that the user can control the plurality of devices to transmit data to the same device. Specifically, the electronic device may be a smart phone, a tablet computer, an electronic book, a wireless audio playing device, a display and the like, the display and the like are internally provided with a bluetooth module, the electronic device can establish bluetooth connection with other bluetooth devices and interact data, and the wireless audio playing device may include a bluetooth headset, a bluetooth sound box and the like.
Based on the mature multi-channel Bluetooth audio transmission technology, the number of Bluetooth audio devices (wireless devices) which can be simultaneously connected with a mobile phone terminal is increasing. A plurality of bluetooth audio equipment constitute audio amplifier system, and the technique that expands cell-phone audio frequency use scene, promote space audio effect is more and more paid attention to.
Referring to fig. 1, fig. 1 shows an audio playing system, which includes an electronic device 100 and a sound box 200, wherein the electronic device such as a smart phone, a tablet computer, an e-book reader, etc. can run an application program, the sound box 200 is a device that can convert an audio signal into sound, and functions to convert audio electric energy into corresponding sound energy and radiate the sound energy into a space, and the sound box 200 may be a separate sound box, such as an active or passive sound box, or a vehicle-mounted sound box, etc., without limitation. The electronic device 100 has an application program installed therein, and specifically, the application program may be audio playing software, video playing software, or call software. The electronic device 100 sends the audio to be played to the speaker 200, and the speaker 200 plays the audio.
Specifically, the electronic device may include a speaker 101, for example, a sound outlet is provided on a housing of the electronic device, the speaker 101 is disposed in the sound outlet, and sound emitted from the speaker 101 may be transmitted to the air through the sound outlet to be heard by the user. Then in the system shown in fig. 1, a total of two audio playback devices, respectively, speakers and speakers 200, are included.
In the case that one electronic device can be bluetooth connected to a plurality of other external devices at the same time, the electronic device 100 may be connected to a plurality of audio playing devices, as shown in fig. 2, the audio playing system shown in fig. 2 includes the electronic device 100, the speaker 200, and an earphone set, the earphone set includes a first wireless earphone 310 and a second wireless earphone 320, the electronic device 100 may transmit audio data to the first wireless earphone 310 and the second wireless earphone 320, and a user listens to the audio data played by the first wireless earphone 310 and the second wireless earphone 320 by wearing the first wireless earphone 310 and the second wireless earphone 320. As shown in fig. 2, the electronic device 100 is connected to the first wireless headset 310 via bluetooth, and then the first wireless headset 310 is connected to the second wireless headset 320 via bluetooth, so that the electronic device 100, the first wireless headset 310 and the second wireless headset 320 are connected simultaneously via a networking manner, that is, the first wireless headset 310 serves as a relay for the electronic device 100 and the second wireless headset 320. In this embodiment of the application, the electronic device 100, the first wireless earphone 310, and the second wireless earphone 320 may all be directly connected to the electronic device 100, or the first wireless earphone 310 may serve as a master earphone, and the second wireless earphone 320 may serve as a slave earphone, which is not limited herein.
The inventor finds in research that, in a case where the electronic device has been connected to an external audio playing device, audio data of an audio file currently played by the electronic device is played by the external audio playing device to which the electronic device has been connected, and the audio file is not played by a speaker of the electronic device. In addition, when the audio playing system plays audio, and when the audio playing device is switched, the playing operation of the audio file currently requested to be played by the electronic device may be paused or interrupted, which results in poor user experience.
Therefore, in order to overcome the above-mentioned drawbacks, embodiments of the present application provide an audio playing method, an apparatus, an electronic device, a computer-readable medium, and a product, where when the electronic device is connected to an audio playing device, both a speaker of the electronic device and the audio playing device can play audio, and the speaker of the electronic device can be prevented from stopping audio playing due to the electronic device being connected to the audio playing device.
Specifically, referring to fig. 3, fig. 3 shows an Audio playing method provided in this embodiment of the present application, which is applied to the electronic device described above, where the electronic device includes a speaker, and an execution subject of the method is the electronic device, specifically, a processor in the electronic device or a program module for Audio playing of a user, for example, a multimedia module (Audio Manager), and then the method includes: s301 to S303.
S301: and responding to the connection with the audio playing equipment, and acquiring the audio to be played.
Specifically, under the condition that the electronic device is connected with at least one audio playing device, the audio to be played is acquired in response to the connection with the audio playing device. In the embodiment of the present application, the type of the audio playing device is not limited, and the audio playing device may be a sound box, an earphone, a speaker of another electronic device, and the like, where the sound box may be an independent sound box, or a vehicle-mounted sound box.
As an implementation manner, in a case that the electronic device is connected with at least one audio playing device, when a user desires to play audio data, the user may select music to be played in an audio playing interface of the electronic device, for example, in the audio playing interface shown in fig. 1, select an audio file, and trigger a playing button, so that the electronic device may determine that the selected audio file is an audio to be played. In some embodiments, the audio file to be played may be multiple audio files from different playing modules, and the playing modules may be different modules within one application program or from different application programs. For example, the application program has a plurality of playing modules, which are a video player and an audio player respectively, and then the audio data corresponding to the video file currently being played in the video player and the audio file currently being played by the audio player are both used as the audio to be played, that is, when the application program plays the audio, the audio player of the application program is triggered to play the audio, and then both the video and the audio are used as the audio to be played. For another example, two different applications request that the audio files to be played are both used as the audio to be played.
In other embodiments, the multiple audio files to be played come from the same playing module, specifically, the multiple audio files to be played may be multiple audio files in a playlist corresponding to the playing module, as shown in the audio playing interface shown in fig. 1, a user may select the multiple audio files to form an audio playlist, and then the audio files in the audio playlist may all be used as the audio to be played, or the audio file currently being played may be used as the audio to be played.
As an embodiment, each audio to be played corresponds to a playing request, and the current audio to be played can be determined by detecting the playing request. Specifically, the play request may be a reminder message or a voice play request. The reminding information comprises information for reminding a user that some events are triggered, such as call reminding information, short message reminding information, alarm reminding information and the like. For example, the call reminding information is used for reminding the user of the current incoming call.
As another embodiment, the utterance request may be a request to play a voice every time the electronic device utters a voice. The utterance request may be an audio utterance request, a video utterance request, or a call utterance request.
Specifically, a plurality of audio playing software are installed in the electronic device, and the software may be a music playing APP, a video playing APP, or a recording APP. For example, a video playing key is arranged on a video playing interface, and by detecting the touch of the video playing key, whether the electronic device currently receives a playing request of audio data can be determined, for example, a user selects a video, enters the video playing interface, and clicks a playing button of the playing interface, and an application program can detect what type of video the user currently clicks through monitoring the user touch operation, specifically, the playing button is provided with a preset attribute, and by detecting the attribute of the obtained playing button corresponding to the touch operation, the video to be played selected by the user can be determined, so that the playing request and the audio corresponding to the playing request can be obtained.
In one embodiment, the audio duration of the audio to be played is greater than a specified value. In the embodiment of the present disclosure, the designated value may be set according to a system prompt tone of the electronic device. The system prompt audio can be a key feedback sound, an operation confirmation sound, a warning information sound and the like, the duration time of the system prompt sound is generally short, and the duration time of sound played by programs such as music, videos, games and the like is generally long. Specifically, the duration of all the system alert tones that can be output by the electronic device may be determined, and the maximum duration may be used as the specified value, or an average value of the durations may be used as the specified value. Therefore, when the electronic equipment acquires the audio playing request, the audio file corresponding to the audio playing request is determined, and if the audio duration of the audio file is greater than a specified value, the audio file is determined as the audio to be played.
S302: and determining a first target audio sent to the loudspeaker and a second target audio sent to the audio playing device based on the audio to be played.
In some embodiments, the first target audio and the second target audio may be randomly selected from the audio to be played, or the first target audio and the second target audio may be determined based on the type of the audio to be played, specifically, the first target audio is determined from a plurality of the audio to be played, and an audio other than the first target audio in the plurality of the audio to be played serves as an alternative audio; determining the second target audio from the alternative audio. The implementation of determining the first target audio from the multiple audios to be played may refer to subsequent examples, and determining the second target audio from the candidate audio may be determining the second target audio based on the number of the audios to be played and the number of the total playing devices, may also be randomly selecting the second target audio from the candidate audio, and may also be determining the second target audio based on the type of the candidate audio, specifically, refer to subsequent examples.
In other embodiments, considering that the relationship between the amount of the audio to be played and the amount of the total playing devices may be different, the problem of allocation between the audio to be played and the speakers and the audio playing devices may be involved, and therefore, the first target audio and the second target audio may be determined from the audio to be played based on the first amount of the total playing devices and the second amount of the audio to be played.
Wherein, the total playing device is the loudspeaker and the audio playing device. For example, the first number of total playback devices in the audio playback system shown in fig. 1 is 2, and the first number of total playback devices in the audio playback system shown in fig. 2 is 3. The first target audio corresponds to a speaker, that is, the first target audio is an audio played by the speaker, and the second target audio corresponds to an audio playing device, that is, the second target audio is played by the audio playing device.
In three cases, that is, the first number is smaller than the second number, the first number is equal to the second number, and the first number is greater than the second number, where the first number is greater than or equal to the second number, it may be ensured that each audio to be played can be played by at least one audio playing device, when an audio device is allocated to each audio to be played, in a case where it is determined that each audio device to be played is played, it may cause multiple audio playing devices to play the same audio to be played at the same time, if the first number is smaller than the second number, the number of audio playing devices is smaller than the second number, it may cause a part of the audio data to be played to be unable to be played, and in a case where it is required to determine which audio to be played can be played from the second number of audio to be played, specifically, in a subsequent embodiment, and respectively setting forth the determining modes of the first target audio and the second target audio based on the magnitude relation of the first quantity and the second quantity.
As an implementation manner, an audio playing device may be set for each audio to be played, where the audio to be played corresponding to the speaker is taken as a first target audio, and the audio corresponding to the audio playing device is taken as a second target audio, as shown in fig. 4, a device selection control 401 may be set on the audio playing interface, for example, a first audio requested to be played is selected on the audio playing interface as the audio to be played, then, the audio playing device set for the audio to be played through the device selection control 401 is a speaker, the first audio is the first target audio, and if the audio playing device set for the audio to be played through the device selection control 401 is an audio playing device such as a loudspeaker, the first audio is the second target audio.
S303: and sending the first target audio to the loudspeaker, and sending the second target audio to the audio playing device, so that the audio playing device plays the second target audio under the condition that the loudspeaker plays the first target audio.
As an implementation manner, a processor of the electronic device sends the first target audio to the speaker, controls the speaker to play the first target audio and sends the second target audio to the audio playing device, so that the audio playing device plays the second target audio when the speaker plays the first target audio. Specifically, the processor of the electronic device transmits the first target audio to the speaker of the electronic device through the wired channel, and the processor of the electronic device transmits the second target audio to the audio playing device through the bluetooth channel, so that the first target audio and the second target audio are not conflicted with each other when the electronic device transmits the first target audio and the second target audio. In addition, the electronic device can also be provided with a multi-channel decoder or a plurality of decoders, and the first target audio and the second target audio are decoded simultaneously through different channels of decoders or different decoders, so that the playing conflict of the first target audio and the second target audio can be avoided.
As another embodiment, when a plurality of audio playing devices are provided and second target audio needs to be sent to the plurality of audio playing devices, the electronic device sends each second target audio to the audio playing device corresponding to each second target audio through the bluetooth channel, in order to avoid delay when the plurality of audio playing devices play the same second target audio, the audio played by each audio playing device may be collected through a microphone of the electronic device, the content of the audio is identified, and the playing schedule of each audio playing device is adjusted based on the predetermined correspondence between the audio content and the timestamp, so that each audio playing device can synchronously play the same audio. Similarly, when the first target audio frequency and the second target audio frequency are the same, that is, when the speaker of the electronic device and the plurality of audio playing devices play the same audio frequency, the playing progress of each audio playing device determined by the microphone of the electronic device is adjusted by taking the playing progress of the speaker as a reference, so that the speaker and each audio playing device can synchronously play the same audio frequency.
As an embodiment, it should be noted that the first target audio and the second target audio do not necessarily represent different audio data, but the first target audio and the second target audio represent different corresponding audio playing devices, where the audio player corresponding to the first target audio is a speaker of the electronic device, and the second target audio corresponds to the audio playing device. In some embodiments, the first target audio may be the same as the second target audio, so that it may be ensured that the audio playing device and the speaker of the electronic device play audio at the same time and play the same audio, and the first target audio may be different from the second target audio, so that it may be ensured that the audio playing device and the speaker of the electronic device play audio at the same time but play different audio.
In addition, when the second target audio is plural, the first target audio may be the same as a part of the second target audio. In addition, all the audio to be played may be played, or a part of the audio to be played may be played, that is, the first target audio and all the second target audio may cover all the audio to be played, or the first target audio and all the second target audio only include a part of the audio to be played, which is not limited herein.
In this embodiment of the application, the speaker may play an audio to be played, and in all audio playing devices, at least a part of the audio playing devices play the audio to be played, that is, when the speaker plays the first target audio, at least a part of the audio playing devices play the audio, specifically, the number of the second target audio and the number of the audio playing devices are determined and set based on the usage requirement, which is not limited herein.
Therefore, under the condition that the electronic equipment is connected with audio playing equipment, audio to be played is obtained, a loudspeaker and the audio playing equipment are used as total playing equipment, a first target audio and a second target audio are determined from the audio to be played based on a first quantity of the total playing equipment and a second quantity of the audio to be played, and the loudspeaker is controlled to play the first target audio; and sending each second target audio to the audio playing device corresponding to the second target audio, so that each audio playing device plays the second target audio corresponding to the audio playing device under the condition that the loudspeaker plays the first target audio. Therefore, when the electronic equipment is connected with the audio playing equipment, the loudspeaker of the electronic equipment and the audio playing equipment can both play audio, and the situation that the loudspeaker of the electronic equipment stops playing the audio due to the fact that the electronic equipment is connected with the audio playing equipment can be avoided. Referring to fig. 5, fig. 5 shows an audio playing method provided in an embodiment of the present application, which is applied to the electronic device described above, where the electronic device includes a speaker, and an execution subject of the method is the electronic device, and specifically, the method includes: s501 to S506.
S501: and responding to the connection with the audio playing equipment, and acquiring the audio to be played.
S502: if the first number is greater than or equal to the second number, determining whether the second number is 1.
The first number is greater than or equal to the second number, that is, the number of the audio to be played is less than or equal to the number of the total playing devices, that is, there are enough audio playing devices to play the audio to be played.
If the number of the audio to be played is greater than 1 and less than or equal to the first number, the number of the audio playing devices participating in playing the audio in the total playing device is more than one, and the number is not less than the number of the audio to be played which needs to be played at the same time.
It may be determined whether the second number is 1, that is, whether the number of audio to be played is 1, and if it is 1, S503 is performed, and if it is not 1, S504 is performed.
S503: and setting the first target audio and each second target audio to be the audio to be played.
It should be noted that the first target audio and the second target audio do not indicate that the audio data of the first target audio and the second target audio are different, and the first target audio and the second target audio are characterized by different corresponding audio playing devices, where the audio player corresponding to the first target audio is a speaker of an electronic device, and the audio player corresponding to the second target audio is an audio playing device, in addition, the audio playing devices corresponding to the same second target audio may be different or the same, and the audio playing devices corresponding to different second target audio may not be the same, that is, in some embodiments, two different second target audios may not correspond to the same audio playing device.
When the number of the audio to be played is 1, setting the first target audio and each second target audio to be the audio to be played, that is, under the condition that only one audio needs to be played, the same audio is played by a loudspeaker of the electronic device and the audio playing device at the same time.
For example, if the number of the audio playing devices is 1, the first number of the total playing devices is 2, and the number of the audio to be played is 1, that is, if the audio to be played is a first song, the first target audio played by the speaker is the first song, and the 2 nd target audio played by the audio playing device is also the first song, as shown in the audio playing system shown in fig. 6, the speaker 101 of the electronic device 100 and the audio box 200 play the first song at the same time. Therefore, when the speaker 101 and the speaker box 200 of the electronic device 100 play the same audio at the same time, the "spatial sense of sound" can be enhanced and the "music following" effect can be realized. Specifically, when the electronic device and the audio playing device play the same audio, the electronic device can be used as another "sound box", and the electronic device can be carried by the user, that is, the electronic device can move along with the movement of the user, so that the electronic device and the audio playing device form a pair of stereo devices, and the stereo perception of sound can be increased; in addition, the audio playing device can be fixed in position, the electronic device can move along with the user, and the user can move in a relatively large space, for example, when the user carries the electronic device to move from a living room to a kitchen, the mode that the electronic device is matched with the audio playing device can reduce the auditory sense change caused by the position movement.
As an embodiment, the speakers of the electronic device play the audio to be played, instead of each audio playing device playing the audio to be played. If the number of the audio playing devices is 3, the audio playing devices are respectively device 1, device 2, and device 3, the first number of the total playing devices is 4, and the number of the audio to be played is 1, that is, if the audio to be played is a first song, a first target audio is set as the first song, a speaker of the electronic device plays the first song, a second target audio is set as the first song, and audio playing devices corresponding to the second target audio are set as device 2 and device 3, so that the speaker of the electronic device, device 2, and device 3 play the first song together, and device 1 does not play the first song, and also does not play other audio.
In some embodiments, in a case where the first number is greater than or equal to the second number, and in a case where one audio to be played is allocated to the speaker as the first target audio, the number of the second target audio is smaller than the number of the audio playing devices, an audio playing device corresponding to the second target audio may be determined from the plurality of audio playing devices. Specifically, the device type of each audio playing device may be determined, and the audio playing device corresponding to the second target audio is determined according to the device type of the audio playing device.
Specifically, the device types may include a headphone type and a play-out type, wherein the play-out type may be a type of audio device capable of playing out, such as a speaker, a loudspeaker, or the like. In this embodiment, the number of the audio to be played is 1, and the speaker of the electronic device is playing the audio, so as to increase the stereo effect and the sound following effect, a play-out type of play-out audio playing device may be determined from all play-out audio playing devices currently connected to the electronic device, and the play-out type of play-out audio playing device is used as the play-out audio playing device corresponding to the audio to be played. If the number of the audio playing devices is 3, the audio playing devices are respectively device 1, device 2, and device 3, and the number of the audio to be played is 1, that is, if the audio to be played is a first song, and both the device 2 and the device 3 are of the play-out type, the audio playing devices corresponding to the first song are device 2 and device 3.
S504: determining a first target audio from a plurality of audios to be played, and taking at least part of the audios except the first target audio in the audios to be played as a second target audio.
If the second number of the audio to be played is smaller than or equal to the first number of the total playing devices and the second number of the audio to be played is larger than 1, a first target audio required to be played by the loudspeaker and a second target audio required to be played by the audio playing device need to be determined from the plurality of audio to be played.
As an embodiment, it is assumed that an audio playing device is assigned to each audio to be played for playing, so that all the audio to be played is played through a speaker of the electronic device and an audio playing device to which the electronic device is currently connected, and the audio played by each audio playing device is different from each other. Determining one audio frequency from the multiple audio frequencies to be played as a first target audio frequency, then, taking all audio frequencies except the audio frequencies to be played as second target audio frequencies, and then, allocating an audio playing device to each second target audio frequency, wherein the audio playing devices corresponding to different second target audio frequencies are different from each other, so that the situation that the same peripheral audio frequency plays two different second target audio frequencies at the same time is avoided. Therefore, when the electronic equipment plays a plurality of audios, different audios can be played through different audio equipment, so that all the audios to be played can be played. For example, if the number of audio playing devices is 3, then device 1, device 2, and device 3, respectively, the number of audio to be played is 3, the total audio playing device is three audio playing devices and the speakers of the electronic device, and there are 4, assuming that 3 audio to be played are audio 1, audio 2 and audio 3 respectively, then, one audio is determined as a first target audio from audio 1, audio 2, and audio 3, for example, audio 1 is the first target audio, then, audio 2 and audio 3 are used as second target audio, at least two audio playing devices are determined from device 1, device 2 and device 3 to play audio 2 and audio 3 respectively, for example, the audio playing device corresponding to the audio 2 is device 1, and the audio playing device corresponding to the audio 3 is device 3, and it can be seen that the audio playing devices corresponding to the audio 2 and the audio 3 are different from each other.
In this embodiment, the number of the plurality of audio playing devices is greater than the number of the second target audios, and a specified number of audio playing devices, which is the same as the number of the second target audios, needs to be determined from the plurality of audio playing devices as the target audio playing devices, so that each target audio playing device plays one second target audio. In some embodiments, determining the target audio playback device from the plurality of audio playback devices may be performed by determining a priority of each audio playback device, and determining a specified number of audio playback devices as the target audio playback devices based on the priority of each audio playback device. As an implementation manner, all the audio playing devices may be sorted according to priority to obtain a designated sequence, and the designated number of audio playing devices closest to the top in the designated sequence may be used as the target audio playing device.
As an embodiment, the priority of each audio playback device may be set based on at least one of a connection time, a data transmission rate, and a user importance of each audio playback device.
As an embodiment, the priority of each audio playing device is determined based on the connection time of each audio playing device, so as to determine the target terminal based on the connection time of each alternative terminal. In some embodiments, the priority of the audio playing device may be determined according to the precedence order of the connection time, for example, the priority is positively related to the connection time, that is, the earlier the connection time, the lower the priority, and the later the connection time, the higher the priority, or the priority is negatively related to the connection time, that is, the earlier the connection time, the higher the priority, the later the connection time, and the lower the priority, which is not limited herein.
As an embodiment, the attribute information may be a data transmission rate, and the priority of each audio playing device is determined based on the data transmission rate corresponding to each audio playing device, specifically, the priority is positively correlated with the data transmission rate, that is, the lower the data transmission rate, the lower the priority, the higher the data transmission rate, and the higher the priority, or the priority is negatively correlated with the data transmission rate, that is, the lower the data transmission rate, the higher the priority, the higher the data transmission rate, and the lower the priority.
As an embodiment, a user importance may be set for each audio playing device, and the user importance may be used as a measure of the importance of the user using the audio playing device. Specifically, the user importance of the audio playing device may be determined according to the terminal type of the audio playing device. In some embodiments, when the audio playing device sends the connection request, the device name of the audio playing device may be sent to the electronic device, and the electronic device determines the terminal type of the audio playing device based on the device name, and then determines the user importance of the audio playing device based on a preset correspondence between the terminal type and the user importance.
Determining the user importance of each audio playing device; and determining the priority of each audio playing device based on the user importance of each audio playing device, and determining a target user terminal from the plurality of audio playing devices based on the priorities of the plurality of audio playing devices. Specifically, the priority is positively correlated with the user importance, that is, the higher the user importance, the lower the priority, the lower the user importance, and the higher the priority, or the priority is negatively correlated with the user importance, that is, the higher the user importance, the higher the priority, the lower the user importance, and the lower the priority.
As another embodiment, it is assumed that at least one audio playing device is allocated to each audio to be played for playing, so that each audio to be played is played and possibly multiple audio playing devices play the same audio to be played at the same time. For example, if the number of the audio playing devices is 3, then the audio playing devices are respectively device 1, device 2, and device 3, and the number of the audio to be played is 3, then the total audio playing device is three audio playing devices and speakers of the electronic device, and 4 total audio playing devices are provided, assuming that 3 audio to be played are respectively audio 1, audio 2, and audio 3, then determining one audio from audio 1, audio 2, and audio 3 as a first target audio, for example, audio 1 is a first target audio, then audio 2 and audio 3 as a second target audio, determining at least two audio playing devices from device 1, device 2, and device 3 to play audio 2 and audio 3 respectively, for example, the audio playing device corresponding to audio 2 is device 1 and device 2, the audio playing device corresponding to audio 3 is device 3, it can be seen that the audio playing devices corresponding to audio 2 and audio 3 are different from each other, then devices 1 and 2 play audio 2 together.
As an embodiment, the determining the first target audio from the plurality of audios to be played may include: determining a data type corresponding to each audio to be played; and determining a first target audio based on the data type corresponding to each audio to be played. Specifically, the data types may include an audio type, a video type, a game type, a call type, a prompt voice type, and the like.
As an implementation manner, a playing request corresponding to each audio to be played is determined, a service module corresponding to the playing request is determined, and the service module triggers the playing request of the audio to be played. And determining the data type of the audio to be played requested to be played by the service module based on the type of the service module.
Specifically, the service module may be a function module in an application program in the audio playing device, for example, if the application program is a game application program, a video playing module may be included in the game application program for playing some game pictures and audio. The service type of the service module may be an application type of an application program corresponding to the service module, or may be a function type of the service module. For example, a certain service module is a video playing module in a game application program, the type of the application program corresponding to the service module, i.e., the game type, may be used as the service type of the service module, and the function type of the service module, i.e., the audio type corresponding to the video playing module, may also be used as the function type of the service module. Then, the service type of the service module is used as the data type of the audio to be played requested to be played by the service module.
In this embodiment, the service type of the service module may be a program type of an application program corresponding to the service module. And then, according to a first corresponding relation between the preset program type and the user importance, determining the user importance corresponding to the service module, and further determining the user terminal reading of each first application program. In some embodiments, the user importance of video, game, audio, and call types increases in order in the first correspondence. Therefore, after the service type corresponding to each audio playing device is determined, the user importance corresponding to the service type of each audio playing device is determined.
It should be noted that the functions of some application programs may include multiple functions, for example, one application program may include functions of audio playing (e.g., song playing), video playing (e.g., video file playing), call, and the like, and then the frequency of the application program executing different functions within a preset time period may be counted, and the type corresponding to the function with the highest frequency is taken as the program type of the application program. For example, if the frequency of playing an audio file is the highest in a preset time period, the type of the application program is the audio type, and if the frequency of playing a video file is the highest in a preset time period, the type of the application program is the video type.
As an implementation manner, the implementation manner of determining the first target audio based on the data type corresponding to each audio to be played is to search for the audio to be played belonging to a specified type in the data types of the multiple audio to be played; and determining the first target audio based on the audio to be played belonging to the specified type. The specified type may be a type corresponding to a video picture, that is, the audio to be played of the specified type corresponds to a video picture, and the specified type may include a video type, a game type, a navigation voice type, and the like, which are types in which a video picture is played while the audio is played. Of course, the specified type may be other types, and may be specifically set according to actual use requirements, which is not limited herein. In the embodiment of the application, the audio to be played in the specified type corresponds to the video picture, the audio in the specified type is used as the first target audio, and the video picture of the video file corresponding to the first target audio is displayed on the screen of the electronic device, so that when the electronic device plays the video file, the picture and the audio of the video file are both output by the electronic device, and the watching experience of a user can be improved.
If the number of searched to-be-played audios of which the data types belong to the specified types is one, taking the to-be-played audio of the specified type as a first target audio, and if the number of the to-be-played audios of the specified types is multiple, determining one to-be-played audio from the multiple to-be-played audio as the first target audio, specifically, if the number of the to-be-played audios of the specified types is multiple, determining a to-be-selected application program corresponding to each to-be-played audio of the specified types, where the to-be-selected application program is an application program requesting to play the to-be-played audio; determining a target application program based on the application type of the application program to be selected; and taking the audio to be played corresponding to the target application program as a first target audio.
In one embodiment, the type of the application may be a type set for the application by a developer of the application during development, or a type set for the application by a user after the application is installed on the electronic device. Which category the application belongs to in particular may be set by the user as desired, for example, the user may set a certain social software to an audio category, or to a video category, or to a social category. In addition, application installation software, for example, an application store, is installed in the electronic device. An application list is provided within the application installation software where the user can download applications and update and open applications, and the application installation software can display different applications by category, such as audio, video, or game. Therefore, the user can already know the category of the application when installing the application using the application installation software. Furthermore, the type of the application program can be determined according to the frequency of each service module used by the application program.
The implementation of determining the target application program based on the application type of the application program to be selected is to determine the application program to be selected, of which the application type belongs to a preset type, as the target application program, where the preset type may be a navigation type, a video call type, a video type, or the like, and specifically, may be set according to an actual requirement. As another embodiment, a real-time performance level corresponding to the application type of the application program to be selected may also be determined, and the target application program may be determined based on the real-time performance level. Specifically, a first corresponding relationship may be preset, where the first corresponding relationship includes a plurality of application types and a real-time level corresponding to each application type, the real-time level represents a requirement of an application program of the type on real-time performance of audio playing, and a higher real-time level requires a higher requirement on real-time performance of audio playing, which can be determined based on the first corresponding relationship. And the real-time performance level corresponding to the application type of each application program to be selected is different, and the application program corresponding to the application type with the highest real-time performance level is used as the target application program. Therefore, the audio requested to be played by the application program with high real-time performance level is directly played by the loudspeaker of the electronic equipment, and the problem that the audio needs to be transmitted to the audio playing equipment and the time delay is too long is avoided.
As shown in fig. 7, the audio to be played includes a first song and a navigation voice, the navigation voice corresponds to the video image, and the real-time level is higher than the real-time level of the first song, then the speaker of the electronic device plays the navigation voice, and the audio playing device and the sound box play the first song.
S505: and determining the audio playing equipment corresponding to each second target audio, wherein the audio playing equipment corresponding to each second target audio is different from each other.
S506: and sending the first target audio to the loudspeaker, and sending the second target audio to the audio playing device, so that the audio playing device plays the second target audio under the condition that the loudspeaker plays the first target audio.
Referring to fig. 8, fig. 8 shows an audio playing method provided in an embodiment of the present application, which is applied to the electronic device described above, where the electronic device includes a speaker, and an execution subject of the method is the electronic device, and specifically, the method includes: s801 to S805.
S801: and responding to the connection with the audio playing equipment, and acquiring the audio to be played.
S802: if the first number is smaller than the second number, a first target audio is determined from the multiple to-be-played audios, and an audio except the first target audio in the multiple to-be-played audios is used as an alternative audio.
Since the number of the total playing devices is smaller than the number of the currently requested to be played audio, it cannot be guaranteed that all the currently required to be played audio can be played, and therefore, the audio to be played needs to be screened. Specifically, first, a first target audio is determined from the multiple audios to be played, and then, reference may be made to the foregoing embodiment for a manner of determining the first target audio, which is not described herein again. Then, the audio except the first target audio in the plurality of audios to be played is used as the alternative audio.
For example, if the number of the audio playing devices is 3, then the audio playing devices are device 1, device 2, and device 3, respectively, and the number of the audio to be played is 5, then the total audio playing device is three audio playing devices and speakers of the electronic device, and totally 4, assuming that 5 audio to be played are audio 1, audio 2, audio 3, audio 4, and audio 5, respectively, then if audio 1 is the first target audio, audio 2, audio 3, audio 4, and audio 5 are the candidate audio.
S803: and determining the second target audio from the alternative audio, wherein the number of the second target audio is less than or equal to the number of the audio playing devices.
Assuming that the number of the audio playing devices is the third number, the number of the candidate audios is the fourth number, and the fourth number is greater than the third number, it cannot be guaranteed that the current candidate audios can be played at the same time, so the number of the candidate audios needs to be deleted, that is, the audios whose number is less than the third number need to be determined from the candidate audios as the second target audio.
Assuming that the audio 2, the audio 3, the audio 4, and the audio 5 are candidate audios, and the number of audio playing devices is 3, the audio playing devices are respectively device 1, device 2, and device 3, and the fourth number of candidate audios is 4, at least one audio needs to be removed from the candidate audios, so that the number of second target audios is less than or equal to the number of audio playing devices. For example, audio 3, audio 4, and audio 5 are selected from audio 2, audio 3, audio 4, and audio 5 as the second target audio.
As an embodiment, the determining the second target audio from the candidate audios may be determining a data type corresponding to each audio, and taking an audio belonging to a specified type as the second target audio, or may be determining a real-time level corresponding to each candidate audio, and determining the second target audio based on the real-time level, for example, selecting N candidate audios with the highest real-time level as the second target audio, where N is a positive number, and N is less than or equal to the number of audio playing devices.
S804: and determining the audio playing equipment corresponding to each second target audio, wherein the audio playing equipment corresponding to each second target audio is different from each other.
S805: and sending the first target audio to the loudspeaker, and sending the second target audio to the audio playing device, so that the audio playing device plays the second target audio under the condition that the loudspeaker plays the first target audio.
As an embodiment, as shown in fig. 9, assuming that the number of the audio playing devices is 1, and the number of the audio to be played is 1, that is, the navigation APP audio source, where the electronic device is not currently connected to the audio playing device, after the navigation APP audio source is encoded and decoded by an audio codec, and then amplified by an intelligent power amplifier (Smart PA), the navigation APP audio source is played by a speaker of the electronic device. And in the case where the electronic device is currently connected to an audio playback device. The navigation APP sound source can be played by the audio playing device and the loudspeaker of the electronic device together.
As another embodiment, as shown in fig. 10, it is assumed that the number of the audio playing devices is 1, and the number of the audio to be played is 2, that is, the navigation APP audio source and the music APP audio source, because the navigation APP audio source corresponds to a video picture, that is, when navigating, the navigation APP audio source and the navigation picture are played, so that the navigation APP audio source is played by the speaker, and under the condition that the electronic device is currently connected to the audio playing devices, the audio playing devices play the music APP audio source. In fig. 10, the dotted line indicates the data flow of audio to be played by the audio playing device, and the solid line indicates the data flow of audio to be played by the speaker.
As another embodiment, as shown in fig. 11, assuming that the number of audio playing devices is 1, the number of audio to be played is 3, that is, the navigation APP audio source, the music APP audio source 1 and the video APP audio source 2, and the number of audio to be played is greater than the number of total audio devices, one audio may be selected from the audio to be played as a first target audio, and a second target audio is selected from the audio other than the first target audio, for example, the navigation APP audio source is used as the first target audio, the music APP audio source 1 is used as the second target audio, and in addition, both the navigation APP audio source and the video APP audio source 2 correspond to a video picture, but the real-time performance of the navigation APP audio source is higher, so the navigation APP audio source is used as the first target audio, and then the audio playing device plays the music APP audio source 1 and plays the navigation APP audio source.
Referring to fig. 12, a block diagram of an audio playing apparatus 1200 according to an embodiment of the present application is shown, where the apparatus may include: an acquisition unit 1201, a determination unit 1202, and a transmission unit 1203.
An obtaining unit 1201, configured to obtain an audio to be played in response to connection with an audio playing device.
A determining unit 1202, configured to determine, based on the audio to be played, a first target audio sent to the speaker and a second target audio sent to the audio playing device.
Further, the determining unit 1202 is further configured to determine the first target audio and the second target audio from the to-be-played audio based on a first number of total playing devices and a second number of the to-be-played audio, where the total playing devices are the speaker and the audio playing device.
Further, the determining unit 1202 is further configured to set the first target audio and each of the second target audio to be the audio to be played if the first number is greater than or equal to the second number and the second number is 1.
Further, the determining unit 1202 is further configured to determine a first target audio from the multiple to-be-played audio if the first number is greater than or equal to the second number and the second number is not 1, and use at least part of the multiple to-be-played audio except the first target audio as a second target audio; and determining the audio playing equipment corresponding to each second target audio, wherein the audio playing equipment corresponding to each second target audio is different from each other.
Further, the determining unit 1202 is further configured to determine a first target audio from the multiple to-be-played audios if the first number is smaller than the second number, and use an audio of the multiple to-be-played audios except the first target audio as an alternative audio; determining the second target audio from the alternative audio, wherein the number of the second target audio is less than or equal to the number of the audio playing devices; and determining the audio playing equipment corresponding to each second target audio, wherein the audio playing equipment corresponding to each second target audio is different from each other.
Further, the determining unit 1202 is further configured to determine a first target audio from the multiple audios to be played, and an audio other than the first target audio in the multiple audios to be played is used as an alternative audio; determining the second target audio from the alternative audio.
Further, the determining unit 1202 is further configured to determine a data type corresponding to each audio to be played; and determining a first target audio based on the data type corresponding to each audio to be played.
Further, the determining unit 1202 is further configured to search for the audio to be played belonging to a specified type in the data types of the multiple audio to be played; and determining the first target audio based on the audio to be played belonging to the specified type. And the audio to be played in the specified type corresponds to a video picture, and the video picture is displayed on a screen of the electronic equipment.
Further, the determining unit 1202 is further configured to determine, if multiple audio to be played that belongs to the specified type is available, a to-be-selected application program corresponding to each audio to be played that belongs to the specified type, where the to-be-selected application program is an application program that requests to play the audio to be played; determining a target application program based on the application type of the application program to be selected; and taking the audio to be played corresponding to the target application program as a first target audio.
Further, the audio duration of the audio to be played is greater than a specified value.
A sending unit 1203, configured to send the first target audio to the speaker, and send the second target audio to the audio playing device, so that the audio playing device plays the second target audio when the speaker plays the first target audio.
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.
Referring to fig. 13, a block diagram of an electronic device according to an embodiment of the present application is shown. The electronic device 100 may be a smart phone, a tablet computer, an electronic book, or other electronic devices capable of running an application. The electronic device 100 in the present application may include one or more of the following components: a processor 110, a memory 120, 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 a method as described in the aforementioned method embodiments.
Processor 110 may include one or more processing cores. The processor 110 connects various parts within the overall electronic device 100 using various interfaces and lines, and performs various functions of the electronic device 100 and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 120 and calling 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.
Referring to fig. 14, a block diagram of a computer-readable storage medium according to an embodiment of the present application is shown. The computer readable medium 1400 has stored therein program code that can be invoked by a processor to perform the methods described in the method embodiments above.
The computer-readable storage medium 1400 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. Optionally, computer-readable storage medium 1400 includes a non-volatile computer-readable storage medium. The computer readable storage medium 1400 has storage space for program code 1410 for performing any of the method steps described above. The program code can be read from or written to one or more computer program products. Program code 1410 may be compressed, for example, in a suitable form.
Referring to fig. 15, a block diagram 1500 of a computer program product according to an embodiment of the present application is shown. Included in the computer program product 1500 is a computer program/instructions 1510, the computer program/instructions 1510 realizing the steps of the above-described method when executed by a processor.
To sum up, according to the audio playing method, the audio playing device, the electronic device, the computer readable medium and the product provided by the present application, when the electronic device is connected to a peripheral audio playing device, to-be-played audio is obtained, the speaker and the peripheral audio playing device are used as a total playing device, based on a first number of the total playing devices and a second number of the to-be-played audio, a first target audio and a second target audio are determined from the to-be-played audio, and the speaker is controlled to play the first target audio; and sending each second target audio to the peripheral audio playing device corresponding to the second target audio, so that each peripheral audio playing device plays the second target audio corresponding to the peripheral audio playing device under the condition that the loudspeaker plays the first target audio. Therefore, when the electronic equipment is connected with the peripheral audio playing equipment, the loudspeaker of the electronic equipment and the peripheral audio playing equipment can play audio, and the situation that the loudspeaker of the electronic equipment stops playing the audio due to the fact that the electronic equipment is connected with the peripheral audio playing equipment can be avoided.
Specifically, when an electronic device (e.g., a mobile phone terminal) is connected with a bluetooth audio peripheral, the dual-sound function of the device can provide audio enhancement in a scene and a demand; through the double sound of the mobile phone terminal and the audio peripheral (vehicle-mounted Bluetooth sound box) and the playing of sound sources of different APPs (navigation and music) respectively, the mutual influence and interference in the playing process are reduced, and clear and smooth listening experience is achieved; when the same sound source is played, the mobile phone plays the double sound of the Bluetooth audio equipment, the space sense and the telepresence of music are enhanced, and the effect of music following is achieved.
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 (15)

1. An audio playing method applied to an electronic device, wherein the electronic device comprises a loudspeaker, the method comprising:
responding to the connection with audio playing equipment, and acquiring audio to be played;
determining a first target audio sent to the loudspeaker and a second target audio sent to the audio playing device based on the audio to be played;
and sending the first target audio to the loudspeaker, and sending the second target audio to the audio playing device, so that the audio playing device plays the second target audio under the condition that the loudspeaker plays the first target audio.
2. The method of claim 1, wherein determining a first target audio to send to the speaker and a second target audio to send to the audio playback device based on the audio to be played comprises:
determining the first target audio and the second target audio from the audio to be played based on a first number of total playing devices and a second number of the audio to be played, wherein the total playing devices are the loudspeaker and the audio playing device.
3. The method of claim 2, wherein the determining the first target audio and the second target audio from the audio to be played based on a first number of total playing devices and a second number of the audio to be played comprises:
and if the first number is greater than or equal to the second number and the second number is 1, setting the first target audio and each second target audio to be the audio to be played.
4. The method of claim 2, wherein the determining the first target audio and the second target audio from the audio to be played based on a first number of total playing devices and a second number of the audio to be played comprises:
if the first number is greater than or equal to the second number and the second number is not 1, determining a first target audio from the multiple to-be-played audios, and taking at least part of the audio except the first target audio in the multiple to-be-played audios as a second target audio;
and determining the audio playing equipment corresponding to each second target audio, wherein the audio playing equipment corresponding to each second target audio is different from each other.
5. The method of claim 2, wherein the determining the first target audio and the second target audio from the audio to be played based on a first number of total playing devices and a second number of the audio to be played comprises:
if the first number is smaller than the second number, determining a first target audio from the multiple to-be-played audios, and taking an audio except the first target audio from the multiple to-be-played audios as an alternative audio;
determining the second target audio from the alternative audio, wherein the number of the second target audio is less than or equal to the number of the audio playing devices;
and determining the audio playing equipment corresponding to each second target audio, wherein the audio playing equipment corresponding to each second target audio is different from each other.
6. The method of claim 1, wherein the audio to be played is multiple, and wherein determining the first target audio to send to the speaker and the second target audio to send to the audio playback device based on the audio to be played comprises:
determining a first target audio from a plurality of audios to be played, wherein the audios except the first target audio in the audios to be played serve as alternative audios;
determining the second target audio from the alternative audio.
7. The method according to claim 4, 5 or 6, wherein the determining a first target audio from the plurality of audios to be played comprises:
determining a data type corresponding to each audio to be played;
and determining a first target audio based on the data type corresponding to each audio to be played.
8. The method of claim 7, wherein the determining the first target audio based on the data type corresponding to each audio to be played comprises:
searching for the audio to be played which belongs to the specified type in the data types of the audio to be played;
and determining the first target audio based on the audio to be played belonging to the specified type.
9. The method of claim 8, wherein the specified type of audio to be played corresponds to a video frame, and wherein the video frame is displayed on a screen of the electronic device.
10. The method of claim 8, wherein the determining the first target audio based on the audio to be played belonging to the specified type comprises:
if the audio to be played belonging to the specified type is multiple, determining a to-be-selected application program corresponding to each audio to be played belonging to the specified type, wherein the to-be-selected application program is an application program requesting to play the audio to be played;
determining a target application program based on the application type of the application program to be selected;
and taking the audio to be played corresponding to the target application program as a first target audio.
11. The method according to any one of claims 1-6, wherein the audio duration of the audio to be played is greater than a specified value.
12. An audio playing apparatus, applied to an electronic device, the electronic device including a speaker, the audio playing apparatus comprising:
the acquisition unit is used for responding to the connection with the audio playing equipment and acquiring the audio to be played;
the determining unit is used for determining a first target audio sent to the loudspeaker and a second target audio sent to the audio playing device based on the audio to be played;
and the sending unit is used for sending the first target audio to the loudspeaker and sending the second target audio to the audio playing equipment, so that the audio playing equipment plays the second target audio under the condition that the loudspeaker plays the first target audio.
13. An electronic device, comprising:
one or more processors;
a memory;
a speaker;
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-11.
14. A computer-readable medium having stored program code executable by a processor, the program code causing the processor to perform the method of any one of claims 1-11 when executed by the processor.
15. A computer product comprising program code executable by a processor, the program code causing the processor to perform the method of any one of claims 1 to 11 when executed by the processor.
CN202111177786.0A 2021-10-09 2021-10-09 Audio playing method and device, electronic equipment, computer readable medium and product Pending CN113885827A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111177786.0A CN113885827A (en) 2021-10-09 2021-10-09 Audio playing method and device, electronic equipment, computer readable medium and product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111177786.0A CN113885827A (en) 2021-10-09 2021-10-09 Audio playing method and device, electronic equipment, computer readable medium and product

Publications (1)

Publication Number Publication Date
CN113885827A true CN113885827A (en) 2022-01-04

Family

ID=79005690

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111177786.0A Pending CN113885827A (en) 2021-10-09 2021-10-09 Audio playing method and device, electronic equipment, computer readable medium and product

Country Status (1)

Country Link
CN (1) CN113885827A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024109209A1 (en) * 2022-11-21 2024-05-30 中兴通讯股份有限公司 Audio playback method and system, electronic device, and computer readable medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105451138A (en) * 2016-01-27 2016-03-30 胡明寿 Audio output method and device
WO2018145101A1 (en) * 2017-02-06 2018-08-09 Savant Systems, Llc A/v interconnection architecture including an audio down-mixing transmitter a/v endpoint and distributed channel amplification
CN109240638A (en) * 2018-08-29 2019-01-18 北京轩辕联科技有限公司 Audio-frequency processing method and device for vehicle
WO2019195799A1 (en) * 2018-04-05 2019-10-10 Synaptics Incorporated Context-aware control for smart devices
CN112181353A (en) * 2020-10-15 2021-01-05 Oppo广东移动通信有限公司 Audio playing method and device, electronic equipment and storage medium
US20210176580A1 (en) * 2019-12-09 2021-06-10 Samsung Electronics Co., Ltd. Audio output apparatus and method of controlling thereof

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105451138A (en) * 2016-01-27 2016-03-30 胡明寿 Audio output method and device
WO2018145101A1 (en) * 2017-02-06 2018-08-09 Savant Systems, Llc A/v interconnection architecture including an audio down-mixing transmitter a/v endpoint and distributed channel amplification
WO2019195799A1 (en) * 2018-04-05 2019-10-10 Synaptics Incorporated Context-aware control for smart devices
CN109240638A (en) * 2018-08-29 2019-01-18 北京轩辕联科技有限公司 Audio-frequency processing method and device for vehicle
US20210176580A1 (en) * 2019-12-09 2021-06-10 Samsung Electronics Co., Ltd. Audio output apparatus and method of controlling thereof
CN113038343A (en) * 2019-12-09 2021-06-25 三星电子株式会社 Audio output device and control method thereof
CN112181353A (en) * 2020-10-15 2021-01-05 Oppo广东移动通信有限公司 Audio playing method and device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024109209A1 (en) * 2022-11-21 2024-05-30 中兴通讯股份有限公司 Audio playback method and system, electronic device, and computer readable medium

Similar Documents

Publication Publication Date Title
CN111078448B (en) Method for processing audio abnormity and electronic equipment
US7931537B2 (en) Voice input in a multimedia console environment
US11474775B2 (en) Sound effect adjustment method, device, electronic device and storage medium
CN110876180B (en) Power consumption processing method and device, electronic equipment and computer readable medium
CN109284080B (en) Sound effect adjusting method and device, electronic equipment and storage medium
CN109151566B (en) Audio playing method and device, electronic equipment and computer readable medium
US9825969B2 (en) System and method for controlling a rendering device based upon detected user proximity
CN107656719B (en) Electronic equipment prompt tone setting method and electronic equipment
CN109379490B (en) Audio playing method and device, electronic equipment and computer readable medium
WO2019071808A1 (en) Video image display method, apparatus and system, terminal device, and storage medium
US9369587B2 (en) System and method for software turret phone capabilities
CN115022773A (en) Bluetooth device audio control method, device and storage medium
CN113793625B (en) Audio playing method and device
KR20110050830A (en) Apparatus and method for playing the multisound channel content using dlna in portable communication system
CN113885827A (en) Audio playing method and device, electronic equipment, computer readable medium and product
JP6151112B2 (en) REPRODUCTION DEVICE, REPRODUCTION DEVICE CONTROL METHOD, SERVER, AND SYSTEM
CN113760219A (en) Information processing method and device
CN115314865A (en) Audio processing method and device, electronic equipment and computer readable medium
CN106658138B (en) Smart television and its signal source switch method, device
JP7456387B2 (en) Information processing device and information processing method
CN104980583A (en) Event reminding method and terminal
CN113993114B (en) Bluetooth broadcasting method, device and computer readable storage medium
CN115065835A (en) Live-broadcast expression display processing method, server, electronic equipment and storage medium
JP2019144836A (en) Audio output device, program, and program recording medium
CN114422840A (en) Audio track switching method 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