[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN101661748B - Method for realizing audio mixing in audio device - Google Patents

Method for realizing audio mixing in audio device Download PDF

Info

Publication number
CN101661748B
CN101661748B CN200910112508XA CN200910112508A CN101661748B CN 101661748 B CN101661748 B CN 101661748B CN 200910112508X A CN200910112508X A CN 200910112508XA CN 200910112508 A CN200910112508 A CN 200910112508A CN 101661748 B CN101661748 B CN 101661748B
Authority
CN
China
Prior art keywords
over
fifo
change
change step
data
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
CN200910112508XA
Other languages
Chinese (zh)
Other versions
CN101661748A (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.)
Rockchip Electronics Co Ltd
Original Assignee
Fuzhou Rockchip Electronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fuzhou Rockchip Electronics Co Ltd filed Critical Fuzhou Rockchip Electronics Co Ltd
Priority to CN200910112508XA priority Critical patent/CN101661748B/en
Publication of CN101661748A publication Critical patent/CN101661748A/en
Application granted granted Critical
Publication of CN101661748B publication Critical patent/CN101661748B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Management Or Editing Of Information On Record Carriers (AREA)

Abstract

The invention relates to a method for realizing audio mixing in an audio device, which mainly comprises the following steps of: decoding audio data; mixing a plurality of decoded data together; and transmitting mixed data to an IIS controller through DMA. The method realizes the software audio mixing function in a multitasking system, so that a plurality of sounds can be heard simultaneously, and keypad tone can give off simultaneously when listening to music.

Description

Realize the method for audio mixing in a kind of audio frequency apparatus
[technical field]
The invention belongs to field of audio devices, be meant the method that realizes audio mixing in a kind of audio frequency apparatus especially.
[background technology]
Connecing key sound in the multimedia equipment is its indispensable function, but because system does not possess sound mixing function, so can send keypad tone again when can't realize listening to the music.For example, when listening the MP3 music, can't hear keypad tone this moment.
[summary of the invention]
Technical matters to be solved by this invention is to provide the method that realizes audio mixing in a kind of audio frequency apparatus, has realized the software sound mixing function in multitask system, can hear multiple sound simultaneously.
The present invention solves the problems of the technologies described above by the following technical solutions:
Realize the method for audio mixing in a kind of audio frequency apparatus, comprise the steps:
Step 100: decoding audio data comprises the steps:
Step 101: beginning;
Does step 102: the demoder initialization judge whether success? be to change step 103 over to; , do not change step 111 over to;
Step 103: apply for a FIFO, judge whether success? be to change step 104 over to; , do not change step 111 over to;
Step 104: suspend and play? be to change step 106 over to; , do not change step 105 over to;
Is step 105:FIFO full? be to change step 106 over to; , do not change step 107 over to;
Step 106:OSTIMEDELAY changes step 109 over to;
Step 107: decode, and data are deposited among the FIFO;
Step 108: judge whether decoding successful? be to change step 109 over to; , do not change step 111 over to;
Step 109: judge whether to finish decoding: be to change step 110 over to; , do not change step 104 over to;
Step 110; Anti-initializing decoder discharges the FIFO space;
Step 111: end task;
Step 200: with a plurality of decoded data mixing together, comprise the steps:
Step 201: beginning;
Step 202: apply for a FIFO_A, success? be to change step 203 over to; , do not change step 211 over to;
Step 203: the BUF_A of an X length of application, success? be to change step 204 over to; , do not change step 211 over to;
Step 204: registration DMA interrupt function, and start DMA;
Is not step 205: the FIFO of all audio task empty? be to change step 206 over to; , do not change step 207 over to;
Is step 206:FIFO_A full? be to change step 207 over to; , do not change step 208 over to;
Step 207:OSTIMEDELAY changes step 205 over to;
Step 208: from the FIFO of all audio frequency, take out the data computing that superposes, and deposit among the FIFO_A;
Step 209: judge whether to stop audio mixing? be to change step 210 over to; , do not change step 205 over to;
Step 210: stop DMA, discharge FIFO_A and BUF_A space;
Step 211: end task;
Step 300: by DMA blended data is passed to the IIS controller, comprise the steps:
Step 301: beginning;
Is not step 302: the space that judges whether the FIFO_A that sent released? be to change step 303 over to; , do not change step 304 over to;
Step 303: discharge the space that FIFO_A has been removed data;
Step 304: judge whether the FIFO_A non-NULL? be to change step 305 over to; , do not change step 306 over to;
Step 305: judge that space that FIFO_A used is greater than the X value? be to change step 307 over to; , do not change step 309 over to;
Step 306: BUF_A is filled out 0; Change step 308 over to:
Step 307: the data of reading X length from FIFO_A are to BUF_A, and sign FIFO_A has X length space not to be released;
Step 308: configuration also starts DMA, and the data of the X length of BUF_A are passed to the IIS controller; Change step 310 over to;
Step 309: the length data of reading the space Y of having used from FIFO_A is to BUF_A, and sign FIFO_A has Y length space not to be released, and configuration also starts DMA, and the data of the Y length of BUF_A are passed to the IIS controller;
Step 310: End of Interrupt withdraws from.
The advantage that realizes the method for audio mixing in a kind of audio frequency apparatus of the present invention is: by a plurality of voice datas of decoding, with a plurality of decoded data mixing together, pass to the IIS controller by DMA then, realized audio mixing.Can when listening to the music, send keypad tone.
[description of drawings]
The invention will be further described in conjunction with the embodiments with reference to the accompanying drawings.
Fig. 1 is a workflow synoptic diagram of the present invention.
Fig. 2 is a decoding audio data workflow synoptic diagram among the present invention.
Fig. 3 is an audio mixing task workflow synoptic diagram among the present invention.
Fig. 4 passes to IIS controller workflow synoptic diagram by DMA with blended data among the present invention.
[embodiment]
Realizing the method for audio mixing in a kind of audio frequency apparatus, mainly is the direction of control data stream, and as shown in Figure 1, it comprises the steps: step 100: decoding audio data; Step 200: together with a plurality of decoded data mixing; Step 300: blended data is passed to the IIS controller by DMA.
Seeing also shown in Figure 2ly, is decoding audio data workflow synoptic diagram among the present invention.Comprise the steps:
Step 101: beginning;
Does step 102: the demoder initialization judge whether success? be to change step 103 over to; , do not change step 111 over to;
Step 103: apply for a FIFO, judge whether success? be to change step 104 over to; , do not change step 111 over to;
Step 104: suspend and play? be to change step 106 over to; , do not change step 105 over to;
Is step 105:FIFO full? be to change step 106 over to; , do not change step 107 over to;
Step 106:OSTIMEDELAY changes step 109 over to;
Step 107: decode, and data are deposited among the FIFO;
Step 108: judge whether decoding successful? be to change step 109 over to; , do not change step 111 over to;
Step 109: judge whether to finish decoding: be to change step 110 over to; , do not change step 104 over to;
Step 110; Anti-initializing decoder discharges the FIFO space;
Step 111: end task.
Seeing also shown in Figure 3ly, is audio mixing task workflow synoptic diagram among the present invention, is about to a plurality of decoded data mixing together.Comprise the steps:
Step 201: beginning;
Step 202: apply for a FIFO_A, success? be to change step 203 over to; , do not change step 211 over to;
Step 203: the BUF_A of an X length of application, success? be to change step 204 over to; , do not change step 211 over to;
Step 204: registration DMA interrupt function, and start DMA;
Is not step 205: the FIFO of all audio task empty? be to change step 206 over to; , do not change step 207 over to;
Is step 206:FIFO_A full? be to change step 207 over to; , do not change step 208 over to;
Step 207:OSTIMEDELAY changes step 205 over to;
Step 208: from the FIFO of all audio frequency, take out the data computing that superposes, and deposit among the FIFO_A;
Step 209: judge whether to stop audio mixing? be to change step 210 over to; , do not change step 205 over to;
Step 210: stop DMA, discharge FIFO_A and BUF_A space;
Step 211: end task.
Seeing also shown in Figure 4ly, is by DMA blended data to be passed to IIS controller workflow synoptic diagram among the present invention.Comprise the steps:
Step 301: beginning;
Is not step 302: the space that judges whether the FIFO_A that sent released? be to change step 303 over to; , do not change step 304 over to;
Step 303: discharge the space that FIFO_A has been removed data;
Step 304: judge whether the FIFO_A non-NULL? be to change step 305 over to; , do not change step 306 over to;
Step 305: judge that space that FIFO_A used is greater than the X value? be to change step 307 over to; , do not change step 309 over to;
Step 306: BUF_A is filled out 0; Change step 308 over to:
Step 307: the data of reading X length from FIFO_A are to BUF_A, and sign FIFO_A has X length space not to be released;
Step 308: configuration also starts DMA, and the data of the X length of BUF_A are passed to the IIS controller; Change step 310 over to;
Step 309: the length data of reading the space Y of having used from FIFO_A is to BUF_A, and sign FIFO_A has Y length space not to be released, and configuration also starts DMA, and the data of the Y length of BUF_A are passed to the IIS controller;
Step 310: End of Interrupt withdraws from.
The present invention has realized the software sound mixing function in multitask system, can hear multiple sound simultaneously, when listening to the music, can send keypad tone.

Claims (1)

1. realize the method for audio mixing in the audio frequency apparatus, it is characterized in that: comprise the steps:
Step 100: decoding audio data comprises the steps:
Step 101: beginning;
Does step 102: the demoder initialization judge whether success? be to change step 103 over to; , do not change step 111 over to;
Step 103: apply for a FIFO, judge whether success? be to change step 104 over to; , do not change step 111 over to;
Step 104: suspend and play? be to change step 106 over to; , do not change step 105 over to;
Is step 105:FIFO full? be to change step 106 over to; , do not change step 107 over to;
Step 106:OSTIMEDELAY changes step 109 over to;
Step 107: decode, and data are deposited among the FIFO;
Step 108: judge whether decoding successful? be to change step 109 over to; , do not change step 111 over to;
Step 109: judge whether to finish decoding: be to change step 110 over to; , do not change step 104 over to;
Step 110; Anti-initializing decoder discharges the FIFO space;
Step 111: end task;
Step 200: with a plurality of decoded data mixing together, comprise the steps:
Step 201: beginning;
Step 202: apply for a FIFO_A, success? be to change step 203 over to; , do not change step 211 over to;
Step 203: the BUF_A of an X length of application, success? be to change step 204 over to; , do not change step 211 over to;
Step 204: registration DMA interrupt function, and start DMA;
Is not step 205: the FIFO of all audio task empty? be to change step 206 over to; , do not change step 207 over to;
Is step 206:FIFO_A full? be to change step 207 over to; , do not change step 208 over to;
Step 207:OSTIMEDELAY changes step 205 over to;
Step 208: from the FIFO of all audio frequency, take out the data computing that superposes, and deposit among the FIFO_A;
Step 209: judge whether to stop audio mixing? be to change step 210 over to; , do not change step 205 over to;
Step 210: stop DMA, discharge FIFO_A and BUF_A space;
Step 211: end task;
Step 300: by DMA blended data is passed to the IIS controller, comprise the steps:
Step 301: beginning;
Is not step 302: the space that judges whether the FIFO_A that sent released? be to change step 303 over to; , do not change step 304 over to;
Step 303: discharge the space that FIFO_A has been removed data;
Step 304: judge whether the FIFO_A non-NULL? be to change step 305 over to; , do not change step 306 over to;
Step 305: judge that space that FIFO_A used is greater than the X value? be to change step 307 over to; , do not change step 309 over to;
Step 306: BUF_A is filled out 0; Change step 308 over to:
Step 307: the data of reading X length from FIFO_A are to BUF_A, and sign FIFO_A has X length space not to be released;
Step 308: configuration also starts DMA, and the data of the X length of BUF_A are passed to the IIS controller; Change step 310 over to;
Step 309: the length data of reading the space Y of having used from FIFO_A is to BUF_A, and sign FIFO_A has Y length space not to be released, and configuration also starts DMA, and the data of the Y length of BUF_A are passed to the IIS controller;
Step 310: End of Interrupt withdraws from.
CN200910112508XA 2009-09-15 2009-09-15 Method for realizing audio mixing in audio device Active CN101661748B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200910112508XA CN101661748B (en) 2009-09-15 2009-09-15 Method for realizing audio mixing in audio device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200910112508XA CN101661748B (en) 2009-09-15 2009-09-15 Method for realizing audio mixing in audio device

Publications (2)

Publication Number Publication Date
CN101661748A CN101661748A (en) 2010-03-03
CN101661748B true CN101661748B (en) 2011-12-14

Family

ID=41789722

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200910112508XA Active CN101661748B (en) 2009-09-15 2009-09-15 Method for realizing audio mixing in audio device

Country Status (1)

Country Link
CN (1) CN101661748B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106325804B (en) * 2015-07-03 2019-05-31 深圳市中兴微电子技术有限公司 Audio-frequency processing method and system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1218566A (en) * 1996-03-13 1999-06-02 钻石多媒体系统公司 Method and apparatus for supporting demand driven multiple parallel digital data stream transport
US6952621B1 (en) * 1997-10-14 2005-10-04 Crystal Semiconductor Corp. Single-chip audio circuits, methods, and systems using the same

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1218566A (en) * 1996-03-13 1999-06-02 钻石多媒体系统公司 Method and apparatus for supporting demand driven multiple parallel digital data stream transport
US6952621B1 (en) * 1997-10-14 2005-10-04 Crystal Semiconductor Corp. Single-chip audio circuits, methods, and systems using the same

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
乐燕芬等.基于uC/OS-II的嵌入式音频系统设计.《自动化仪表》.2006,第27卷(第5期), *
向赛辉等.基于uC/OS-II的MP3文件播放系统设计.《国外电子元器件》.2008,(第2期), *

Also Published As

Publication number Publication date
CN101661748A (en) 2010-03-03

Similar Documents

Publication Publication Date Title
CN107301035B (en) Audio synchronous recording and playing system and method based on Android system
US8930590B2 (en) Audio device and method of operating the same
CN110832579A (en) Last mile equalization
US8223851B2 (en) Method and an apparatus for embedding data in a media stream
CN102932567A (en) Terminal and audio processing method
WO2018152679A1 (en) Audio file transmitting method and apparatus, audio file receiving method and apparatus, devices and system
US10652681B2 (en) Processing method and system of audio multichannel output speaker, and mobile phone
CN102355309A (en) Method and apparatus for realization of Bluetooth stereophonic sound with support of a plurality of sampling rates
CN101834929B (en) Audio playing system and method
CN108920128A (en) The operating method and system of PowerPoint
CN108235052A (en) Multi-audio-frequency channel hardware audio mixing, acquisition and the method for broadcasting may be selected based on IOS
CN102332279A (en) Switching method between navigation sound and music sound
JP2010522363A (en) Musical instrument digital interface hardware instructions
JP5539350B2 (en) System, method or apparatus for integrating multiple streams of media data
CN101661748B (en) Method for realizing audio mixing in audio device
CN105869647B (en) A kind of primary DSD audio-frequency decoding method of smart phone, system and smart phone
CN107507617A (en) A kind of system and method realized DSD audios and solved firmly
CN203055399U (en) Information release system with automatic voice broadcast function
JP2010522359A (en) Electronic musical instrument digital interface hardware instruction set
US20100165815A1 (en) Gapless audio playback
CN101388690A (en) Method for playing music by monophonic Bluetooth earphone
CN101102447A (en) A method for playing advertisement multimedia and system for implementing this method
US20070146314A1 (en) Method and apparatus for a user interface
CN105976825A (en) Music sharing device and music sharing method
CN203345872U (en) Intelligent voice bus station broadcaster used for elevator

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C56 Change in the name or address of the patentee
CP03 Change of name, title or address

Address after: 350000 Fuzhou Gulou District, Fujian, software Avenue, building 89, No. 18

Patentee after: FUZHOU ROCKCHIP ELECTRONICS CO., LTD.

Address before: 350011, building 1, building 550, No. 601, industrial road, West Suburbs, Hongshan Town, Gulou District, Fujian, Fuzhou

Patentee before: Fuzhou Rockchip Semiconductor Co., Ltd.

CP01 Change in the name or title of a patent holder

Address after: 350000 building, No. 89, software Avenue, Gulou District, Fujian, Fuzhou 18, China

Patentee after: Ruixin Microelectronics Co., Ltd

Address before: 350000 building, No. 89, software Avenue, Gulou District, Fujian, Fuzhou 18, China

Patentee before: Fuzhou Rockchips Electronics Co.,Ltd.

CP01 Change in the name or title of a patent holder