CN112738732B - Audio playing method and device - Google Patents

Audio playing method and device Download PDF

Info

Publication number
CN112738732B
CN112738732B CN201911028201.1A CN201911028201A CN112738732B CN 112738732 B CN112738732 B CN 112738732B CN 201911028201 A CN201911028201 A CN 201911028201A CN 112738732 B CN112738732 B CN 112738732B
Authority
CN
China
Prior art keywords
sampling rate
codec
equipment
frequency division
processing state
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
CN201911028201.1A
Other languages
Chinese (zh)
Other versions
CN112738732A (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.)
Chengdu TD Tech Ltd
Original Assignee
Chengdu TD Tech 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 Chengdu TD Tech Ltd filed Critical Chengdu TD Tech Ltd
Priority to CN201911028201.1A priority Critical patent/CN112738732B/en
Publication of CN112738732A publication Critical patent/CN112738732A/en
Application granted granted Critical
Publication of CN112738732B publication Critical patent/CN112738732B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/06Selective distribution of broadcast services, e.g. multimedia broadcast multicast service [MBMS]; Services to user groups; One-way selective calling services
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS OR SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING; SPEECH OR AUDIO CODING OR DECODING
    • G10L19/00Speech or audio signals analysis-synthesis techniques for redundancy reduction, e.g. in vocoders; Coding or decoding of speech or audio signals, using source filter models or psychoacoustic analysis
    • G10L19/04Speech or audio signals analysis-synthesis techniques for redundancy reduction, e.g. in vocoders; Coding or decoding of speech or audio signals, using source filter models or psychoacoustic analysis using predictive techniques
    • G10L19/16Vocoder architecture
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R1/00Details of transducers, loudspeakers or microphones
    • H04R1/10Earpieces; Attachments therefor ; Earphones; Monophonic headphones
    • 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 application discloses an audio playing method and device, wherein the method comprises the following steps: when first equipment needs to be used as a Bluetooth headset accessory of terminal equipment to play voice of a group call service, the first equipment triggers a built-in coder-decoder (CODEC) to enter a frequency division processing state; the first equipment has a local sound recording or video recording function; when the codec is in a frequency division processing state, the codec correspondingly processes the voice which needs to be played by the first equipment at present according to a first sampling rate; the first sampling rate is a sampling rate matched with the Bluetooth headset. By applying the technical scheme disclosed by the application, the problem that the audio playing equipment supporting local sound recording and video recording cannot normally play the group call service sound as a Bluetooth headset can be effectively solved.

Description

