CN109150400B - Data transmission method and device, electronic equipment and computer readable medium - Google Patents

Data transmission method and device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN109150400B
CN109150400B CN201810925255.7A CN201810925255A CN109150400B CN 109150400 B CN109150400 B CN 109150400B CN 201810925255 A CN201810925255 A CN 201810925255A CN 109150400 B CN109150400 B CN 109150400B
Authority
CN
China
Prior art keywords
coding
coding algorithm
user account
algorithms
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.)
Active
Application number
CN201810925255.7A
Other languages
Chinese (zh)
Other versions
CN109150400A (en
Inventor
龚金华
严锋贵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201810925255.7A priority Critical patent/CN109150400B/en
Publication of CN109150400A publication Critical patent/CN109150400A/en
Application granted granted Critical
Publication of CN109150400B publication Critical patent/CN109150400B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0001Systems modifying transmission characteristics according to link quality, e.g. power backoff
    • H04L1/0015Systems modifying transmission characteristics according to link quality, e.g. power backoff characterised by the adaptation strategy
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication

Abstract

The embodiment of the application provides a data transmission method, a data transmission device, electronic equipment and a computer readable medium, and relates to the technical field of communication. The method comprises the following steps: when the electronic equipment is connected with the wireless audio playing equipment, detecting whether the electronic equipment receives a playing request of audio data to be played; if a playing request is received, acquiring a user account of the current login electronic equipment as a target user account; determining a target coding algorithm according to a target user account; and sending the audio data to be played to the wireless audio playing equipment according to the target coding algorithm. Therefore, the encoding algorithm for sending the audio data to the wireless audio playing device can be selected more flexibly, and the user experience is improved.

Description

Data transmission method and device, electronic equipment and computer readable medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a data transmission method, an apparatus, an electronic device, and a computer-readable medium.
Background
With the development of science and technology, electronic devices have become one of the most common electronic products in people's daily life. Moreover, a user often receives audio information of the electronic device through an audio playing device connected to the electronic device, but audio data received by the audio playing device may be jammed, which causes a problem of poor user experience.
Disclosure of Invention
The application provides a data transmission method, a data transmission device, an electronic device and a computer readable medium, so as to overcome the defects.
In a first aspect, an embodiment of the present application provides a data transmission method, which is applied to an electronic device, and the method includes: when the electronic equipment is connected with wireless audio playing equipment, detecting whether the electronic equipment receives a playing request of audio data to be played; if a playing request is received, acquiring a user account currently logged in the electronic equipment as a target user account; determining a target coding algorithm according to the target user account; and sending the audio data to be played to the wireless audio playing equipment according to the target coding algorithm.
In a second aspect, an embodiment of the present application further provides a data transmission apparatus, which is applied to an electronic device, and the apparatus includes: the device comprises a detection unit, an acquisition unit, a determination unit and a sending unit. The detection unit is used for detecting whether the electronic equipment receives a playing request of audio data or not when the electronic equipment is connected with the wireless audio playing equipment. And the acquisition unit is used for acquiring the user account currently logged in the electronic equipment if the playing request is received. And the determining unit is used for determining a target coding algorithm according to the user account. And the sending unit is used for sending the audio data to be played to the wireless audio playing equipment according to the target coding algorithm.
In a third aspect, an embodiment of the present application further provides an electronic device, including one or more processors; a memory; one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the above-described methods.
In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, where a program code is stored in the computer-readable storage medium, and the program code can be called by a processor to execute the above method.
According to the data transmission method, the data transmission device, the electronic equipment and the computer readable medium, when the electronic equipment is connected with the wireless audio playing equipment and the electronic equipment is detected to receive the playing request of the audio data to be played, the encoding algorithm corresponding to the user account is determined according to the user account currently logged in the electronic equipment, and the audio data to be played is sent to the wireless audio playing equipment according to the encoding algorithm. Therefore, the encoding algorithm for sending the audio data to the wireless audio playing device can be selected more flexibly, and the user experience is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of a speech system provided by an embodiment of the present application;
fig. 2 is a flowchart illustrating a method of data transmission according to an embodiment of the present application;
fig. 3 is a flowchart illustrating a method of data transmission according to another embodiment of the present application;
FIG. 4 is a schematic diagram illustrating an encoding algorithm selection interface provided by an embodiment of the present application;
FIG. 5 is a schematic diagram illustrating an encoding algorithm selection interface provided by another embodiment of the present application;
FIG. 6 is a flow chart of a method of data transmission according to another embodiment of the present application;
FIG. 7 is a flow chart of a method of data transmission according to yet another embodiment of the present application;
fig. 8 shows a block diagram of a data transmission apparatus according to an embodiment of the present application;
FIG. 9 shows a block diagram of an electronic device provided by an embodiment of the present application;
fig. 10 illustrates a storage unit provided in an embodiment of the present application and configured to store or carry program codes for implementing a data transmission method according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
Referring to fig. 1, a block diagram of a speech system 1 according to an embodiment of the present application is shown. Specifically, the speech system 1 includes an electronic apparatus 100 and a wireless audio playback apparatus 200.
In the embodiment of the present invention, an application capable of playing audio is installed in the electronic device 100, and specifically, the application may be audio playing software, video playing software, or call software. The electronic device 100 sends the audio to be played to the wireless audio playing device 200, and the wireless audio playing device 200 plays the voice.
The wireless audio playing device 200 is a device for playing audio, which is independent from the electronic device 100 and is capable of receiving and playing audio data sent by the electronic device 100. For example: when a user uses the electronic device to play a song, the user may start a music playing application program on a display interface of the electronic device 100, or play a locally stored song by using a player of an operating system of the electronic device 100, the electronic device 100 processes the song during the process of playing the song to obtain digitized audio data and sends the processed audio data to the wireless audio playing device 200, and the wireless audio playing device 200 performs digital-to-analog conversion on the audio data after receiving the audio data to obtain an analog signal, and plays the analog signal by using a playing function of an external sound device, so as to realize song playing through the external sound device.
In the embodiment of the present invention, the electronic device 100 and the wireless audio playing device 200 interact with each other through a wireless network to transmit signals, wherein the wireless network may be a bluetooth, wifi, LTE network, or NFC.
In this embodiment of the present invention, the wireless audio playing device 200 is a bluetooth sound device or a bluetooth earphone, the wireless audio playing device 200 can realize connection with the electronic device 100 by starting a bluetooth function, and after the connection is established, the electronic device 100 sends the voice to be played to the bluetooth sound device, so that the bluetooth sound device realizes voice playing.
Specifically, after the bluetooth functions of the electronic device 100 and the wireless audio playing device 200 are started, the electronic device 100 searches for bluetooth devices within a preset distance of the electronic device 100 and displays names of the searched bluetooth devices on a display interface of the electronic device, after a user clicks or selects the wireless audio playing device 200 on the display interface, the electronic device 100 sends a connection request to the wireless audio playing device 200, and after receiving the connection request, the wireless audio playing device 200 establishes a connection with the electronic device 100 and feeds back a connection success message.
After the electronic device 100 establishes connection with the wireless audio playing device 200, if the electronic device 100 has audio such as a song or a video that needs to be played, the electronic device processes the audio data into a digital signal and sends the audio data to the wireless audio playing device 200, and after receiving the audio data, the wireless audio playing device 200 processes and plays the audio data, thereby playing the audio. Specifically, the electronic device 100 needs to encode the audio data and then transmit the encoded audio data to the wireless audio playback device 200, specifically, the electronic device 100 and the wireless audio playback device 200 are connected via bluetooth, and data and instructions between the electronic device 100 and the wireless audio playback device 200 are transmitted according to a certain bluetooth protocol, when the electronic device 100 transmits the audio data to the wireless audio playback device 200, the audio data needs to be encoded according to an encoding format under the supported bluetooth protocol, for example, for audio, an Apt-X, SBC, AAC, or LDAC encoding algorithm is often used.
The electronic device 100 encodes the Audio data to generate an Audio data packet, and then transmits the Audio data packet to the wireless Audio playback device 200 through a bluetooth transmission channel between the electronic device 100 and the wireless Audio playback device 200, and after the wireless Audio playback device 200 acquires the Audio data packet, the wireless Audio playback device 200 can acquire the Audio data packet by decoding the data packet, for example, SBC, which is an encoding format mandatory by an A2DP (Advanced Audio Distribution Profile, bluetooth Audio transmission protocol) protocol. All bluetooth can support the protocol, so all bluetooth audio chips can also support the protocol, taking MP3 format audio as an example, the encoding process is that the electronic device samples and discretizes an MP3 file after PCM encoding, converts the MP3 file into an SBC encoding format, then sends the SBC encoding format to the wireless audio playing device, the wireless audio playing device decodes the SBC format audio to obtain PCM format audio data, and drives components such as a voice coil of the wireless audio playing device to vibrate and sound according to the PCM encoding.
Further illustratively, if the user a makes a call to the user B by using the electronic device 100, and the call is connected, the electronic device 100 used by the user a receives the voice transmitted by the electronic device of the user B, and the electronic device 100 used by the user a transmits the received voice to the wireless audio playing device 200, and the voice is played by the wireless audio playing device 200, so that the user a can hear the voice of the user B. As an embodiment, a microphone is disposed on the wireless audio playing device 200, when the user a speaks, the wireless audio playing device 200 will collect the sound of the user a and generate voice, and send the generated voice to the electronic device 100 of the user a, and the voice is sent to the electronic device used by the user B by the electronic device 100, so that the conversation between the user a and the user B can be realized.
Further exemplarily, when the user a performs a video session with the user B by using the instant messaging software installed in the electronic device 100, the electronic device 100 of the user a receives video data sent by the electronic device of the user B, the electronic device 100 processes the video data to obtain video picture data and video sound data, wherein the electronic device 100 displays the video picture data on a display interface and sends the video sound data to the wireless audio playback device 200 connected to the electronic device 100, the wireless audio playback device 200 synchronously plays the video sound data, a camera on the electronic device 100 collects a captured video image, the wireless audio playback device 200 collects a sound during the speech of the user a to obtain voice data, and the wireless audio playback device 200 sends the collected voice data to the electronic device 100, the electronic device 100 processes the video image collected by the camera and the voice data collected by the wireless audio playing device 200 to obtain video data, and feeds the video data back to the electronic device used by the user B, so that the electronic device used by the user B can complete video playing, and video conversation between the user a and the user B is realized.
At present, the inconvenience caused by a wired earphone can be reduced by playing audio data in an electronic device by using a wireless audio playing device, but the inventor finds that a coding algorithm used is relatively fixed and lacks flexibility when the wireless audio playing device is used for playing audio.
Therefore, in order to solve the above drawback, referring to fig. 2, an embodiment of the present application provides a data transmission method applied to the electronic device, and specifically, the method includes: s201 to S204.
S201: when the electronic equipment is connected with wireless audio playing equipment, whether the electronic equipment receives a playing request of audio data to be played is detected.
When the bluetooth function of the electronic device is turned on, the electronic device scans the bluetooth devices within a certain distance range around, and specifically, after receiving a scanning command, a bluetooth chip or other underlying network modules of the electronic device scans according to a preset channel scanning sequence, such as scanning common channels 1, 7, and 13 first, and then scanning other channels that are not common, thereby obtaining the identifiers of all bluetooth devices within the current range, and displaying the identifiers in a bluetooth list interface of the electronic device.
If the Bluetooth device which is already connected and has better signal strength exists in the scanned Bluetooth device identification, the electronic device can automatically connect with the Bluetooth device, and the user can also select one Bluetooth device in the Bluetooth list interface for connection.
When the electronic device connects to an external bluetooth device, the system of the electronic device may go to a status value indicating that the electronic device is currently connected to the bluetooth device. Therefore, the electronic device can detect the Bluetooth device, and acquire the device identifier of the Bluetooth device.
After the device identifier of the connected bluetooth device is obtained, it is determined whether the connected bluetooth device is a wireless audio playing device according to the device identifier, specifically, the device identifier may include a name or a brand of the device, for example, it can be determined whether the device is a wireless audio playing device such as an earphone or a sound device according to the device identifier, so as to determine whether the wireless audio playing device is connected. In addition, the device identifier of the connected bluetooth device may be determined, and then the device type corresponding to the currently connected device identifier is obtained from the preset correspondence between the device identifier and the device type, so that whether the currently connected device type is the wireless audio playing device or not can be determined.
Whether the device connected with the electronic device through the Bluetooth is an audio playing device or not can be detected, wherein in the electronic device based on the android operating system, the type of the device connected with the electronic device through the Bluetooth currently can be determined through a return value obtained based on instantiation of a Bluetooth class. If the returned value is AUDIO _ VIDEO _ CAMCORDER, the image acquisition equipment is characterized; if the returned value is AUDIO _ VIDEO _ CAR _ AUDIO, the vehicle-mounted equipment is characterized; if the returned value is AUDIO _ VIDEO _ HIFI _ AUDIO, the AUDIO or VIDEO playing device is characterized as an AUDIO playing device or a VIDEO playing device, such as a bluetooth headset; if the returned value is AUDIO _ VIDEO _ MICROPHONE, it is characterized as a MICROPHONE.
When the electronic device is determined to be connected with the wireless audio playing device, that is, after the electronic device is connected with the wireless audio playing device, whether the electronic device receives a playing request is detected, wherein the playing request is a request for requesting to play audio data.
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.
S202: and acquiring the user account currently logged in the electronic equipment as a target user account.
The user account is an account where the user logs in the electronic device, and specifically may be an account where the user logs in an operating system of the electronic device. For example, Apple ID of IOS system. And the operation records of the user aiming at the electronic equipment are recorded by the electronic device, when the user logs in the electronic equipment by using the user account, the electronic equipment acquires the user account and the password input by the user, determines whether the user account and the password are matched, and if so, the user account successfully logs in the electronic equipment. Specifically, the electronic device obtains a user account and a password input by a user from a login program, wherein the login program is a program module in an operating system of the electronic device, and the user executes a related operation of user login.
As an embodiment, the electronic device is capable of sending and storing data corresponding to the user account to the server, and specifically, when the user logs in the electronic device, the user sends a login request to the server. The login request comprises a user account and a password, after the server acquires the user account and the password, whether the user account and the password in the login request are matched is compared according to a login password which is stored in advance and corresponds to the user account, if the user account and the password are matched, namely the user name is registered, and the password corresponding to the user name is correct, the electronic equipment is successfully logged in, and data related to the login operation of the user account is stored in a user record. The user record records login operation, data upload operation, data download operation and the like corresponding to the user account, for example, login times, login time, data upload operation, data acquisition operation and the like. Therefore, when the electronic equipment sends the login request, the user account of the current login electronic equipment can be acquired.
S203: and determining a target coding algorithm according to the target user account.
The encoding algorithm is used for audio data transmission between the electronic device and the wireless audio playing device, and specifically, audio data, for example, audio in MP3 format, may be encoded into an audio data packet according to the encoding algorithm and then sent to the wireless audio playing device, for example, the above-mentioned Apt-X, SBC, AAC, LDAC encoding algorithm.
As an implementation manner, the electronic device stores a corresponding relationship between a user account and an encoding algorithm, as shown in table 1:
TABLE 1
User account number Coding algorithm
ID1 SBC
ID2 AAC
ID3 SBC、AAC、LDAC
Then, according to the corresponding relationship shown in table 1, the target coding algorithm corresponding to the target user account can be determined, wherein if the coding algorithm corresponding to the target user account is a plurality of algorithms, one coding algorithm can be determined from the plurality of corresponding coding algorithms as the target coding algorithm. The correspondence shown in table 1 may be an encoding algorithm used by the user account, and is recorded by the electronic device or the server.
As an implementation manner, all encoding algorithms corresponding to a target user account are used as alternative encoding algorithms, whether the number of the encoding algorithms contained in the alternative encoding algorithms is greater than 1 or not is determined, if so, the use information of each encoding algorithm in the alternative encoding algorithms is acquired according to the pre-stored use record of each encoding algorithm, and the use information includes the number of use times, the length of use time or the use frequency. The encoding algorithm using the highest information will be used as the target encoding algorithm.
In addition, considering that some users are new users, the user account of the user may be found in the corresponding relationship shown in table 1, and if the user account is not found in table 1, the system default coding algorithm is used as the target coding algorithm corresponding to the user account. Wherein the system default encoding algorithm may be the most commonly used encoding algorithm.
Specifically, whether the user is a new user or not is determined, and whether the user account is the first time to log in the electronic device or not can be determined. As an embodiment, when the user logs in the electronic device, the user inputs the user account and the password, for example, in the above-mentioned process of logging in the electronic device, the data related to the login operation of the user account at this time is stored in the user record, where the login operation of the user account includes the login times, the login time, the data upload operation or the data acquisition operation, and the like. Whether the user name is logged in for the first time can be judged by searching the login operation recorded by the user.
Specifically, the process of determining whether to log in for the first time may be: acquiring a user account for logging in the electronic equipment; searching login times corresponding to the user accounts in a user record, wherein the user record stores a plurality of user accounts and login times corresponding to each user account; and if the login times are preset values, judging that the user name of the login electronic equipment logs in for the first time.
Specifically, by analyzing the login request, the user account of the login electronic device can be acquired. And then obtaining the login times corresponding to the user account from the user record. The user record may be that the login times of the user are recorded, or the login operations of the user are recorded, and a login tag is configured for each login operation, and the login times corresponding to the user account can be obtained by counting the login tags in the user record. Then, after the login times are obtained, the login times are compared with a preset value. Wherein the setting of the preset value depends on the time node performing the step of comparing the login times with the preset value. In one embodiment, before storing the login operation in the user record, the server executes an operation for judging whether the login operation is a non-initial login operation, if the preset value is 0, then if the login frequency is 0, it indicates that the user account does not log in the electronic device before the login, it is determined that the user account logged in the electronic device is first logged in, and similarly, if the login frequency is not 0, it is determined that the user account logged in the electronic device is not first logged in. In another embodiment, the server stores the login operation in the user record and then executes an operation for judging whether the login is not the first login. In this embodiment, if the preset value is 1, if the login number is 1, it indicates that the login is the first login, that is, it is determined that the user account of the logged-in electronic device logs in for the first time. And if the login times are not 1, the login is not the first login, and the user account of the login electronic equipment is judged not to be logged in for the first time.
S204: and sending the audio data to be played to the wireless audio playing equipment according to the target coding algorithm.
After the audio data to be played are coded according to the target coding algorithm, an audio data packet is generated, and the audio data packet is sent to the wireless audio playing equipment through a data link between the electronic equipment and the wireless audio playing equipment, so that the audio data can be sent to the wireless audio playing equipment.
In addition, considering that the user accounts are different along with the time of using the electronic equipment and the consumed recording condition, the levels of the user accounts are different, and for the users who often use the electronic equipment or often consume, if the used coding algorithm is higher or the effect is better, the interest of the users in using the electronic equipment can be improved, so that the user experience degree is improved.
Specifically, referring to fig. 3, an embodiment of the present application provides a data transmission method, including: s301 to S305.
S301: when the electronic equipment is connected with wireless audio playing equipment, whether the electronic equipment receives a playing request of audio data to be played is detected.
S302: and acquiring the user account currently logged in the electronic equipment as a target user account.
S303: and acquiring the grade of the target user account.
Specifically, the level of the user account is related to the login time, login times, the obtained points and even the consumption amount of the user, the level of each user account is stored in the electronic device, that is, the corresponding relationship between the user account and the level is stored, and after the target user account of the current login electronic device is obtained, the level of the target user account can be determined according to the corresponding relationship.
S304: and determining a target coding algorithm according to the grade of the target user account.
Specifically, since the levels of the user accounts are different, it may be indicated that the time or the demand of the electronic device used by the user is different, and different encoding algorithms may be set for the user accounts of different levels, so that users with higher levels may use more encoding algorithms, thereby improving the possibility that the user uses the electronic device more frequently.
As an implementation manner, the electronic device stores therein encoding algorithms corresponding to the levels of the user accounts, that is, the user accounts at different levels in the corresponding relationship each correspond to one encoding algorithm, and the encoding algorithms corresponding to the user accounts at different levels are different. As shown in table 2:
TABLE 2
User account number Grade Coding algorithm
ID1 J1 SBC
ID2 J2 SBC、AAC
ID3 J3 SBC、AAC、Apt-X
ID4 J4 SBC、AAC、Apt-X、LDAC
In table 2, the level of the level J1 is the smallest, and the level of the level J4 is the highest, that is, the higher the number after J is, the higher the level is, and the coding rates of the coding algorithms SBC, AAC, Apt-X, LDAC are respectively changed from small to large, that is, the coding rate of SBC is the lowest, and the coding rate of LDAC is the highest. That is, the higher the rank is, the higher the encoding rate of the encoding algorithm with the highest encoding rate is, for example, the rank J1 corresponding to ID1 corresponds to the encoding algorithm SBC, and the encoding algorithm corresponding to J3 includes: SBC, AAC and Apt-X, wherein the coding algorithm with the highest coding rate is Apt-X, and the coding algorithm Apt-X with the highest coding rate corresponding to J3 is higher than the coding algorithm SBC with the highest coding rate corresponding to J1.
Specifically, when the electronic device sends the audio data to the wireless audio playing device, in order to increase the data transmission speed, the audio data needs to be compressed, so as to reduce the size of the audio data, and then the process is to encode the audio data. Specifically, there are multiple encoding algorithms for sending the audio data to the wireless audio playing device, and the encoding rate corresponding to each encoding algorithm is different, that is, when different encoding algorithms encode the same audio data, the size of the obtained encoded audio data is also different.
The process from receiving the sound input by the user to sending the sound to the wireless audio playing device for playing by the electronic device comprises sampling, quantizing and encoding an analog signal of the sound. Sound is a time-continuous signal whose digitization, i.e., discretization, is accomplished by sampling and quantizing the sound to form audio data. For example, if the sound is a time-continuous sinusoid, it is collected by the electronic device, for example, by a microphone, after the sound is acquired. The electronic device samples the sound into a number of points, a process called sampling. Obviously, the greater the sampling density, i.e. the greater the sampling rate, the closer the resulting discrete signal is to the original continuous signal. Since each sample point occupies a storage space, the higher the sampling rate is, the larger the audio data obtained is.
Sampling is only the first step in audio processing. After sampling, the acquired data is also stored. Storage is space-demanding, as is the audio encoding rate, how much space is used for a second of sampled data to store. It can be seen that, on the premise of the same sampling rate, the lower the coding rate, the smaller the data. However, both the sampling and encoding steps degrade the sound quality. The encoding is actually compression, and like mp3, is lossy compression, discarding most of the acoustic data that the human ear perceives as not being, and thus is small in size.
The improvement of the audio coding rate may be to increase the sampling rate, or to reduce the discarding of useless information and to retain more useful information during the coding process, i.e. to reduce the compression ratio, for example, an encoding algorithm that stores 16-bit data of each sample in an audio stream at 4-bit, the compression ratio is 4: 1, 25% of the useful information is retained, and if the compression ratio is changed to 8 bits, the compression ratio is changed to 2:1, the compression ratio is reduced, and 50% of the useful information is retained, more useful information is retained, but the data amount of the audio data becomes larger.
In the above encoding process of sound to audio data, after the audio data is acquired, the audio data needs to be transmitted to the wireless audio playing device through bluetooth, and in order to ensure the speed of data transmission, the audio data needs to be encoded according to the bluetooth transmission protocol between the electronic device and the wireless audio playing device to form a format for user transmission, for example, the PCM is encoded into the SBC format, and in order to increase the transmission speed and increase the fault-tolerant rate of transmission, the audio data needs to be sampled and encoded, so as to reduce the size of the audio data and facilitate transmission. Similarly, for an increase in the encoding rate used for transmitting audio data, the sampling rate of audio data at the time of transmission may be increased or the compression rate at the time of encoding may be decreased. Therefore, the higher the encoding rate corresponding to the encoding algorithm, the less useful information is lost by the audio data, i.e., the higher the sound quality of the audio data, but the larger the data amount of the packet formed after the audio data is encoded.
Therefore, the encoding algorithm corresponding to the level of the target user account can be determined according to the correspondence between the encoding algorithm and the level of the user account, and considering that there are a plurality of encoding algorithms corresponding to the levels of the user account, it is necessary to determine one encoding algorithm from among the plurality of encoding algorithms as the target encoding algorithm, and specifically, a specific implementation manner of determining the target encoding algorithm according to the level of the user account may be: determining all coding algorithms corresponding to the grade of the target user account as alternative coding algorithms according to the corresponding relation between the grade of the preset user account and the coding algorithms; and determining the target coding algorithm from the alternative coding algorithms.
In the correspondence relationship between the user account level and the coding algorithm, the higher the user account level is, the more coding algorithms are corresponding to, and further, the higher the coding rate of the corresponding coding algorithm is. Specifically, according to the correspondence between the levels of the user accounts and the coding algorithms described in table 2, all coding algorithms corresponding to the target user account are determined to be used as the candidate coding algorithms, where if the user account is not in the correspondence described in table 2, for example, the user account is a new user, the default coding algorithm may be used as the candidate coding algorithm for the user account, and specifically, the foregoing embodiment may be referred to, and details are not repeated here.
After the alternative coding algorithms of the target user account are determined, determining a target coding algorithm from the alternative coding algorithms, specifically, determining one coding algorithm from the alternative coding algorithms as the target coding algorithm. Specifically, the number of encoding algorithms in the candidate encoding algorithms is determined, and if the number is input to be equal to 1, the candidate encoding algorithm is used as the target encoding algorithm, and if the number is greater than 1, the target encoding algorithm may be determined according to the usage information of each encoding algorithm in the candidate encoding algorithms, where the usage information includes the number of times of usage, the length of time of usage, or the frequency of usage, and for example, the encoding algorithm with the largest number of times of usage is used as the target encoding algorithm.
As another implementation, a coding algorithm selection interface may be displayed on an interface of the electronic device, and the target coding algorithm may be determined according to the coding algorithm selection interface. Specifically, the specific implementation of determining the target coding algorithm from the candidate coding algorithms is as follows: displaying a coding algorithm selection interface in a display interface of the electronic equipment, wherein the coding algorithm selection interface displays the identification of each coding algorithm in the alternative coding algorithms; acquiring an identifier of a coding algorithm selected by a user based on the coding algorithm selection interface; and taking the coding algorithm corresponding to the selected coding algorithm as a target coding algorithm.
Specifically, a user plays audio data to be played on an audio playing interface of an audio playing application program in the electronic device, for example, a song playing interface of certain song playing software, as shown in fig. 4, the user selects a song to be played, that is, the audio data to be played, on the audio playing interface, and then clicks a playing button, and the coding algorithm selection interface is displayed. And selecting one coding algorithm based on the coding algorithm selection interface by the user, clicking the determination key, and then acquiring the coding algorithm selected by the user based on the coding algorithm selection interface by the electronic equipment and taking the selected coding algorithm as a target coding algorithm. The coding algorithm selection interface is a popup window, when the electronic device displays the coding algorithm selection interface, touch operation acquired by an area outside the coding algorithm selection interface is shielded, namely the electronic device does not respond to touch operation input by a user aiming at the area outside the coding algorithm selection interface, and the coding algorithm selection interface is closed only after the user selects a coding algorithm or clicks a cancel button.
In some embodiments, considering that the electronic device may affect the operation of the user when displaying the coding algorithm selection interface, after the electronic device acquires the coding algorithm selected by the user based on the coding algorithm selection interface, the coding algorithm selection interface is no longer displayed within a preset time period, but the coding algorithm selected by the user on the coding algorithm selection interface is continuously used as the target coding algorithm, that is, after the electronic device acquires the coding algorithm selected by the user based on the coding algorithm selection interface, the target coding algorithm corresponding to the target user account is kept unchanged within the preset time period, unless the electronic device changes the user account or the preset time period is over, the target coding algorithm is re-determined. The preset time period is a certain time length after the time point of the electronic equipment for acquiring the coding algorithm selected by the user based on the coding algorithm selection interface is taken as a time starting point.
By adopting the mode of selecting the interface by the coding algorithm, the coding algorithm selected by the user is obtained as the target coding algorithm, although the possibility of operating the coding algorithm selection interface by the user can be improved, if the coding algorithm needs to be changed in the process of playing the song, the song needs to be stopped to be played, then the playing button needs to be clicked again, and even the audio playing software needs to be restarted after quitting. Therefore, as another embodiment, as shown in fig. 5, a menu bar, which may be a pull-up menu bar or a pull-down menu bar, is provided in the current display interface of the electronic device, and clicking the menu bar displays the alternative coding algorithms, as shown in fig. 5(a), selecting one of the alternative coding algorithms switches from the interface of fig. 5(a) to the interface of fig. 5(b), and then, clicking the play button by the user, the audio data can be transmitted to the wireless audio playing device according to the selected coding algorithm. In addition, in the audio data playing process, the user clicks the menu bar and changes the coding algorithm, the song can be played again, the audio data is sent to the wireless audio playing device by adopting the latest selected coding algorithm, meanwhile, the electronic device records the target coding algorithm corresponding to the user account, and all songs played by the user in the audio playing software adopt the target coding algorithm.
S305: and sending the audio data to be played to the wireless audio playing equipment according to the target coding algorithm.
It should be noted that, for the parts not described in detail in the above steps, reference may be made to the foregoing embodiments, and details are not described herein again.
In addition, it is considered that if the bandwidth of the data link between the current electronic device and the wireless audio playing device is narrow and the encoding rate corresponding to the encoding algorithm selected by the user is high, the audio data is transmitted by using an excessively low bandwidth, so that the continuity of the audio data transmission is reduced, and the phenomenon of jamming occurs during playing. Therefore, in order to solve the defect, an embodiment of the present application provides a data transmission method, as shown in fig. 6, the method including: s601 to S609.
S601: when the electronic equipment is connected with wireless audio playing equipment, whether the electronic equipment receives a playing request of audio data to be played is detected.
S602: and acquiring the user account currently logged in the electronic equipment as a target user account.
S603: and acquiring the grade of the target user account.
S604: and determining all coding algorithms corresponding to the grade of the target user account according to the corresponding relation between the grade of the preset user account and the coding algorithms.
S605: determining a bandwidth of a communication link between the electronic device and the wireless audio playing device.
When the electronic device is connected with the wireless audio playing device, the electronic device selects bluetooth, WiFi or other connection modes to send a connection request to the wireless audio playing device, and then the wireless audio playing device can be searched in a frequency band of a communication mode supported by the wireless audio playing device, for example, when the electronic device turns on bluetooth, the wireless audio playing device which also turns on bluetooth can be searched in a communication frequency band corresponding to the bluetooth, for example, 2.4 GHz.
Specifically, after the electronic device and the wireless audio playing device are connected, the electronic device can determine a communication mode used by the electronic device and the wireless audio playing device, for example, bluetooth, and data communication between the electronic device and the wireless audio playing device requires an antenna of the electronic device to transmit data to the wireless audio playing device or receive data transmitted by the wireless audio playing device, and frequency bands used by different communication modes are different, for example, 2.4GHz is used by bluetooth, and 2.4GHz or 5GHz can be used by WiFi. Then, after a communication method is selected, a communication frequency band corresponding to the communication method can be determined, for example, bluetooth corresponds to 2.4GHz, the frequency bands corresponding to the routers or hotspots connected with the electronic equipment through the WiFi are different, the corresponding communication frequency bands are also different, for example, after the electronic device turns on WiFi, surrounding WiFi hotspots are scanned to obtain a WiFi list, the identifiers of a plurality of hotspots are displayed in the list, wherein, the communication frequency band corresponding to some hot spots is 2.4GHz, the communication frequency band corresponding to some hot spots is 5GHz, as shown in FIG. 4, the communication band corresponding to WiFi-1 is 2.4GHz, the communication band corresponding to WiFi-1-5GHz is 5GHz, the user selects WiFi-1, the electronic equipment is connected with the WiFi-1 through a communication frequency band of 2.4GHz, and if the user selects WiFi-1-5GHz, the electronic equipment is connected with the WiFi-1 through a communication frequency band of 5 GHz. Thus, the electronic device can determine the communication frequency band between the electronic device and the connected WiFi hotspot.
After determining the category of the communication link between the electronic device and the wireless audio playing device, reading the communication parameters of the communication link can determine the bandwidth corresponding to the communication link, wherein the communication parameters include parameters such as bandwidth, retransmission rate and transmission rate. Thus, the value of the bandwidth of the current communication link can be determined.
S606: and acquiring the coding algorithm supported by the bandwidth.
As an implementation manner, a corresponding relationship between bandwidths and encoding algorithms is stored in the electronic device, where the corresponding relationship includes a plurality of bandwidths and an encoding algorithm corresponding to each bandwidth, and as an implementation manner, an encoding algorithm supported by a bandwidth of a communication link between the electronic device and the wireless audio playing device is determined according to the corresponding relationship between the bandwidths and the encoding algorithms, where in the corresponding relationship between the bandwidths and the encoding algorithms, a size of the bandwidth is positively correlated to a level of an encoding rate of the encoding algorithm. As shown in table 3:
TABLE 3
Figure BDA0001765193130000121
Figure BDA0001765193130000131
As in table 3 above, SBC, ACC, APTX, and LDAC are several different encoding algorithms, i.e., formats when audio data is transmitted through bluetooth, and as in table 3 above, the encoding rate gradually increases from top to bottom, i.e., the encoding rate: SBC < ACC < APTX < LDAC, and the corresponding bandwidth is also gradually increased.
Then, according to the corresponding relationship shown in table 3, the encoding algorithm supported by the bandwidth corresponding to the communication link between the current electronic device and the wireless audio playing device can be determined.
S607: and taking the coding algorithm matched with the coding algorithm supported by the bandwidth as an alternative coding algorithm in all the coding algorithms corresponding to the grade of the target user account.
In S604, determining all encoding algorithms corresponding to the level of the target user account, and finding a common encoding algorithm between all encoding algorithms corresponding to the level of the target user account and the encoding algorithm supported by the bandwidth corresponding to the communication link between the current electronic device and the wireless audio playing device as an alternative encoding algorithm. For example, all encoding algorithms corresponding to the level of the target user account are SBC, AAC, Apt-X, and encoding algorithms supported by the bandwidth corresponding to the communication link between the current electronic device and the wireless audio playing device are SBC and AAC, if the two find that the same encoding algorithms are SBC and AAC, then the alternative encoding algorithms are SBC and AAC.
In addition, if the common coding algorithm is not found among all coding algorithms corresponding to the levels of the target user accounts and the coding algorithms supported by the bandwidth corresponding to the communication link between the current electronic equipment and the wireless audio playing equipment, the coding algorithm with the lowest bandwidth requirement in the default coding algorithm is used as the alternative coding algorithm, or the common coding algorithm is found among the default coding algorithm and the coding algorithms supported by the bandwidth corresponding to the communication link between the current electronic equipment and the wireless audio playing equipment and is used as the alternative coding algorithm.
S608: and determining the target coding algorithm from the alternative coding algorithms.
S609: and sending the audio data to be played to the wireless audio playing equipment according to the target coding algorithm.
It should be noted that, for the parts not described in detail in the above steps, reference may be made to the foregoing embodiments, and details are not described herein again.
In addition, in view of the fact that if audio data to be played sent by an electronic device is audio with a relatively high real-time requirement, for example, audio in a video, or audio in a call process, in order to consider that the audio data is sent to a wireless audio playing device for playing in time, the complexity of an encoding algorithm, that is, the encoding rate cannot be set too high, specifically, referring to fig. 7, a data transmission method provided by an embodiment of the present application is shown, including: s701 to S709.
S701: when the electronic equipment is connected with wireless audio playing equipment, whether the electronic equipment receives a playing request of audio data to be played is detected.
S702: and acquiring the user account currently logged in the electronic equipment as a target user account.
S703: and acquiring the grade of the target user account.
S704: and determining all coding algorithms corresponding to the grade of the target user account according to the corresponding relation between the grade of the preset user account and the coding algorithms.
S705: and determining the real-time performance level of the audio data to be played.
Audio data exists at a real-time level, and some data have high real-time requirements, such as audio data in a voice chat or a video chat, or voice during a call, or audio played synchronously with video. Some data, for example, songs that are played, i.e., pure songs rather than videos, have low real-time requirements.
As an implementation manner, an identifier of an application program corresponding to the audio data to be played is determined, and then the real-time level of the audio data to be played is determined according to the identifier of the application program. Specifically, an identifier of a target application program that sends the play request of the audio data to be played is determined, and then a type of the application program corresponding to the identifier of the target application program is determined.
After acquiring the identifier of the target application program, determining the type of the target application program according to the identifier, wherein the identifier of the target application program may be a package name, a name and the like of the application program. For example, the electronic device stores in advance the correspondence between the identifier of the application program and the category of the application program, as shown in table 4 below:
TABLE 4
Identification of applications Categories of applications
Apk1 Game machine
Apk2 Video
Apk3 Audio frequency
Thus, the application type corresponding to the target application can be specified based on the correspondence between the application identifier and the application type shown in table 4. For example, in the embodiment of the present application, a game screen of game software of an electronic device is played through a wireless audio playing device, where the game screen includes an image and music, and the music may be game music, game sound effects, and the like, and for example, the game sound effects may be a gunshot sound or a footstep sound. As an embodiment, the audio data to be played may be a game sound, the application program corresponding to the game sound is a certain game APP, the category of the application program is a game type, and then the type of the audio data is determined according to the type of the application program.
Then, the real-time level corresponding to the audio data is determined according to the type of the application program. Specifically, the real-time performance level corresponding to the type of the application program is stored in the electronic device, as shown in table 5 below:
TABLE 5
Identification of applications Categories of applications Level of real-time
Apk1 Game machine J1
Apk2 Video J2
Apk3 Audio frequency J3
Apk4 Social interaction J1
Thereby enabling the determination of the corresponding level of real-time of the audio data. In addition, if it is determined that the category of the application program corresponding to the audio data is audio, the application program capable of playing audio may also play video, and it is necessary to determine whether the audio data is audio in the video.
Specifically, in some embodiments, it is determined whether a video is currently being played, specifically, when the electronic device plays the video, audio data in the video is extracted and sent to an audio processing module in the system to invoke an audio processing circuit in the electronic device, that is, the audio data is sent to the audio processing circuit to perform operations such as encoding of the audio, so that after a play request of the audio data is received, it is determined whether the video is currently being played, and if so, it indicates that the audio to be currently played belongs to the audio data in the video currently being played, that is, the audio data belongs to the audio in the video.
In other embodiments, the process of playing the video by the electronic device includes, after data de-agreement and de-encapsulation, dividing into audio decoding and video decoding, sending the decoded audio data to the audio playing device for playing, and sending the video data to the video playing device for playing. Therefore, in order to facilitate the synchronous playing of the video and the audio, similar identifiers are set for the audio and the video frames in the video, for example, the audio and the video frames both use an identifier format of a + B, where a is a preamble and is used to indicate that the audio and the video frames belong to a certain video, and when the audio data to be played is acquired, whether the audio corresponds to a video frame, that is, whether the audio belongs to the audio in the video can be determined according to the format of the identifier of the audio data.
And if the type of the application program corresponding to the audio data is determined to be the audio type, determining whether the audio data is the audio in the video, and if so, determining to change the real-time performance level of the audio data to be the real-time performance level corresponding to the video type application program but not the real-time performance level corresponding to the audio type application program.
S706: and acquiring the coding algorithm supported by the real-time performance level.
As an implementation manner, a corresponding relationship between a real-time level and an encoding algorithm is stored in the electronic device, where the corresponding relationship includes a plurality of real-time levels and an encoding algorithm corresponding to each real-time level, and as an implementation manner, the encoding algorithm supported by the real-time level is determined according to the corresponding relationship between the real-time level and the encoding algorithm, where in the corresponding relationship between the real-time level and the encoding algorithm, the size of the real-time level is negatively correlated with the encoding rate of the encoding algorithm, that is, the higher the real-time level is, the lower the encoding rate of the corresponding encoding algorithm is, the lower the audio data is, and the more convenient the data is to be transmitted to the wireless audio playing device.
S707: and taking the coding algorithm matched with the coding algorithm supported by the real-time level of the audio data to be played in all the coding algorithms corresponding to the level of the user account as an alternative coding algorithm.
In S704, all encoding algorithms corresponding to the level of the target user account are determined, and then a common encoding algorithm is found between all encoding algorithms corresponding to the level of the target user account and the encoding algorithm supported by the real-time level of the audio data to be played as an alternative encoding algorithm. For example, all encoding algorithms corresponding to the level of the target user account are SBC, AAC, Apt-X, LDAC, while the encoding algorithms supported by the real-time level of the audio data to be played are SBC and AAC, if the same encoding algorithms are found to be SBC and AAC, the alternative encoding algorithms are SBC and AAC.
Similarly, if the common coding algorithm is not found between all coding algorithms corresponding to the level of the target user account and the coding algorithm supported by the real-time level of the audio data to be played, the common coding algorithm is found between the default coding algorithm and the coding algorithm supported by the real-time level of the audio data to be played as the alternative coding algorithm.
S708: and determining the target coding algorithm from the alternative coding algorithms.
S709: and sending the audio data to be played to the wireless audio playing equipment according to the target coding algorithm.
It should be noted that, for the parts not described in detail in the above steps, reference may be made to the foregoing embodiments, and details are not described herein again.
Referring to fig. 8, a data transmission apparatus 800 according to an embodiment of the present application is shown, where the apparatus is applied to the electronic device, and specifically, the apparatus includes: a detection unit 801, an acquisition unit 802, a determination unit 803, and a transmission unit 804.
The detecting unit 801 is configured to detect whether the electronic device receives a playing request of audio data when the electronic device is connected to a wireless audio playing device.
The obtaining unit 802 is configured to determine, if a play request is received, an encoding rate corresponding to the audio data.
A determining unit 803, configured to increase a bandwidth of a target data link between the electronic device and the wireless audio playing device according to the encoding rate.
A sending unit 804, configured to send the audio data to the wireless audio playing device according to the target data link with the increased bandwidth.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
Referring to fig. 9, 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, a bluetooth module 140, and one or more applications, wherein the one or more applications may be stored in the memory 120 and configured to be executed by the one or more processors 110, the one or more programs configured to perform the methods as described in the foregoing 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 processor 110 can control the device to which the bluetooth module 140 is connected, thereby enabling a bluetooth connection between the electronic device and an external device.
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 storage data area may also store data created by the terminal 100 in use, such as a phonebook, audio-video data, chat log data, and the like. The memory 120 is further connected to the bluetooth module 140, and is configured to store data received by the bluetooth module, data to be sent, and bluetooth communication parameters.
The bluetooth module 140 is used for implementing bluetooth connection between the electronic device and the bluetooth device, and data interaction between the electronic device and the bluetooth device. Specifically, the bluetooth protocol may be used with the bluetooth device by 5.0/4.2/4.1/2.1/2.0, or may also be used by Bluetooth Low Energy (BLE), bluetooth Enhanced Data Rate (EDR), or bluetooth Basic Rate (BR). The bluetooth module 140 may include a power amplifier, a wireless transceiver, a transceiver switch, a low noise amplifier, an antenna, and the like. When sending signals, the transceiver itself will directly output a low-Power weak rf signal, which is sent to a Power Amplifier (PA) for Power amplification, and then radiated to the space through an Antenna (Antenna) by a Transmit/Receive Switch (Transmit/Receive Switch). When receiving signals, the antenna can sense electromagnetic signals in the space, and the electromagnetic signals are sent to a Low Noise Amplifier (LNA) for amplification after passing through the switcher, so that the amplified signals can be directly sent to a transceiver for processing and demodulation, and the bluetooth module 140 can use a 2.4GHz frequency band.
Referring to fig. 10, a block diagram of a computer-readable storage medium according to an embodiment of the present application is shown. The computer-readable medium 1000 has stored therein program code that can be called by a processor to execute the method described in the above-described method embodiments.
The computer-readable storage medium 1000 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Alternatively, the computer-readable storage medium 1000 includes a non-volatile computer-readable storage medium. The computer readable storage medium 1000 has storage space for program code 1010 for performing any of the method steps of the method described above. The program code can be read from or written to one or more computer program products. The program code 1010 may be compressed, for example, in a suitable form.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not necessarily depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (8)

1. A data transmission method, applied to an electronic device, the method comprising:
when the electronic equipment is connected with wireless audio playing equipment, if the fact that audio of an audio playing interface is selected and a playing button is triggered is detected, acquiring a user account currently logged in the electronic equipment and taking the user account as a target user account;
acquiring all coding algorithms corresponding to the target user account as alternative coding algorithms;
displaying a coding algorithm selection interface in the audio playing interface, wherein the coding algorithm selection interface displays the identification of each coding algorithm in the alternative coding algorithms;
acquiring an identifier of a coding algorithm selected by a user based on the coding algorithm selection interface;
taking the coding algorithm corresponding to the identifier of the selected coding algorithm as a target coding algorithm;
sending audio data to be played to the wireless audio playing device according to the target coding algorithm, wherein the audio data to be played is the selected audio;
and the coding algorithm selection interface is not displayed within a preset time period, and the coding algorithm selected by the user at this time is continuously used as the target coding algorithm within the preset time period.
2. The method according to claim 1, wherein the acquiring all encoding algorithms corresponding to the target user account as alternative encoding algorithms comprises:
acquiring the grade of the target user account;
and determining all coding algorithms corresponding to the grade of the target user account as alternative coding algorithms according to the corresponding relation between the grade of the preset user account and the coding algorithms, wherein in the corresponding relation between the grade of the user account and the coding algorithms, the higher the grade of the user account is, the more the corresponding coding algorithms are.
3. The method according to claim 2, wherein the determining all encoding algorithms corresponding to the level of the target user account according to the corresponding relationship between the level of the preset user account and the encoding algorithms, as alternative encoding algorithms, comprises:
determining all coding algorithms corresponding to the grade of the target user account according to the corresponding relation between the grade of the preset user account and the coding algorithms;
determining a bandwidth of a communication link between the electronic device and the wireless audio playing device;
acquiring a coding algorithm supported by the bandwidth;
and taking the coding algorithm matched with the coding algorithm supported by the bandwidth as an alternative coding algorithm in all the coding algorithms corresponding to the grade of the target user account.
4. The method of claim 3, wherein the determining the coding algorithm supported by the bandwidth comprises:
determining a coding algorithm supported by the bandwidth of a communication link between the electronic device and the wireless audio playing device according to the corresponding relationship between the bandwidth and the coding algorithm, wherein in the corresponding relationship between the bandwidth and the coding algorithm, the size of the bandwidth is positively correlated with the coding rate of the coding algorithm.
5. The method according to claim 2, wherein the determining all encoding algorithms corresponding to the level of the target user account according to the corresponding relationship between the level of the preset user account and the encoding algorithms, as alternative encoding algorithms, comprises:
determining all coding algorithms corresponding to the grade of the target user account according to the corresponding relation between the grade of the preset user account and the coding algorithms;
determining the real-time level of the audio data to be played;
acquiring a coding algorithm supported by the real-time level;
and taking the coding algorithm matched with the coding algorithm supported by the real-time level of the audio data to be played in all the coding algorithms corresponding to the level of the user account as an alternative coding algorithm.
6. A data transmission apparatus, applied to an electronic device, the apparatus comprising:
the acquisition unit is used for acquiring a user account currently logged in the electronic equipment as a target user account if the audio of an audio playing interface is detected to be selected and a playing button is triggered when the electronic equipment is connected with wireless audio playing equipment;
the determining unit is used for acquiring all coding algorithms corresponding to the target user account to serve as alternative coding algorithms, displaying a coding algorithm selection interface in the audio playing interface, displaying the identifier of each coding algorithm in the alternative coding algorithms in the coding algorithm selection interface, acquiring the identifier of the coding algorithm selected by the user based on the coding algorithm selection interface, and taking the coding algorithm corresponding to the identifier of the selected coding algorithm as the target coding algorithm;
and the sending unit is used for sending the audio data to be played to the wireless audio playing equipment according to the target coding algorithm, not displaying the coding algorithm selection interface within a preset time period, and continuously taking the coding algorithm selected by the user this time as the target coding algorithm within the preset time period, wherein the audio data to be played is the selected audio.
7. An electronic device, comprising:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the method of any of claims 1-5.
8. A computer-readable storage medium having program code stored therein, the program code being invoked by a processor to perform the method of any of claims 1-5.
CN201810925255.7A 2018-08-14 2018-08-14 Data transmission method and device, electronic equipment and computer readable medium Active CN109150400B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810925255.7A CN109150400B (en) 2018-08-14 2018-08-14 Data transmission method and device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810925255.7A CN109150400B (en) 2018-08-14 2018-08-14 Data transmission method and device, electronic equipment and computer readable medium

Publications (2)

Publication Number Publication Date
CN109150400A CN109150400A (en) 2019-01-04
CN109150400B true CN109150400B (en) 2021-08-17

Family

ID=64793109

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810925255.7A Active CN109150400B (en) 2018-08-14 2018-08-14 Data transmission method and device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN109150400B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112995963A (en) * 2019-12-17 2021-06-18 中兴通讯股份有限公司 Bluetooth audio transmission method, device, terminal and readable storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1688178A (en) * 2005-06-07 2005-10-26 北京北方烽火科技有限公司 Up compression mode selecting method for broadband CDMA mobile communication system
CN101184203A (en) * 2007-12-21 2008-05-21 北京海尔集成电路设计有限公司 Television related apparatus and method for compelled play multimedia content
CN103618911A (en) * 2013-10-12 2014-03-05 北京视博云科技有限公司 Video streaming providing method and device based on video attribute information
CN103685179A (en) * 2012-09-12 2014-03-26 中国移动通信集团公司 Method, device and system for compressing content
CN103885987A (en) * 2012-12-21 2014-06-25 中国移动通信集团公司 Music recommendation method and system
CN105188157A (en) * 2015-09-28 2015-12-23 Tcl通力电子(惠州)有限公司 Audio playing method and audio terminal
CN205754704U (en) * 2016-04-27 2016-11-30 上海象融蓝海文化传媒有限公司 A kind of Internet video Play System based on user gradation

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100469263B1 (en) * 2002-06-03 2005-02-02 엘지전자 주식회사 Method and apparatus for managing data of PVR sytem

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1688178A (en) * 2005-06-07 2005-10-26 北京北方烽火科技有限公司 Up compression mode selecting method for broadband CDMA mobile communication system
CN101184203A (en) * 2007-12-21 2008-05-21 北京海尔集成电路设计有限公司 Television related apparatus and method for compelled play multimedia content
CN103685179A (en) * 2012-09-12 2014-03-26 中国移动通信集团公司 Method, device and system for compressing content
CN103885987A (en) * 2012-12-21 2014-06-25 中国移动通信集团公司 Music recommendation method and system
CN103618911A (en) * 2013-10-12 2014-03-05 北京视博云科技有限公司 Video streaming providing method and device based on video attribute information
CN105188157A (en) * 2015-09-28 2015-12-23 Tcl通力电子(惠州)有限公司 Audio playing method and audio terminal
CN205754704U (en) * 2016-04-27 2016-11-30 上海象融蓝海文化传媒有限公司 A kind of Internet video Play System based on user gradation

Also Published As

Publication number Publication date
CN109150400A (en) 2019-01-04

Similar Documents

Publication Publication Date Title
CN109150399B (en) Data transmission method and device, electronic equipment and computer readable medium
CN105872253B (en) Live broadcast sound processing method and mobile terminal
CN109246672B (en) Data transmission method, device and system and Bluetooth headset
CN109273017B (en) Encoding control method and device and electronic equipment
CN111199743B (en) Audio coding format determining method and device, storage medium and electronic equipment
CN109041024B (en) Code rate optimization method and device, electronic equipment and storage medium
CN109151194B (en) Data transmission method, device, electronic equipment and storage medium
CN109151789B (en) Translation method, device and system and Bluetooth headset
CN109445739A (en) Audio frequency playing method, device, electronic equipment and computer-readable medium
CN109379491A (en) Audio frequency playing method, device, electronic equipment and computer-readable medium
CN109379490B (en) Audio playing method and device, electronic equipment and computer readable medium
CN109151566B (en) Audio playing method and device, electronic equipment and computer readable medium
CN109450851B (en) Device connection method, electronic device, and computer-readable medium
EP3846020A1 (en) Sound effect adjusting method and apparatus, electronic device, and storage medium
CN109151861A (en) Encoding rate method of adjustment, device and electronic equipment
WO2019071808A1 (en) Video image display method, apparatus and system, terminal device, and storage medium
US20230069653A1 (en) Audio Transmission Method and Electronic Device
CN107682553B (en) Call signal sending method and device, mobile terminal and storage medium
CN109102816B (en) Encoding control method and device and electronic equipment
CN109150400B (en) Data transmission method and device, electronic equipment and computer readable medium
WO2023077284A1 (en) Signal encoding and decoding method and apparatus, and user equipment, network side device and storage medium
US9147403B2 (en) Responding to a call to action contained in an audio signal
CN110351419B (en) Intelligent voice system and voice processing method thereof
CN113284500A (en) Audio processing method and device, electronic equipment and storage medium
CN109298846B (en) Audio transmission method and device, electronic equipment and storage medium

Legal Events

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