CN113126948B - Audio playing method and related equipment - Google Patents

Audio playing method and related equipment Download PDF

Info

Publication number
CN113126948B
CN113126948B CN201911404807.0A CN201911404807A CN113126948B CN 113126948 B CN113126948 B CN 113126948B CN 201911404807 A CN201911404807 A CN 201911404807A CN 113126948 B CN113126948 B CN 113126948B
Authority
CN
China
Prior art keywords
audio
audio stream
capability
stream
resampling
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
CN201911404807.0A
Other languages
Chinese (zh)
Other versions
CN113126948A (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202111555399.6A priority Critical patent/CN114398020A/en
Priority to CN201911404807.0A priority patent/CN113126948B/en
Publication of CN113126948A publication Critical patent/CN113126948A/en
Application granted granted Critical
Publication of CN113126948B publication Critical patent/CN113126948B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/16Sound input; Sound output
    • G06F3/162Interface to dedicated audio devices, e.g. audio drivers, interface to CODECs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Telephone Function (AREA)

Abstract

The embodiment of the invention discloses an audio playing method and related equipment. Comprising the following steps: the first device acquires the audio capability of the second device; converting the first audio stream into a second audio stream according to the audio capability; and sending the second audio stream to the second device, wherein the second audio stream is used for audio playing of the second device. By adopting the embodiment of the invention, the audio playing effect can be improved.

Description

Audio playing method and related equipment
Technical Field
The present invention relates to the field of electronic technologies, and in particular, to an audio playing method and related devices.
Background
When the Android mobile phone is used for multi-device networking, the remote device is generally used as an output device for audio playing, so that the sharing of mobile phone and remote device resources is achieved, and the audio experience of a user is improved. However, since distributed remote devices vary widely, many low-cost remote devices do not support audio resampling capability or can only use playback of certain fixed audio parameters, in which case audio playback by these remote devices may not be compatible, resulting in poor audio playback in a multi-device networking scenario.
Disclosure of Invention
The embodiment of the invention provides an audio playing method and related equipment, which improve the quality and effect of audio playing.
In a first aspect, an embodiment of the present invention provides an audio playing method, including: the first device acquires the audio capability of the second device; converting the first audio stream into a second audio stream according to the audio capability; and sending a second audio stream to the second device, wherein the second audio stream is used for audio playing by the second device. The audio stream is processed according to the differentiated audio capability of the second device, so that the processed audio stream can meet the playing requirement of the second device, and the quality and effect of the audio are improved.
In one possible design, the audio capability includes target audio parameters; the first device converts the first audio stream into a second audio stream corresponding to the target audio parameter. The audio stream is processed according to the target audio parameters, so that the processed audio stream can meet the playing requirement of the second equipment, and the quality and effect of the audio are improved.
In another possible design, the audio capability includes a target audio parameter corresponding to each of a plurality of audio types; the method comprises the steps that a first device obtains an audio type of a first audio stream; the first audio stream is converted into a second audio stream according to the audio type. The audio stream is processed according to the target audio parameters corresponding to each audio type, so that the processed audio stream can meet the playing requirement of the second equipment, and the quality and effect of the audio are improved.
In another possible design, the audio capabilities include audio codec capabilities; when the second device supports audio encoding and decoding, the first device converts the first audio stream into a second audio stream in a compression encoding mode; when the second device does not support audio codec, the first device converts the first audio stream into the second audio stream by pulse code modulation. Whether the audio stream is encoded or not is determined according to the audio encoding and decoding capability, so that the audio stream can be normally played.
In another possible design, the audio capability includes a networking connectivity; when the networking connection mode is wireless connection, the first device converts the first audio stream into the second audio stream through the compression coding mode. And in the wireless connection mode, the data flow is reduced by a compression coding mode, so that the wireless bandwidth resource is effectively utilized. When the networking connection mode is a wired connection mode, the first device converts the first audio stream into the second audio stream through pulse code modulation. Under the wired connection mode, the system has sufficient bandwidth, and ensures the audio quality through pulse code modulation.
In another possible design, the audio capabilities include audio codec capability and networking connectivity; when the second device supports audio encoding and decoding and the networking connection mode is wireless connection, the first device converts the first audio stream into the second audio stream through the compression coding mode, and reduces the data flow through the compression coding mode, so that wireless bandwidth resources are effectively utilized. When the second device does not support audio encoding and decoding and the networking connection mode is wireless connection, the first device converts the first audio stream into the second audio stream through pulse code modulation.
In another possible design, the audio capability includes resampling capability; if the second device does not support audio resampling, the first device performs converting the first audio stream into the second audio stream according to the audio capabilities.
In another possible design, the first device sends a request message to the second device requesting audio capabilities of the second device.
In a second aspect, an embodiment of the present invention provides an audio playing method, including: the second device sending audio capabilities to the first device, the audio capabilities being for the first device to convert the first audio stream into a second audio stream; receiving a second audio stream sent by the first device; and playing the second audio stream in an audio mode. The audio stream is processed according to the differentiated audio capability of the second device, so that the processed audio stream can meet the playing requirement of the second device, and the quality and effect of the audio are improved.
In one possible design, the second device receives a request message sent by the first device, the request message requesting audio capabilities of the second device.
In another possible design, the audio capabilities include at least one of target audio parameters, audio codec capabilities, and networking connectivity.
In a third aspect, an embodiment of the present application provides an audio playing apparatus configured to implement the method and the function performed by the first device in the first aspect, where the method and the function are implemented by hardware/software, and the hardware/software includes a module corresponding to the function.
In a fourth aspect, an embodiment of the present application provides an audio playing apparatus configured to implement the method and the function performed by the second device in the second aspect, which are implemented by hardware/software, where the hardware/software includes a module corresponding to the function.
In a fifth aspect, an embodiment of the present application provides a first apparatus, including: the device comprises a processor, a memory and a communication bus, wherein the communication bus is used for realizing connection communication between the processor and the memory, and the processor executes a program stored in the memory for realizing the steps of the first aspect.
In one possible design, the first device provided by the present application may include a module for performing the behavior correspondence of the first device in the above method design. The modules may be software and/or hardware.
In a sixth aspect, an embodiment of the present application provides a second apparatus, including: the device comprises a processor, a memory and a communication bus, wherein the communication bus is used for realizing connection communication between the processor and the memory, and the processor executes a program stored in the memory for realizing the steps provided in the second aspect.
In one possible design, the second device provided by the present application may include a module for performing the behavior correspondence of the second device in the above method design. The modules may be software and/or hardware.
In a seventh aspect, the present application provides a computer readable storage medium having instructions stored therein which, when run on a computer, cause the methods of the above aspects to be performed.
In an eighth aspect, the application provides a computer program product comprising instructions which, when run on a computer, cause the method of the above aspects to be performed.
In a ninth aspect, the present application provides a chip comprising a processor for calling from a memory and executing instructions stored in the memory.
In a tenth aspect, the present application provides a communication system comprising at least one first device and at least one second device, wherein the first device performs the methods and functions performed by the first device in the first aspect, and the second device performs the methods and functions performed by the second device in the second aspect.
Drawings
In order to more clearly describe the embodiments of the present application or the technical solutions in the background art, the following description will describe the drawings that are required to be used in the embodiments of the present application or the background art.
Fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 2 is a schematic flow chart of an audio transmission method according to an embodiment of the present application;
fig. 3 is a flowchart of another audio transmission method according to an embodiment of the present application;
fig. 4 is a schematic flow chart of an audio playing method according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an audio playing device according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of another audio playing device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a first device according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a second apparatus according to an embodiment of the present application.
Detailed Description
Embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application.
In the embodiment of the present application, the first device and the second device may be an electronic device 100 as shown in fig. 1. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, keys 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identity module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It should be understood that the illustrated structure of the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the application, electronic device 100 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
The I2C interface is a bi-directional synchronous serial bus comprising a serial data line (SDA) and a serial clock line (derail clock line, SCL). In some embodiments, the processor 110 may contain multiple sets of I2C buses. The processor 110 may be coupled to the touch sensor 180K, charger, flash, camera 193, etc., respectively, through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through an I2C interface, such that the processor 110 communicates with the touch sensor 180K through an I2C bus interface to implement a touch function of the electronic device 100.
The I2S interface may be used for audio communication. In some embodiments, the processor 110 may contain multiple sets of I2S buses. The processor 110 may be coupled to the audio module 170 via an I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may transmit an audio signal to the wireless communication module 160 through the I2S interface, to implement a function of answering a call through the bluetooth headset.
PCM interfaces may also be used for audio communication to sample, quantize and encode analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface. In some embodiments, the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface to implement a function of answering a call through the bluetooth headset. Both the I2S interface and the PCM interface may be used for audio communication.
The UART interface is a universal serial data bus for asynchronous communications. The bus may be a bi-directional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is typically used to connect the processor 110 with the wireless communication module 160. For example: the processor 110 communicates with a bluetooth module in the wireless communication module 160 through a UART interface to implement a bluetooth function. In some embodiments, the audio module 170 may transmit an audio signal to the wireless communication module 160 through a UART interface, to implement a function of playing music through a bluetooth headset.
The MIPI interface may be used to connect the processor 110 to peripheral devices such as a display 194, a camera 193, and the like. The MIPI interfaces include camera serial interfaces (camera serial interface, CSI), display serial interfaces (display serial interface, DSI), and the like. In some embodiments, processor 110 and camera 193 communicate through a CSI interface to implement the photographing functions of electronic device 100. The processor 110 and the display 194 communicate via a DSI interface to implement the display functionality of the electronic device 100.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal or as a data signal. In some embodiments, a GPIO interface may be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like. The GPIO interface may also be configured as an I2C interface, an I2S interface, a UART interface, an MIPI interface, etc.
The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge the electronic device 100, and may also be used to transfer data between the electronic device 100 and a peripheral device. And can also be used for connecting with a headset, and playing audio through the headset. The interface may also be used to connect other electronic devices, such as AR devices, etc.
It should be understood that the interfacing relationship between the modules illustrated in the embodiments of the present application is only illustrative, and is not meant to limit the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also employ different interfacing manners in the above embodiments, or a combination of multiple interfacing manners.
The charge management module 140 is configured to receive a charge input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charge management module 140 may receive a charging input of a wired charger through the USB interface 130. In some wireless charging embodiments, the charge management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 140 may also supply power to the electronic device through the power management module 141 while charging the battery 142.
The power management module 141 is used for connecting the battery 142, and the charge management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 to power the processor 110, the internal memory 121, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be configured to monitor battery capacity, battery cycle number, battery health (leakage, impedance) and other parameters. In other embodiments, the power management module 141 may also be provided in the processor 110. In other embodiments, the power management module 141 and the charge management module 140 may be disposed in the same device.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed into a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution for wireless communication including 2G/3G/4G/5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA), etc. The mobile communication module 150 may receive electromagnetic waves from the antenna 1, perform processes such as filtering, amplifying, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can amplify the signal modulated by the modem processor, and convert the signal into electromagnetic waves through the antenna 1 to radiate. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be provided in the same device as at least some of the modules of the processor 110.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low frequency baseband signal to the baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs sound signals through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or video through the display screen 194. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional module, independent of the processor 110.
The wireless communication module 160 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wireless fidelity (wireless fidelity, wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc., as applied to the electronic device 100. The wireless communication module 160 may be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via the antenna 2.
In some embodiments, antenna 1 and mobile communication module 150 of electronic device 100 are coupled, and antenna 2 and wireless communication module 160 are coupled, such that electronic device 100 may communicate with a network and other devices through wireless communication techniques. The wireless communication techniques may include the Global System for Mobile communications (global system for mobile communications, GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), wideband code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC, FM, and/or IR techniques, among others. The GNSS may include a global satellite positioning system (global positioning system, GPS), a global navigation satellite system (global navigation satellite system, GLONASS), a beidou satellite navigation system (beidou navigation satellite system, BDS), a quasi zenith satellite system (quasi-zenith satellite system, QZSS) and/or a satellite based augmentation system (satellite based augmentation systems, SBAS).
The electronic device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
The display screen 194 is used to display images, videos, and the like. The display 194 includes a display panel. The display panel may employ a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED) or an active-matrix organic light-emitting diode (matrix organic light emitting diode), a flexible light-emitting diode (flex), a mini, a Micro led, a Micro-OLED, a quantum dot light-emitting diode (quantum dot light emitting diodes, QLED), or the like. In some embodiments, the electronic device 100 may include 1 or N display screens 194, N being a positive integer greater than 1.
The electronic device 100 may implement photographing functions through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
The ISP is used to process data fed back by the camera 193. For example, when photographing, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electric signal, and the camera photosensitive element transmits the electric signal to the ISP for processing and is converted into an image visible to naked eyes. ISP can also optimize the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in the camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transferred to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. In some embodiments, electronic device 100 may include 1 or N cameras 193, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process other digital signals besides digital image signals. For example, when the electronic device 100 selects a frequency bin, the digital signal processor is used to fourier transform the frequency bin energy, or the like.
Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record video in a variety of encoding formats, such as: dynamic picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
The NPU is a neural-network (NN) computing processor, and can rapidly process input information by referencing a biological neural network structure, for example, referencing a transmission mode between human brain neurons, and can also continuously perform self-learning. Applications such as intelligent awareness of the electronic device 100 may be implemented through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, etc.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to enable expansion of the memory capabilities of the electronic device 100. The external memory card communicates with the processor 110 through an external memory interface 120 to implement data storage functions. For example, files such as music, video, etc. are stored in an external memory card.
The internal memory 121 may be used to store computer executable program code including instructions. The internal memory 121 may include a storage program area and a storage data area. The storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data created during use of the electronic device 100 (e.g., audio data, phonebook, etc.), and so on. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like. The processor 110 performs various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
The electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or a portion of the functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also referred to as a "horn," is used to convert audio electrical signals into sound signals. The electronic device 100 may listen to music, or to hands-free conversations, through the speaker 170A.
A receiver 170B, also referred to as a "earpiece", is used to convert the audio electrical signal into a sound signal. When electronic device 100 is answering a telephone call or voice message, voice may be received by placing receiver 170B in close proximity to the human ear.
Microphone 170C, also referred to as a "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can sound near the microphone 170C through the mouth, inputting a sound signal to the microphone 170C. The electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C, and may implement a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may also be provided with three, four, or more microphones 170C to enable collection of sound signals, noise reduction, identification of sound sources, directional recording functions, etc.
The earphone interface 170D is used to connect a wired earphone. The headset interface 170D may be a USB interface 130 or a 3.5mm open mobile electronic device platform (open mobile terminal platform, OMTP) standard interface, a american cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The pressure sensor 180A is used to sense a pressure signal, and may convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. The pressure sensor 180A is of various types, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a capacitive pressure sensor comprising at least two parallel plates with conductive material. The capacitance between the electrodes changes when a force is applied to the pressure sensor 180A. The electronic device 100 determines the strength of the pressure from the change in capacitance. When a touch operation is applied to the display screen 194, the electronic apparatus 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 may also calculate the location of the touch based on the detection signal of the pressure sensor 180A. In some embodiments, touch operations that act on the same touch location, but at different touch operation strengths, may correspond to different operation instructions. For example: and executing an instruction for checking the short message when the touch operation with the touch operation intensity smaller than the first pressure threshold acts on the short message application icon. And executing an instruction for newly creating the short message when the touch operation with the touch operation intensity being greater than or equal to the first pressure threshold acts on the short message application icon.
The gyro sensor 180B may be used to determine a motion gesture of the electronic device 100. In some embodiments, the angular velocity of electronic device 100 about three axes (i.e., x, y, and z axes) may be determined by gyro sensor 180B. The gyro sensor 180B may be used for photographing anti-shake. For example, when the shutter is pressed, the gyro sensor 180B detects the shake angle of the electronic device 100, calculates the distance to be compensated by the lens module according to the angle, and makes the lens counteract the shake of the electronic device 100 through the reverse motion, so as to realize anti-shake. The gyro sensor 180B may also be used for navigating, somatosensory game scenes.
The air pressure sensor 180C is used to measure air pressure. In some embodiments, electronic device 100 calculates altitude from barometric pressure values measured by barometric pressure sensor 180C, aiding in positioning and navigation.
The magnetic sensor 180D includes a hall sensor. The electronic device 100 may detect the opening and closing of the flip cover using the magnetic sensor 180D. In some embodiments, when the electronic device 100 is a flip machine, the electronic device 100 may detect the opening and closing of the flip according to the magnetic sensor 180D. And then according to the detected opening and closing state of the leather sheath or the opening and closing state of the flip, the characteristics of automatic unlocking of the flip and the like are set.
The acceleration sensor 180E may detect the magnitude of acceleration of the electronic device 100 in various directions (typically three axes). The magnitude and direction of gravity may be detected when the electronic device 100 is stationary. The electronic equipment gesture recognition method can also be used for recognizing the gesture of the electronic equipment, and is applied to horizontal and vertical screen switching, pedometers and other applications.
A distance sensor 180F for measuring a distance. The electronic device 100 may measure the distance by infrared or laser. In some embodiments, the electronic device 100 may range using the distance sensor 180F to achieve quick focus.
The proximity light sensor 180G may include, for example, a Light Emitting Diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 detects infrared reflected light from nearby objects using a photodiode. When sufficient reflected light is detected, it may be determined that there is an object in the vicinity of the electronic device 100. When insufficient reflected light is detected, the electronic device 100 may determine that there is no object in the vicinity of the electronic device 100. The electronic device 100 can detect that the user holds the electronic device 100 close to the ear by using the proximity light sensor 180G, so as to automatically extinguish the screen for the purpose of saving power. The proximity light sensor 180G may also be used in holster mode, pocket mode to automatically unlock and lock the screen.
The ambient light sensor 180L is used to sense ambient light level. The electronic device 100 may adaptively adjust the brightness of the display 194 based on the perceived ambient light level. The ambient light sensor 180L may also be used to automatically adjust white balance when taking a photograph. Ambient light sensor 180L may also cooperate with proximity light sensor 180G to detect whether electronic device 100 is in a pocket to prevent false touches.
The fingerprint sensor 180H is used to collect a fingerprint. The electronic device 100 may utilize the collected fingerprint feature to unlock the fingerprint, access the application lock, photograph the fingerprint, answer the incoming call, etc.
The temperature sensor 180J is for detecting temperature. In some embodiments, the electronic device 100 performs a temperature processing strategy using the temperature detected by the temperature sensor 180J. For example, when the temperature reported by temperature sensor 180J exceeds a threshold, electronic device 100 performs a reduction in the performance of a processor located in the vicinity of temperature sensor 180J in order to reduce power consumption to implement thermal protection. In other embodiments, when the temperature is below another threshold, the electronic device 100 heats the battery 142 to avoid the low temperature causing the electronic device 100 to be abnormally shut down. In other embodiments, when the temperature is below a further threshold, the electronic device 100 performs boosting of the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperatures.
The touch sensor 180K, also referred to as a "touch device". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is for detecting a touch operation acting thereon or thereabout. The touch sensor may communicate the detected touch operation to the application processor to determine the touch event type. Visual output related to touch operations may be provided through the display 194. In other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device 100 at a different location than the display 194.
The bone conduction sensor 180M may acquire a vibration signal. In some embodiments, bone conduction sensor 180M may acquire a vibration signal of a human vocal tract vibrating bone pieces. The bone conduction sensor 180M may also contact the pulse of the human body to receive the blood pressure pulsation signal. In some embodiments, bone conduction sensor 180M may also be provided in a headset, in combination with an osteoinductive headset. The audio module 170 may analyze the voice signal based on the vibration signal of the sound portion vibration bone block obtained by the bone conduction sensor 180M, so as to implement a voice function. The application processor may analyze the heart rate information based on the blood pressure beat signal acquired by the bone conduction sensor 180M, so as to implement a heart rate detection function.
The keys 190 include a power-on key, a volume key, etc. The keys 190 may be mechanical keys. Or may be a touch key. The electronic device 100 may receive key inputs, generating key signal inputs related to user settings and function controls of the electronic device 100.
The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration alerting as well as for touch vibration feedback. For example, touch operations acting on different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 191 may also correspond to different vibration feedback effects by touching different areas of the display screen 194. Different application scenarios (such as time reminding, receiving information, alarm clock, game, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.
The indicator 192 may be an indicator light, may be used to indicate a state of charge, a change in charge, a message indicating a missed call, a notification, etc.
The SIM card interface 195 is used to connect a SIM card. The SIM card may be inserted into the SIM card interface 195, or removed from the SIM card interface 195 to enable contact and separation with the electronic device 100. The electronic device 100 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 195 may support Nano SIM cards, micro SIM cards, and the like. The same SIM card interface 195 may be used to insert multiple cards simultaneously. The types of the plurality of cards may be the same or different. The SIM card interface 195 may also be compatible with different types of SIM cards. The SIM card interface 195 may also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to realize functions such as communication and data communication. In some embodiments, the electronic device 100 employs esims, i.e.: an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
Fig. 2 is a schematic flow chart of an audio transmission method according to an embodiment of the present application, as shown in fig. 2. When the first device is used for multi-device networking, a remote second device is generally used as an audio playing output device, so that resource sharing between the first device and the remote second device is achieved, wherein the second device can be a virtual device. In this scenario, an audio stream is first generated at a first device and transmitted to a hardware abstraction layer (hardware abstraction layer, HAL). The HAL then performs audio encoding compression or uses pulse code modulation (pulse code modulation, PCM) on the audio stream, the audio stream is transmitted to a remote second device through a network, and after the remote second device receives the audio stream, the audio stream is output through an audio playing device of the second device and played, so that the virtualized sharing from the audio of the first device to the audio playing of the remote second device is completed.
As further shown in fig. 3, fig. 3 is a schematic flow chart of another audio transmission method according to an embodiment of the present application. The application program of the first device plays different types of audio (such as call audio, prompt tones, ringtones, music and the like), the Android system plays audio streams to the HAL layer, before sending the audio streams to the HAL layer, the Android system resamples and converts the different audio streams into audio streams with fixed audio parameters (such as sampling rate, sampling precision and channel number), after receiving the audio streams with the fixed audio parameters, the HAL layer compresses or processes the audio encoding of the converted audio streams into a PCM format, the audio streams are transmitted to the second device at the far end through a network, and after receiving the audio streams, the second device at the far end outputs and plays the audio streams through the audio playing device of the device.
In a multi-device networking scenario, when the HAL layer is used to virtualize the audio stream to be played on a remote device, the Android system of the first device can only process the audio stream by adopting fixed audio parameters (such as sampling rate, sampling precision and channel number), and when the second device at the remote device plays different audio types (such as call audio, prompt tone, ringtone and music), the Android system of the first device can only adopt the fixed audio parameters. Because of the large difference between distributed remote devices, many low-cost second devices do not support audio resampling capability, such as low-end internet of things (internet of things, IOT) devices, and only support the most basic playback function due to the requirement of hardware cost. As another example, for a particular audio type (e.g., talk audio, alert tones, ring tones, music, etc.), only fixed audio parameters can be used for playback (e.g., old Linux car sets). In this case, the audio playing of the remote second device may not be compatible, resulting in an audio playing effect in a multi-device networking scenario, affecting the user experience. In order to solve the technical problems, the embodiment of the application provides the following solutions.
Fig. 4 is a schematic flow chart of an audio playing method according to an embodiment of the present application. The steps in the embodiment of the application comprise:
S401, the first device acquires the audio capability of the second device.
In a specific implementation, in a multi-device networking scenario, a first device may acquire an audio capability of a second device through a discovery connection protocol. The audio capability comprises at least one of a target audio parameter, an audio encoding and decoding capability and a networking connection mode. The target audio parameters may include, among other things, sampling rate, number of channels, sampling accuracy, etc. The audio codec capability may include the second device supporting audio codec or the second device not supporting audio codec. For example, the audio codec may be advanced audio coding (advanced audio coding, AAC) or sound coding (OPUS). The networking connection mode can comprise wired connection and wireless connection.
Further, the audio capability may include a target audio parameter corresponding to each of a plurality of audio types. Wherein the plurality of audio types includes alert tones, talk audio, and media audio. For example, the audio capability may include the following information: for the prompt tone, the sampling rate is 16K, the sampling precision is 16bit, and the single sound channel is realized; for call audio, the sampling rate is 8K, the sampling precision is 16bit, and the audio is mono; for media audio, the sampling rate is 48K, the sampling precision is 16bit, and the two channels are used.
Alternatively, the first device may, after establishing a connection with the second device, if it is required to use the remote second device as an audio playback output device, send a request message to the second device, where the request message is used to request audio capabilities of the second device. After receiving the request message of the first device, the second device feeds back the audio capability of the second device to the first device. If the first device does not receive the audio capability within the preset time range, the first device can send a request message to the second device again until receiving the audio capability fed back by the second device.
S402, the first device converts the first audio stream into a second audio stream according to the audio capability. Including the following several alternatives:
a first alternative, the audio capability comprises a target audio parameter; the first device converts the first audio stream into a second audio stream corresponding to the target audio parameter. For example, if the audio parameters used by the first device are sample rate 48K, sample precision 16bit, two channels, and the target audio parameters fed back by the second device include sample rate 16K, sample precision 16bit, mono. It is therefore necessary to convert the first audio stream of the two channels at a sampling rate of 48K with a sampling precision of 16bit into the second audio stream of the two channels at a sampling precision of 16K with a single channel.
The second alternative way is that the audio capability comprises a target audio parameter corresponding to each audio type in a plurality of audio types; the first device obtains the audio type of the first audio stream; and converting the first audio stream into the second audio stream according to the audio type.
For example, if the audio parameters used by the first device are sample rate 48K, sample precision 16bit, binaural, the second device supports alert tones (sample rate 16K, sample precision 16bit, mono), talk audio (sample rate 48K, sample precision 16bit, mono), media audio (sample rate 48K, sample precision 16bit, binaural). For the alert tone, the first audio stream with the sampling rate of 48K, the sampling precision of 16bit and the two channels can be resampled to obtain the second audio stream with the sampling rate of 16K, the sampling precision of 16bit and the single channel. And for call audio, resampling the first audio stream with the sampling rate of 48K, the sampling precision of 16bit and the double channels to obtain the second audio stream with the sampling rate of 48K, the sampling precision of 16bit and the single channels. For media audio, the second audio stream is identical to the first audio stream because the audio parameters used by the first device are identical to the target audio parameters supported by the second device without resampling the first audio stream.
A third alternative, the audio capabilities include audio codec capabilities; when the second device supports audio encoding and decoding, the first device converts the first audio stream into the second audio stream in a compression encoding mode; when the second device does not support audio codec, the first device converts the first audio stream into the second audio stream through pulse code modulation. For example, the second device supports AAC codec, the first device may AAC encode the first audio stream to obtain a second audio stream, and the second device may ACC decode the second audio stream after receiving the second audio stream.
A fourth alternative way, the audio capability includes a networking connection way between the first device and the second device; when the networking connection mode is wireless connection (for example, 2.4G in WIFI wireless mode), the first device converts the first audio stream into the second audio stream through a compression coding mode. And in the wireless connection mode, the data flow is reduced by a compression coding mode, so that the wireless bandwidth resource is effectively utilized. And when the networking connection mode is wire connection, the first equipment converts the first audio stream into the second audio stream through pulse code modulation. Under the wired connection mode, the system has sufficient bandwidth, and ensures the audio quality through pulse code modulation.
The fourth alternative way, the audio capability includes an audio codec capability and a networking connection way. When the second device supports audio encoding and decoding and the networking connection mode is wireless connection, the first device converts the first audio stream into the second audio stream through a compression coding mode; when the second device does not support audio encoding and decoding and the networking connection mode is wireless connection, the first device converts the first audio stream into the second audio stream through pulse code modulation. When the networking connection is a wired connection, the first audio stream may be converted into the second audio stream through pulse code modulation, regardless of whether the second device supports audio codec.
A fifth alternative way, the audio capability includes a target audio parameter, an audio codec capability, and a networking connection way. The first device may convert the first audio stream into the second audio stream according to the target audio parameter, the audio codec capability, and the networking connection. For example, if the audio parameters used by the first device are sample rate 48K, sample precision 16bit, two channels, and the target audio parameters fed back by the second device include sample rate 16K, sample precision 16bit, mono. And the second device supports audio encoding and decoding, and the networking connection mode between the first device and the second device is wireless connection. The first device may resample the sample rate 48K, sample precision 16bit, dual channel first audio stream and ACC encode to obtain a second resulting 16K, sample precision 16bit, single channel second audio stream.
It should be noted that the target audio parameter, the audio encoding and decoding capability and the networking connection mode may be arbitrarily combined, and the first device may convert the first audio stream into the second audio stream according to the audio capability obtained by arbitrary combination. Reference may be made to the above embodiments for specific implementation, and details are not repeated here.
Optionally, the audio capability includes a resampling capability, and the first device performs the step of converting the first audio stream into the second audio stream according to the audio capability if the second device does not support audio resampling. If the second device supports audio resampling, the first device may send the first audio stream to the second device without processing the first audio stream. Optionally, if the second device supports audio resampling, the first device may also convert the first audio stream into a second audio stream and send the second audio stream to the second device for audio playback.
S403, the first device sends the second audio stream to the second device, and the second audio stream is used for audio playing by the second device.
In a specific implementation, in a process that the first device sends the second audio stream to the second device, the second device may perform audio playing on the received second audio stream until all the second audio stream is played. It should be noted that if the second audio stream transmitted by the first device is an encoded audio stream, the second device needs to decode the second audio stream after receiving the second audio stream, and then play the audio.
In the embodiment of the application, the requirement on the audio playing of the second equipment at the far end can be reduced under the multi-equipment networking scene, so that the multi-equipment networking equipment is more diversified, the second equipment can be accessed by supporting basic discovery connection and basic audio playing capability, and the audio playing can be completed under the condition that the second equipment does not support audio resampling or audio encoding and decoding capability. Moreover, the computing power of the first equipment can be fully utilized, and the audio stream is processed according to the differentiated audio capability of the second equipment, so that the processed audio stream can meet the playing requirement of the second equipment, and the quality and effect of the audio are improved.
Fig. 5 is a schematic structural diagram of an audio playing device according to an embodiment of the present application. The device in the embodiment of the application comprises:
an obtaining module 501, configured to obtain an audio capability of the second device;
a processing module 502, configured to convert the first audio stream into a second audio stream according to the audio capability;
a sending module 503, configured to send the second audio stream to the second device, where the second audio stream is used for audio playing by the second device.
Optionally, the audio capability includes a target audio parameter;
The processing module 502 is further configured to convert the first audio stream into a second audio stream corresponding to the target audio parameter.
Optionally, the audio capability includes a target audio parameter corresponding to each of a plurality of audio types;
the processing module 502 is further configured to obtain an audio type of the first audio stream; and converting the first audio stream into the second audio stream according to the audio type.
Optionally, the audio capability includes an audio codec capability;
the processing module 502 is further configured to convert the first audio stream into the second audio stream by a compression encoding manner when the second device supports audio encoding and decoding; the first audio stream is converted to the second audio stream by pulse code modulation when the second device does not support audio codec.
Optionally, the audio capability includes a networking connection mode;
the processing module 502 is further configured to, when the networking connection mode is wireless connection, convert the first audio stream into the second audio stream by the first device through a compression coding mode; and when the networking connection mode is wire connection, the first equipment converts the first audio stream into the second audio stream through pulse code modulation.
Optionally, the audio capability includes audio encoding and decoding capability and a networking connection mode;
the processing module 502 is further configured to convert the first audio stream into the second audio stream by a compression coding manner when the second device supports audio encoding and decoding and the networking connection manner is wireless connection; and when the second equipment does not support audio encoding and decoding and the networking connection mode is wireless connection, converting the first audio stream into the second audio stream through pulse code modulation.
Optionally, the audio capability includes a resampling capability;
the processing module 502 is further configured to execute the step of converting the first audio stream into the second audio stream according to the audio capability if the second device does not support audio resampling.
Optionally, the sending module 503 is further configured to send a request message to the second device, where the request message is used to request the audio capability of the second device.
It should be noted that the implementation of each module may also correspond to the corresponding description of the method embodiment shown in fig. 4, and perform the method and the function performed by the first device in the foregoing embodiment.
Fig. 6 is a schematic structural diagram of another audio playing device according to an embodiment of the present application. The device in the embodiment of the application comprises:
A sending module 601, configured to send an audio capability to a first device, where the audio capability is used by the first device to convert the first audio stream into a second audio stream;
a receiving module 602, configured to receive the second audio stream sent by the first device;
and the processing module 603 is configured to perform audio playing on the second audio stream.
Optionally, the receiving module 602 is further configured to receive a request message sent by the first device, where the request message is used to request the audio capability of the second device.
The audio capability comprises at least one of a target audio parameter, an audio encoding and decoding capability and a networking connection mode.
It should be noted that the implementation of each module may also correspond to the corresponding description of the method embodiment shown in fig. 4, and perform the method and the function performed by the second device in the foregoing embodiment.
With continued reference to fig. 7, fig. 7 is a schematic structural diagram of a first apparatus according to an embodiment of the present application. As shown in fig. 7, the first device may include: at least one processor 701, at least one communication interface 702, at least one memory 703 and at least one communication bus 704.
The processor 701 may be a central processing unit, a general purpose processor, a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. Which may implement or perform the various exemplary logic blocks, modules and circuits described in connection with this disclosure. The processor may also be a combination that performs the function of a computation, e.g., a combination comprising one or more microprocessors, a combination of a digital signal processor and a microprocessor, and so forth. Communication bus 704 may be a peripheral component interconnect standard PCI bus or an extended industry standard architecture EISA bus, or the like. The buses may be classified as address buses, data buses, control buses, etc. For ease of illustration, only one thick line is shown in fig. 7, but not only one bus or one type of bus. Communication bus 704 is used to enable connected communications between these components. The communication interface 702 of the device in the embodiment of the present application is used for performing signaling or data communication with other node devices. The memory 703 may include volatile memory such as nonvolatile dynamic random access memory (nonvolatile random access memory, NVRAM), phase change RAM (PRAM), magnetoresistive RAM (MRAM), etc., and may also include nonvolatile memory such as at least one magnetic disk storage device, electrically erasable programmable read only memory (electrically erasable programmable read-only memory, EEPROM), flash memory device such as flash memory (NOR flash memory) or flash memory (NAND flash memory), semiconductor device such as Solid State Disk (SSD), etc. The memory 703 may optionally also be at least one storage device located remotely from the aforementioned processor 701. The memory 703 may optionally also store a set of program codes, and the processor 701 may optionally also execute the programs executed in the memory 703.
Acquiring the audio capability of the second device;
converting the first audio stream into a second audio stream according to the audio capability;
and sending the second audio stream to the second device, wherein the second audio stream is used for audio playing of the second device.
Optionally, the processor 701 is further configured to perform the following operations:
and converting the first audio stream into a second audio stream corresponding to the target audio parameter.
Optionally, the processor 701 is further configured to perform the following operations:
converting the first audio stream into a second audio stream according to the audio capability comprises:
acquiring an audio type of the first audio stream;
and converting the first audio stream into the second audio stream according to the audio type.
Optionally, the processor 701 is further configured to perform the following operations:
when the second device supports audio encoding and decoding, converting the first audio stream into the second audio stream by a compression encoding mode;
the first audio stream is converted to the second audio stream by pulse code modulation when the second device does not support audio codec.
Optionally, the processor 701 is further configured to perform the following operations:
when the networking connection mode is wireless connection, converting the first audio stream into the second audio stream by a compression coding mode;
And when the networking connection mode is wire connection, converting the first audio stream into the second audio stream through pulse code modulation.
Optionally, the processor 701 is further configured to perform the following operations:
when the second device supports audio encoding and decoding and the networking connection mode is wireless connection, converting the first audio stream into the second audio stream by a compression coding mode;
when the second device does not support audio encoding and decoding and the networking connection mode is wireless connection, the first device converts the first audio stream into the second audio stream through pulse code modulation.
Optionally, the processor 701 is further configured to perform the following operations:
and if the second device does not support audio resampling, executing the step of converting the first audio stream into a second audio stream according to the audio capability.
Optionally, the processor 701 is further configured to perform the following operations:
and sending a request message to the second device, wherein the request message is used for requesting the audio capability of the second device.
Further, the processor may also cooperate with the memory and the communication interface to perform the operations of the first device in the embodiments of the application.
With continued reference to fig. 8, fig. 8 is a schematic structural diagram of a second apparatus according to an embodiment of the present application. As shown, the second device may include: at least one processor 801, at least one communication interface 802, at least one memory 803, and at least one communication bus 804.
Among them, the processor 801 may be various types of processors mentioned above. The communication bus 804 may be a peripheral component interconnect standard PCI bus or an extended industry standard architecture EISA bus or the like. The buses may be classified as address buses, data buses, control buses, etc. For ease of illustration, only one thick line is shown in fig. 8, but not only one bus or one type of bus. The communication bus 804 is used to enable connected communications between these components. The communication interface 802 of the device in the embodiment of the present application is used for performing signaling or data communication with other node devices. The memory 803 may be various types of memories mentioned previously. The memory 803 may optionally be at least one memory device located remotely from the processor 801. A set of program codes is stored in the memory 803, and the processor 801 executes the programs in the memory 803.
Transmitting an audio capability to a first device, the audio capability for the first device to convert the first audio stream into a second audio stream;
receiving the second audio stream sent by the first device;
and playing the second audio stream in an audio mode.
Optionally, the processor 801 is further configured to perform the following operations:
and receiving a request message sent by the first device, wherein the request message is used for requesting the audio capability of the second device.
The audio capability comprises at least one of a target audio parameter, an audio encoding and decoding capability and a networking connection mode.
Further, the processor may also cooperate with the memory and the communication interface to perform the operations of the second device in the embodiments of the application.
Embodiments of the present application also provide a chip system, where the chip system includes a processor and an interface, where the processor is configured to support the first device or the second device to implement the functions involved in any of the foregoing embodiments, for example, to generate or process data and/or information involved in the foregoing methods. The interface is used for receiving or transmitting data and/or information involved in the above method. In one possible design, the system on a chip may further include a memory for program instructions and data necessary for the first device or the second device. The chip system can be composed of chips, and can also comprise chips and other discrete devices.
The embodiments of the present application also provide a processor, coupled to the memory, for performing any of the methods and functions of the first device or the second device in any of the embodiments described above.
Embodiments of the present application also provide a computer program product comprising instructions which, when run on a computer, cause the computer to perform any of the methods and functions described in any of the embodiments above in relation to the first device or the second device.
The embodiment of the application also provides a device for executing any method and function related to the first device or the second device in any of the above embodiments.
The embodiment of the application also provides a communication system, which comprises at least one first device and at least one second device, wherein the at least one first device and the at least one second device are related in any embodiment.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present application, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), etc.
The above-mentioned specific embodiments further describe the objects, technical solutions and advantageous effects of the present application in detail. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (21)