Audio playing method and device
Technical Field
The present application relates to the field of computer application technologies, and in particular, to an audio playing method and apparatus.
Background
At present, in order to increase the convenience of use of a user, a Bluetooth function is introduced into the law enforcement recorder, so that the law enforcement recorder can serve as a Bluetooth accessory to become a Bluetooth headset, and thus, the terminal can play the sound of the group calling service by using the recorder as the Bluetooth headset.
The inventor discovers that in the process of implementing the invention: after the bluetooth function is introduced into the existing recorder, the problem that the group call service sound cannot be normally played exists, and the specific reasons are analyzed as follows:
when the existing recorder records and plays local audio, the sampling rate of 48K is adopted, so that the locally recorded voice is clear and rich. However, the sampling rate of the bluetooth headset is 8K, which is less than the 48K sampling rate used by a CODEC (CODEC) of the recorder, which may cause a problem that the recorder as the bluetooth headset cannot normally play the group call service sound.
Disclosure of Invention
In view of the above, the main objective of the present invention is to provide an audio playing method and apparatus, which can effectively solve the problem that the audio playing device supporting local audio recording cannot normally play the voice of the group call service as a bluetooth headset.
In order to achieve the above object, an embodiment of the present application provides an audio playing method, including:
when first equipment needs to be used as a Bluetooth headset accessory of terminal equipment to play voice of a group call service, the first equipment triggers a built-in coder-decoder (CODEC) to enter a frequency division processing state; the first equipment has a local sound recording or video recording function;
When the codec is in a frequency division processing state, the codec correspondingly processes the voice which needs to be played by the first equipment at present according to a first sampling rate; the first sampling rate is a sampling rate matched with the Bluetooth headset.
Preferably, the triggering, by the first device, the built-in codec to enter the frequency division processing state includes:
and when the first equipment receives the establishment notice of the group call service from the terminal equipment, the first equipment triggers the codec to switch to a frequency division processing state.
Preferably, the performing, by the codec, corresponding processing on the speech that needs to be played by the first device according to the first sampling rate includes:
for the audio data input to the codec by the first device, the codec performs processing in a frequency division manner, and outputs a processing result to a loudspeaker of the first device for playing; the sampling rate of the processing result is the first sampling rate; the sampling rate of the input audio data is a second sampling rate, and the second sampling rate is greater than or equal to 48 k.
Preferably, the method further comprises:
and when the first equipment receives the end notice of the group call service from the terminal equipment, the first equipment triggers the codec to switch to a non-frequency-division processing state.
Preferably, the method further comprises:
when the codec is in a non-frequency division processing state, the codec correspondingly processes the voice which needs to be recorded and played by the first equipment at present according to a second sampling rate; the second sampling rate is a sampling rate provided by a master clock of a processor of the first device; the second sampling rate is equal to or greater than 48 k.
Preferably, the first sampling rate is 8 k.
Preferably, the first device is a recorder.
An audio playing device arranged in a first device comprises: a processor and CODEC and speaker;
the processor is configured to:
when the first equipment needs to be used as a Bluetooth headset accessory of terminal equipment to play the voice of the group call service, triggering a codec in the first equipment to enter a frequency division processing state; the first equipment has a local sound recording or video recording function;
the codec is to: when the first device is in a frequency division processing state, correspondingly processing the voice which needs to be played by the first device at present according to a first sampling rate; the first sampling rate is a sampling rate matched with the Bluetooth headset.
Preferably, the processor is specifically configured to: and when the first equipment receives the establishment notice of the group call service from the terminal equipment, triggering the codec to switch to a frequency division processing state.
Preferably, the codec is specifically configured to:
processing the audio data input to the codec by the first device in a frequency division mode, and outputting a processing result to the loudspeaker for playing; the sampling rate of the processing result is the first sampling rate; the sampling rate of the input audio data is a second sampling rate, and the second sampling rate is greater than or equal to 48 k.
Preferably, the processor is further configured to:
and when the first equipment receives the end notice of the group call service from the terminal equipment, triggering the codec to switch to a non-frequency-division processing state.
Preferably, the codec is further configured to:
when the first device is in a non-frequency division processing state, correspondingly processing the voice which needs to be recorded and played by the first device at present according to a second sampling rate; the second sampling rate is a sampling rate provided by a master clock of a processor of the first device; the second sampling rate is equal to or greater than 48 k.
Preferably, it is characterized in that: the first sampling rate is 8 k.
Preferably, the first device is a recorder.
The present application also discloses a non-transitory computer-readable storage medium storing instructions that, when executed by a processor, cause the processor to perform the steps of the audio playback method as previously described.
The application also discloses an electronic device comprising the non-volatile computer-readable storage medium as described above, and the processor having access to the non-volatile computer-readable storage medium.
According to the technical scheme, the audio playing method and the audio playing device provided by the application have the advantages that when the first device for playing the audio carries out the group call service, the codec in the first device needs to be triggered to carry out the frequency division processing state, so that the audio needing to be played is processed in a frequency division mode, the sampling rate of the audio data input to the loudspeaker to be played is the sampling rate matched with the Bluetooth earphone, and the problem that the audio playing device supporting local recording and video cannot normally play the sound of the group call service when serving as the Bluetooth earphone can be effectively solved.
Drawings
FIG. 1 is a schematic flow chart of a method according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating data processing of a codec according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is further described in detail below by referring to the accompanying drawings and examples.
In the embodiment of the application, when the audio playing device supporting local recording and video playing is used as a bluetooth headset to play the group call service sound, the audio playing device performs playing processing on the audio data by adopting the sampling rate matched with the bluetooth headset, so that under the scene that the local recording and video playing and the group call service are concurrent, the user can not only normally listen to the audio played back by the local recording and video playing, but also ensure the normal playing of the group call service sound, and the problem that the group call service sound cannot be normally played under the condition that the group call service is performed can be solved.
Fig. 1 is a schematic flowchart of a method according to an embodiment of the present invention, and as shown in fig. 1, an audio playing method implemented by the embodiment mainly includes:
101, when a first device needs to be used as a bluetooth headset accessory of a terminal device to play voice of a group call service, triggering a built-in coder-decoder (CODEC) by the first device to enter a frequency division processing state; the first device has a local audio or video recording function.
It should be noted that, for the first device with local audio recording or video recording function, in order to meet the requirement of clear playing of locally recorded audio, it is necessary to make the master clock of its processor (e.g. System On Chip (SOC) of the recorder) provide a high sampling rate, such as 48k, and the sampling rate matched with the bluetooth headset is lower, such as 16k, 8k, etc., so as to ensure normal playing of the voice of group call service, it is necessary to divide the frequency of the high sampling rate provided by the master clock, therefore, when the first device needs to play the voice of group call service as a bluetooth headset accessory of the terminal device, the CODEC in the first device will be triggered to enter a frequency division processing state, so as to perform audio processing in a frequency division manner thereafter, so as to ensure normal playing of the voice of group call service.
The first device is an audio playing device with a local recording or video function, such as a recorder, but not limited thereto.
Preferably, the first device may trigger the built-in codec to enter the frequency division processing state by:
and when the first equipment receives the establishment notice of the group call service from the terminal equipment, the first equipment triggers the codec to switch to a frequency division processing state.
Here, it is ensured that the voice of the group call service can be normally played in time, and when the group call service is established, the terminal device needs to notify the first device of the current start of the group call service, so that the first device can trigger the codec therein to switch to the frequency division processing state in time according to the notification.
And 102, when the codec is in a frequency division processing state, the codec correspondingly processes the voice which needs to be played by the first equipment at present according to a first sampling rate.
The first sampling rate is a sampling rate matched with the Bluetooth headset, such as 16k, 8k and the like, and can be specifically set according to actual needs as long as the sampling rate is matched with the Bluetooth headset.
Preferably, the codec may perform corresponding processing on the speech currently required to be played by the first device according to the first sampling rate by using the following method:
And for the audio data input into the codec by the first device, the codec processes the audio data in a frequency division mode, and outputs a processing result to a loudspeaker of the first device for playing. Wherein the sampling rate of the processing result is the first sampling rate; the sampling rate of the input audio data is a second sampling rate, and the second sampling rate is greater than or equal to 48 k.
In the above method, a frequency division manner needs to be adopted to reduce the output sampling rate, for example, when the first sampling rate is 8k and the second sampling rate is 48k, 1/6 frequency division needs to be adopted, and a specific implementation method of frequency division is the same as that in the prior art, and is not described herein again.
In practical application, when the local recording and video recording and the group call service are concurrent, the audio data input to the codec will include the group call service audio data acquired by the bluetooth module in the first device and the audio data that needs to be played back and is locally recorded by the first device.
Fig. 2 shows a schematic data processing diagram of a codec according to an embodiment of the present invention. In fig. 2, Port1 is connected to play the local audio or video, Port2 is connected to play the bluetooth data, SOC is the main chip, the main clock provides the second sampling rate, and the audio recorded by the microphone (mic) is sent to SOC through the analog-to-digital converter (ADC). When the codec is in a frequency division state, audio data output by the SOC is subjected to frequency division through a digital-to-analog converter (DAC) and then sent to a loudspeaker for playing.
Preferably, in order to make the locally recorded audio played with higher quality as possible without affecting the voice playing of the group call service, in practical applications, the codec may be triggered to switch to the non-frequency-division processing state when the group call service is ended, so that the codec may play the local audio with a sampling rate matched with the main clock, and the following method may be specifically adopted to achieve this purpose:
and when the first equipment receives the end notice of the group call service from the terminal equipment, the first equipment triggers the codec to switch to a non-frequency-division processing state.
When the codec is in a non-frequency division processing state, the codec correspondingly processes the voice which needs to be recorded and played by the first equipment at present according to a second sampling rate; the second sampling rate is a sampling rate provided by a master clock of a processor of the first device; the second sampling rate is equal to or greater than 48 k.
Corresponding to the above method embodiment, the present application further provides an audio playing apparatus, disposed in a first device, including: a processor and CODEC (CODEC) and a speaker;
the processor is configured to:
When the first equipment needs to be used as a Bluetooth headset accessory of terminal equipment to play the voice of the group call service, triggering a codec in the first equipment to enter a frequency division processing state; the first equipment has a local sound recording or video recording function;
the codec is to: when the first device is in a frequency division processing state, correspondingly processing the voice which needs to be played by the first device at present according to a first sampling rate; the first sampling rate is a sampling rate matched with the Bluetooth headset.
Preferably, the processor is specifically configured to: and when the first equipment receives the establishment notice of the group call service from the terminal equipment, triggering the codec to switch to a frequency division processing state.
Preferably, the codec is specifically configured to:
processing the audio data input to the codec by the first device in a frequency division mode, and outputting a processing result to the loudspeaker for playing; the sampling rate of the processing result is the first sampling rate; the sampling rate of the input audio data is a second sampling rate, and the second sampling rate is greater than or equal to 48 k.
Preferably, the processor is further configured to:
And when the first equipment receives the end notice of the group call service from the terminal equipment, triggering the codec to switch to a non-frequency-division processing state.
Preferably, the codec is further configured to:
when the first device is in a non-frequency division processing state, correspondingly processing the voice which needs to be recorded and played by the first device at present according to a second sampling rate; the second sampling rate is a sampling rate provided by a master clock of a processor of the first device; the second sampling rate is equal to or greater than 48 k.
Preferably, it is characterized in that: the first sampling rate is 8 k.
Preferably, the first device is a recorder.
Furthermore, the present application also provides a non-transitory computer-readable storage medium storing instructions that, when executed by a processor, cause the processor to perform the steps of the audio playback method as described above.
Further, the present application provides an electronic device comprising the non-volatile computer-readable storage medium as described above, and the processor having access to the non-volatile computer-readable storage medium.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (14)

