Electronic equipment and audio playing method

文档序号:1204814 发布日期:2020-09-01 浏览:21次 中文

阅读说明:本技术 一种电子设备及音频播放方法 (Electronic equipment and audio playing method ) 是由 王兆飞 于 2020-05-14 设计创作,主要内容包括:本发明提供一种电子设备及音频播放方法,包括控制器、开关单元、音频编解码器、通过开关单元与音频编解码器连接的音频输出通道;控制器用于确定当前的音频输出模式为第一音频输出模式并输出与第一音频输出模式对应的第一控制信号至开关单元;音频编解码器用于根据第一音频输出模式进行音频解码;开关单元用于在第一控制信号的作用下,将第一音频输出模式对应的第一音频输出通道与音频编解码器导通,并将第二音频输出通道与音频编解码器断开。该方案通过引入开关单元,在断开扬声器与音频调制解调器之间的连接的同时导通耳机与音频调制解调器之间的连接,从而可以避免扬声器模式到耳机模式切换过程中的短暂停顿和损坏人耳的现象发生。(The invention provides electronic equipment and an audio playing method, comprising a controller, a switch unit, an audio codec and an audio output channel connected with the audio codec through the switch unit; the controller is used for determining that the current audio output mode is a first audio output mode and outputting a first control signal corresponding to the first audio output mode to the switch unit; the audio codec is used for carrying out audio decoding according to the first audio output mode; the switch unit is used for connecting a first audio output channel corresponding to the first audio output mode with the audio codec and disconnecting a second audio output channel from the audio codec under the action of the first control signal. The scheme is characterized in that the switch unit is introduced, the connection between the earphone and the audio modem is switched on while the connection between the loudspeaker and the audio modem is switched off, and therefore the phenomena of short pause and human ear damage in the switching process from the loudspeaker mode to the earphone mode can be avoided.)

1. An electronic device, comprising: the device comprises a controller, a switch unit, an audio codec and a plurality of audio output channels connected with the audio codec through the switch unit;

the controller is used for determining that the current audio output mode is a first audio output mode and outputting a first control signal corresponding to the first audio output mode to the switch unit;

the audio codec is used for performing audio decoding according to the first audio output mode;

the switch unit is configured to, under the action of the first control signal, turn on a first audio output channel corresponding to the first audio output mode with the audio codec, and turn off a second audio output channel from the audio codec, where the second audio output channel is each of the plurality of audio output channels except the first audio output channel.

2. The electronic device of claim 1,

the first audio output channel is an earphone output channel, and the second audio output channel is a loudspeaker output channel;

the first control signal is used for connecting the audio codec with the earphone output channel and disconnecting the audio codec from the loudspeaker output channel;

the second control signal is used for disconnecting the audio codec from the earphone output channel and connecting the audio codec with the loudspeaker output channel.

3. The electronic device of claim 2,

the switching unit includes: a control pin and a switch; the change-over switch comprises an input pin, a first output pin and a second output pin;

the control pin is connected with the controller and used for controlling the connection state of the input pin and the first output pin and the connection state of the input pin and the second output pin;

the input pin is connected with the audio codec, the first output pin is connected with the earphone output channel, and the second output pin is connected with the loudspeaker output channel.

4. The electronic device of claim 3,

the control pins comprise a first control pin and a second control pin;

the change-over switch comprises a first change-over switch and a second change-over switch;

the first control pin is used for controlling the first change-over switch, and the second control pin is used for controlling the second change-over switch.

5. The electronic device of claim 3, further comprising an earphone jack and a speaker;

the change-over switch is a single-pole double-throw switch.

6. An audio playing method, comprising:

determining a current audio output mode as a first audio output mode;

controlling an audio codec to perform audio decoding according to the first audio output mode;

outputting a first control signal corresponding to the first audio output mode to a switch unit; the first control signal is used for connecting a first audio output channel corresponding to the first audio output mode with an audio codec and disconnecting a second audio output channel from the audio codec, wherein the second audio output channel is each of a plurality of audio output channels except the first audio output channel.

7. The method of claim 6,

the determining that the current audio output mode is the first audio output mode includes:

detecting an earphone connection signal;

and determining the current audio output mode as the earphone output mode.

8. The method of claim 7,

after the outputting the first control signal corresponding to the first audio output mode to the switch unit, the method further includes:

outputting a third control signal to the loudspeaker power amplification unit, wherein the third control signal is used for indicating the loudspeaker power amplification unit to stop working;

and outputting a fourth control signal to the loudspeaker power supply unit, wherein the fourth control signal is used for indicating the loudspeaker power supply unit to stop supplying power.

9. A computer device, comprising:

a memory for storing a computer program;

a processor for calling a computer program stored in said memory, for executing the method according to any one of claims 6-8 in accordance with the obtained program.

10. A computer-readable storage medium, characterized in that the storage medium stores a program which, when run on a computer, causes the computer to carry out the method according to any one of claims 6-8.

15页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种波束形成方法、装置、设备和存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!