1. An audio playing method, comprising:
the method comprises the steps that a first device obtains audio capability of a second device, wherein the audio capability comprises target audio parameters, audio coding and decoding capability and networking connection modes corresponding to each audio type in a plurality of audio types, the target audio parameters comprise at least one of sampling rate, channel number and sampling precision, the audio coding and decoding capability comprises audio coding and decoding support or audio coding and decoding support not, the networking connection modes comprise wired connection or wireless connection, the plurality of audio types comprise prompt tones, communication audio and media audio, the audio capability further comprises resampling capability, and the resampling capability comprises audio resampling support not or audio resampling support;
if the second device does not support audio resampling, the first device converts the first audio stream into a second audio stream according to the audio capability;
The first device sends the second audio stream to the second device, and the second audio stream is used for audio playing by the second device.
2. The method of claim 1, wherein the first device converting the first audio stream into the second audio stream according to the audio capability comprises:
the first device converts the first audio stream into a second audio stream corresponding to the target audio parameter.
3. The method of claim 1 or 2, wherein,
the first device converting the first audio stream into a second audio stream according to the audio capability includes:
the first device obtains an audio type of the first audio stream;
the first device converts the first audio stream into the second audio stream according to the audio type.
4. The method of claim 1 or 2, wherein the first device converting the first audio stream into the second audio stream according to the audio capability comprises:
when the second device supports audio encoding and decoding, the first device converts the first audio stream into the second audio stream in a compression encoding mode;
when the second device does not support audio codec, the first device converts the first audio stream into the second audio stream through pulse code modulation.
5. The method of claim 1 or 2, wherein the first device converting the first audio stream into the second audio stream according to the audio capability comprises:
when the networking connection mode is wireless connection, the first device converts the first audio stream into the second audio stream through a compression coding mode;
and when the networking connection mode is wire connection, the first equipment converts the first audio stream into the second audio stream through pulse code modulation.
6. The method of claim 1 or 2, wherein the first device converting the first audio stream into the second audio stream according to the audio capability comprises:
when the second device supports audio encoding and decoding and the networking connection mode is wireless connection, the first device converts the first audio stream into the second audio stream through a compression coding mode;
when the second device does not support audio encoding and decoding and the networking connection mode is wireless connection, the first device converts the first audio stream into the second audio stream through pulse code modulation.
7. The method of claim 1 or 2, wherein the method further comprises:
The first device sends a request message to the second device, the request message requesting the audio capabilities of the second device.
8. An audio playing method, comprising:
the second device sends audio capability to the first device, wherein the audio capability is used for converting a first audio stream into a second audio stream by the first device, the audio capability comprises target audio parameters corresponding to each audio type in a plurality of audio types, the target audio parameters comprise at least one of sampling rate, channel number and sampling precision, the audio codec capability comprises supporting audio codec or not supporting audio codec, the networking connection mode comprises wired connection or wireless connection, the plurality of audio types comprise prompt tones, call audio and media audio, the audio capability further comprises resampling capability, and the resampling capability comprises not supporting audio resampling or supporting audio resampling;
if the second device does not support audio resampling, the second device receives the second audio stream sent by the first device;
and the second device plays the second audio stream in an audio mode.
9. The method of claim 8, wherein the method further comprises:
the second device receives a request message sent by the first device, where the request message is used to request the audio capability of the second device.
10. An audio playback device, the device comprising:
the system comprises an acquisition module, a network connection module and a network connection module, wherein the acquisition module is used for acquiring audio capability of a second device, the audio capability comprises target audio parameters, audio coding and decoding capability and a networking connection mode, the target audio parameters correspond to each audio type in a plurality of audio types, the target audio parameters comprise at least one of sampling rate, channel number and sampling precision, the audio coding and decoding capability comprises audio coding and decoding support or audio coding and decoding support not, the networking connection mode comprises wired connection or wireless connection, the plurality of audio types comprise prompt tones, call audio and media audio, the audio capability also comprises resampling capability, and the resampling capability comprises audio resampling support not or audio resampling support;
a processing module for converting the first audio stream into a second audio stream according to the audio capability if the second device does not support audio resampling;
And the sending module is used for sending the second audio stream to the second equipment, and the second audio stream is used for audio playing of the second equipment.
11. The apparatus of claim 10, wherein the device comprises a plurality of sensors,
the processing module is further configured to convert the first audio stream into a second audio stream corresponding to the target audio parameter.
12. The apparatus of claim 10 or 11, wherein the audio capability comprises a target audio parameter corresponding to each of a plurality of audio types;
the processing module is further configured to obtain an audio type of the first audio stream; and converting the first audio stream into the second audio stream according to the audio type.
13. The apparatus of claim 10 or 11, wherein,
the processing module is further configured to convert the first audio stream into the second audio stream by a compression coding manner when the second device supports audio encoding and decoding; the first audio stream is converted to the second audio stream by pulse code modulation when the second device does not support audio codec.
14. The apparatus of claim 10 or 11, wherein,
The processing module is further configured to convert the first audio stream into the second audio stream by a compression encoding manner when the networking connection manner is wireless connection; and when the networking connection mode is wire connection, converting the first audio stream into the second audio stream through pulse code modulation.
15. The apparatus of claim 10 or 11, wherein,
the processing module is further configured to convert the first audio stream into the second audio stream by a compression coding manner when the second device supports audio encoding and decoding and the networking connection manner is wireless connection; and when the second equipment does not support audio encoding and decoding and the networking connection mode is wireless connection, converting the first audio stream into the second audio stream through pulse code modulation.
16. The apparatus of claim 10 or 11, wherein,
the sending module is further configured to send a request message to the second device, where the request message is used to request the audio capability of the second device.
17. An audio playback device, the device comprising:
a transmitting module, configured to transmit an audio capability to a first device, where the audio capability is used for the first device to convert a first audio stream into a second audio stream, where the audio capability includes a target audio parameter corresponding to each of a plurality of audio types, an audio codec capability, and a networking connection mode, where the target audio parameter includes at least one of a sampling rate, a channel number, and a sampling precision, where the audio codec capability includes supporting audio codec or not supporting audio codec, and where the networking connection mode includes wired connection or wireless connection, where the plurality of audio types includes alert tones, talk audio, and media audio, and where the audio capability further includes a resampling capability, where the resampling capability includes not supporting audio resampling or supporting audio resampling;
A receiving module, configured to receive the second audio stream sent by the first device if audio resampling is not supported;
and the processing module is used for playing the second audio stream.
18. The apparatus of claim 17, wherein the device comprises a plurality of sensors,
the receiving module is further configured to receive a request message sent by the first device, where the request message is used to request the audio capability of the second device.
19. A first device, comprising: a memory, a communication bus and a processor, wherein the memory is for storing program code, and the processor is for invoking the program code for performing the method of any of claims 1-7.
20. A second device, comprising: a memory, a communication bus and a processor, wherein the memory is for storing program code and the processor is for invoking the program code for performing the method of any of claims 8-9.
21. A computer readable storage medium having instructions stored therein which, when run on a computer, cause the computer to perform the method of any of claims 1-9.
CN201911404807.0A 2019-12-30 2019-12-30 Audio playing method and related equipment Active CN113126948B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202111555399.6A CN114398020A (en) 2019-12-30 2019-12-30 Audio playing method and related equipment
CN201911404807.0A CN113126948B (en) 2019-12-30 2019-12-30 Audio playing method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911404807.0A CN113126948B (en) 2019-12-30 2019-12-30 Audio playing method and related equipment

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN202111555399.6A Division CN114398020A (en) 2019-12-30 2019-12-30 Audio playing method and related equipment