1. An audio playing method, comprising:
when first equipment needs to be used as a Bluetooth headset accessory of terminal equipment to play voice of a group call service, the first equipment triggers a built-in CODEC to enter a frequency division processing state; the first equipment has a local sound recording or video recording function;
when the codec is in a frequency division processing state, the codec correspondingly processes the voice which needs to be played by the first equipment at present according to a first sampling rate; the first sampling rate is a sampling rate matched with the Bluetooth headset;
the first device triggering the built-in CODEC to enter a frequency division processing state comprises:
and when the first equipment receives the establishment notice of the group call service from the terminal equipment, the first equipment triggers the codec to switch to a frequency division processing state.
2. The method of claim 1, wherein: the codec, according to a first sampling rate, correspondingly processing the speech that needs to be played by the first device at present includes:
for the audio data input to the codec by the first device, the codec performs processing in a frequency division manner, and outputs a processing result to a loudspeaker of the first device for playing; the sampling rate of the processing result is the first sampling rate; the sampling rate of the input audio data is a second sampling rate, and the second sampling rate is greater than or equal to 48 k.
3. The method of claim 1, wherein the method further comprises:
and when the first equipment receives the end notice of the group call service from the terminal equipment, the first equipment triggers the codec to switch to a non-frequency-division processing state.
4. The method of claim 3, wherein the method further comprises:
when the codec is in a non-frequency division processing state, the codec correspondingly processes the voice which needs to be recorded and played by the first equipment at present according to a second sampling rate; the second sampling rate is a sampling rate provided by a master clock of a processor of the first device; the second sampling rate is equal to or greater than 48 k.
5. The method of claim 1, wherein: the first sampling rate is 8 k.
6. The method of claim 1, wherein: the first device is a recorder.
7. An audio playing device, disposed in a first device, includes: a processor and CODEC and speaker;
the processor is configured to:
when the first equipment needs to be used as a Bluetooth headset accessory of terminal equipment to play the voice of the group call service, triggering a codec in the first equipment to enter a frequency division processing state; the first equipment has a local sound recording or video recording function; when the first device receives a setup notification of the group call service from the terminal device, triggering the codec to switch to a frequency division processing state;
The codec is to: when the first device is in a frequency division processing state, correspondingly processing the voice which needs to be played by the first device at present according to a first sampling rate; the first sampling rate is a sampling rate matched with the Bluetooth headset.
8. The apparatus of claim 7, wherein: the codec is specifically configured to:
processing the audio data input to the codec by the first device in a frequency division mode, and outputting a processing result to the loudspeaker for playing; the sampling rate of the processing result is the first sampling rate; the sampling rate of the input audio data is a second sampling rate, and the second sampling rate is greater than or equal to 48 k.
9. The apparatus of claim 7, wherein the processor is further configured to:
and when the first equipment receives the end notice of the group call service from the terminal equipment, triggering the codec to switch to a non-frequency-division processing state.
10. The apparatus of claim 9, wherein the codec is further to:
when the first device is in a non-frequency division processing state, correspondingly processing the voice which needs to be recorded and played by the first device at present according to a second sampling rate; the second sampling rate is a sampling rate provided by a master clock of a processor of the first device; the second sampling rate is equal to or greater than 48 k.
11. The apparatus of claim 7, wherein: the first sampling rate is 8 k.
12. The apparatus of claim 7, wherein: the first device is a recorder.
13. A non-transitory computer readable storage medium storing instructions which, when executed by a processor, cause the processor to perform the steps of the audio playback method of any of claims 1 to 6.
14. An electronic device comprising the non-volatile computer-readable storage medium of claim 13, and the processor having access to the non-volatile computer-readable storage medium.
CN201911028201.1A 2019-10-28 2019-10-28 Audio playing method and device Active CN112738732B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911028201.1A CN112738732B (en) 2019-10-28 2019-10-28 Audio playing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911028201.1A CN112738732B (en) 2019-10-28 2019-10-28 Audio playing method and device

Publications (2)

Publication Number Publication Date
CN112738732A CN112738732A (en) 2021-04-30
CN112738732B true CN112738732B (en) 2022-07-29

Family

ID=75588865

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911028201.1A Active CN112738732B (en) 2019-10-28 2019-10-28 Audio playing method and device

Country Status (1)

Country Link
CN (1) CN112738732B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114783452B (en) * 2022-06-17 2022-12-13 荣耀终端有限公司 Audio playing method, device and storage medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6016550A (en) * 1997-12-02 2000-01-18 International Business Machines Corporation Method and apparatus for audio sample rate conversion within a data-processing system
EP0957579A1 (en) * 1998-05-15 1999-11-17 Deutsche Thomson-Brandt Gmbh Method and apparatus for sampling-rate conversion of audio signals
CN104615403A (en) * 2015-01-07 2015-05-13 大唐移动通信设备有限公司 Audio output device
CN105812902B (en) * 2016-03-17 2018-09-04 联发科技(新加坡)私人有限公司 Method, equipment and the system of data playback
KR102453656B1 (en) * 2018-01-25 2022-10-12 삼성전자주식회사 Application processor for low power operation, electronic device including the same and method of operating the same
CN110134362A (en) * 2019-05-16 2019-08-16 北京小米移动软件有限公司 Audio frequency playing method, device, playback equipment and storage medium
CN110366752B (en) * 2019-05-21 2023-10-10 深圳市汇顶科技股份有限公司 Voice frequency division transmission method, source terminal, play terminal, source terminal circuit and play terminal circuit