Publications (2)

Publication Number Publication Date
CN113126948A CN113126948A (en) 2021-07-16
CN113126948B true CN113126948B (en) 2023-09-01

Family

ID=76768571

Family Applications (2)

Application Number Title Priority Date Filing Date
CN201911404807.0A Active CN113126948B (en) 2019-12-30 2019-12-30 Audio playing method and related equipment
CN202111555399.6A Pending CN114398020A (en) 2019-12-30 2019-12-30 Audio playing method and related equipment

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN202111555399.6A Pending CN114398020A (en) 2019-12-30 2019-12-30 Audio playing method and related equipment

Country Status (1)

Country Link
CN (2) CN113126948B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117692886A (en) * 2022-08-30 2024-03-12 Oppo广东移动通信有限公司 Device connection method, device, electronic device and storage medium
CN117992008A (en) * 2022-11-02 2024-05-07 华为技术有限公司 Audio playing method and electronic equipment
CN117135532B (en) * 2023-04-28 2024-06-14 荣耀终端有限公司 Audio data processing method, device and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110166820A (en) * 2019-05-10 2019-08-23 华为技术有限公司 Playback method, terminal and the device of audio-video
CN110543289A (en) * 2019-08-02 2019-12-06 华为技术有限公司 Method for controlling volume and electronic equipment

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8682139B2 (en) * 2011-05-02 2014-03-25 Netflix, Inc. L-cut stream startup
US10158690B2 (en) * 2012-09-28 2018-12-18 Samsung Electronics Co., Ltd Method and system for streaming multimedia content in a wireless fidelity display network environment
KR101657914B1 (en) * 2012-12-12 2016-09-19 후아웨이 디바이스 컴퍼니 리미티드 Method and terminal for sharing media stream
US9544718B2 (en) * 2014-09-11 2017-01-10 Lg Electronics Inc. Method and apparatus for transmitting and receiving audio stream in wireless communication system
CN108028946A (en) * 2015-09-15 2018-05-11 华为技术有限公司 Method of adjustment, system and the relevant device of media auto-adaptive parameter
CN105979347A (en) * 2015-12-03 2016-09-28 乐视致新电子科技(天津)有限公司 Video play method and device
CN108600503B (en) * 2018-03-07 2021-08-17 北京小米移动软件有限公司 Voice call control method and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110166820A (en) * 2019-05-10 2019-08-23 华为技术有限公司 Playback method, terminal and the device of audio-video
CN110543289A (en) * 2019-08-02 2019-12-06 华为技术有限公司 Method for controlling volume and electronic equipment