Also Published As

Publication number Publication date
CN112738732A (en) 2021-04-30

Similar Documents

Publication Publication Date Title
US10262650B2 (en) Earphone active noise control
CN101459717B (en) Wireless terminal and method for implementing multi-channel multiplexing
US9208766B2 (en) Computer program product for adaptive audio signal shaping for improved playback in a noisy environment
US9336786B2 (en) Signal processing device, signal processing method, and storage medium
CN103312912B (en) A kind of mixer system and method
KR20140019023A (en) Generating a masking signal on an electronic device
EP2103155A1 (en) Method and device for data capture for push over cellular
US10510361B2 (en) Audio processing apparatus that outputs, among sounds surrounding user, sound to be provided to user
CN107621933B (en) Audio playing method and device and related medium product
EP2557778A1 (en) Method and apparatus for video recording in video calls
US20230171539A1 (en) Audio output device, method for eliminating sound leakage, and storage medium (as amended)
CN105611026B (en) A kind of method, apparatus and electronic equipment adjusting In Call
CN112738732B (en) Audio playing method and device
CN105575398A (en) Sound noise reduction method and sound noise reduction terminal
WO2017185602A1 (en) Earphone mode switching method and electronic device
CN109511040B (en) Whisper amplifying method and device and earphone
CN101212529B (en) System, device, and method for controlling automobile sound system by telephone
CN106293607B (en) Method and system for automatically switching audio output modes
CN111083250A (en) Mobile terminal and noise reduction method thereof
CN112788263B (en) Method and equipment for controlling multifunctional recorder to record voice
CN113423007A (en) Control method and device for multi-audio playing, electronic equipment and storage medium
CN105120199A (en) Realization method for sound processing in video call
US20130226581A1 (en) Communication device and method
CN106488044B (en) Mobile phone and system for mobile sound card and implementation method
CN112188019B (en) Processing 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