Also Published As

Publication number Publication date
CN113126948A (en) 2021-07-16
CN114398020A (en) 2022-04-26

Similar Documents

Publication Publication Date Title
CN111757477B (en) Method for reporting capability and user equipment
CN110347269B (en) Empty mouse mode realization method and related equipment
CN111132234B (en) Data transmission method and corresponding terminal
CN111095723B (en) Wireless charging method and electronic equipment
CN114422340B (en) Log reporting method, electronic equipment and storage medium
CN113126948B (en) Audio playing method and related equipment
CN113129202B (en) Data transmission method and device, data processing system and storage medium
CN113973398B (en) Wireless network connection method, electronic equipment and chip system
CN113490291B (en) Data downloading method and device and terminal equipment
CN116361255A (en) Data synchronization method, electronic device, and computer-readable storage medium
CN112335294B (en) Emergency call method and user terminal
CN114466107A (en) Sound effect control method and device, electronic equipment and computer readable storage medium
CN111343326A (en) Method and related device for acquiring test log
CN111865646A (en) Terminal upgrading method and related device
CN113596919B (en) Data downloading method and device and terminal equipment
CN114915747B (en) Video call method, electronic device and readable storage medium
CN114554012B (en) Incoming call answering method, electronic equipment and storage medium
CN114466238B (en) Frame demultiplexing method, electronic device and storage medium
CN116133165A (en) Headset connection system, method, headset, electronic device, and readable storage medium
CN113678481B (en) Wireless audio system, audio communication method and equipment
CN116708317B (en) Data packet MTU adjustment method and device and terminal equipment
CN115993592B (en) Bluetooth ranging method, electronic equipment and storage medium
CN116048769B (en) Memory recycling method and device and terminal equipment
CN114338891B (en) Communication method and device
CN115134402B (en) Equipment connection method and electronic equipment

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