CN101286114A - Method for multi- program sharing audiofrequency apparatus - Google Patents

Method for multi- program sharing audiofrequency apparatus Download PDF

Info

Publication number
CN101286114A
CN101286114A CNA2008103014763A CN200810301476A CN101286114A CN 101286114 A CN101286114 A CN 101286114A CN A2008103014763 A CNA2008103014763 A CN A2008103014763A CN 200810301476 A CN200810301476 A CN 200810301476A CN 101286114 A CN101286114 A CN 101286114A
Authority
CN
China
Prior art keywords
passage
audio
voice data
data
program
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.)
Granted
Application number
CNA2008103014763A
Other languages
Chinese (zh)
Other versions
CN101286114B (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.)
Sichuan Changhong Electric Co Ltd
Original Assignee
Sichuan Changhong Electric 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 Sichuan Changhong Electric Co Ltd filed Critical Sichuan Changhong Electric Co Ltd
Priority to CN2008103014763A priority Critical patent/CN101286114B/en
Publication of CN101286114A publication Critical patent/CN101286114A/en
Application granted granted Critical
Publication of CN101286114B publication Critical patent/CN101286114B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Circuit For Audible Band Transducer (AREA)
  • Stereophonic System (AREA)

Abstract

The invention relates to an audio equipment accessing technique under an embedded operation system. Aiming at the problems caused by the monopoly-typed accessing of audio program on the audio equipment, the invention discloses a method that the audio equipment is shared by multi-program. The technical proposal of the invention is that an audio service module initiates the audio equipment and creates at least two sound data passages which are accessed in a monopoly-type by the audio program; all sound data passages are initiated and sound data is input into the sound data passages by the audio program; whether all sound data passages have the output of sound data or not is circularly detected, if yes, the sound data is read and the audio parameter normalization processing is carried out; if not, whether all sound data passages have the output of sound data or not is continued to be circularly detected; the sound data of all sound data passages are laminated, synchronized and output to the audio equipment. The invention is shared by multi-program is used for the audio equipment of the embedded system and has the beneficial effects that a plurality of programs can be used at the same time and the same audio equipment can be transparently accessed.

Description

The method of multi-program sharing audiofrequency apparatus
Technical field
The present invention relates to the audio devices access technology under the embedded OS environment, particularly a kind of method of a plurality of procedure sharing audio frequency apparatuses.
Background technology
Under embedded OS, audio program all is to monopolize the formula visit to the access mode of audio frequency apparatus, and an audio program has opened audio frequency apparatus, and other audio program all can't open audio frequency apparatus.Audio program can cause to the formula of the monopolizing visit of audio frequency apparatus that a plurality of audio programs can't obtain audio frequency output resource simultaneously in this system, has only current audio program to discharge audio frequency apparatus, and other audio program could visit audio frequency apparatus.
Summary of the invention
Technical matters to be solved by this invention is, provides a kind of and realizes that a plurality of programs visit the method for the multi-program sharing audiofrequency apparatus of audio frequency apparatus simultaneously.
The technical scheme that the present invention solve the technical problem employing is that the method for multi-program sharing audiofrequency apparatus is characterized in that, the audio service module is set, described audio service module execution the following step:
A1, initialization audio frequency apparatus are created at least 2 voice data passages, and audio program's formula of monopolizing is visited described voice data passage;
Whether a2, each voice data passage of cycle detection have voice data output, if then read voice data, and carry out entering step a3 after the audio frequency parameter normalized; Otherwise repeating step a2;
A3, with the synthetic audio frequency apparatus that outputs to of the voice data of each voice data passage stack;
Described voice data passage is carried out the following step:
B1, the initialization of voice data passage;
B2, audio program are to voice data passage input audio data sound.
Further, among the described step a2, the audio frequency parameter normalized is: if the audio device configuration parameter of the channel audio parameter of voice data passage and initialization audio frequency apparatus is inconsistent, then the voice data passage resamples to voice data, makes the channel audio parameter consistent with the audio device configuration parameter;
Further, described voice data passage comprises data field, passage control information district, service control information district, and the voice data of audio program leaves described data field in; Passage unlatching sign, the write information of passage, channel audio parameter leave described passage control information district in; The read message of audio device configuration parameter, passage leaves described service control information district in;
Further, described step b2 comprises the following steps:
1. according to the information decision available data area size in passage control information district and service control information district, audio program imports the data field of the voice data of described available data area size to the voice data passage, and the information in new tunnel control information district more;
2. 1. repeating step is all imported up to all voice datas of audio program and to be finished;
Further, described each voice data passage is execution in step b3 also: judge whether the output of voiceless sound data, if then closing passage is opened sign again;
Described audio service module is also carried out down step a4: open sign according to passage and judge whether to close the voice data passage, if then close, and return step a2.
The invention has the beneficial effects as follows that a plurality of programs can be simultaneously, the same audio frequency apparatus of transparent access, and a middleware that embedded system sound intermediate frequency equipment is shared is provided.
Description of drawings
Fig. 1 is the process flow diagram of the specific embodiment of the invention.
Embodiment
Below in conjunction with embodiment and accompanying drawing, the invention will be further described.
On existing embedded OS basis, increase an audio service module, this audio service module is monopolized the formula visit to audio frequency apparatus.At least 2 voice data passages of audio service module creation, and the data of the voice data passage created are controlled and handle; Audio program monopolizes the formula visit to the voice data passage.The sound interval preface according to the controlled variable of audio service module regularly quantitative to voice data passage input audio data, the audio service module becomes the processing such as synthetic of changing, superpose of the voice data of each voice data passage unified voice data and finally outputs to audio frequency apparatus then.
Referring to Fig. 1, the workflow of audio service module is as follows:
The audio service module starts in advance, initialization audio frequency apparatus (monopolizing the audio frequency apparatus buffer zone).Create voice data passage 1, voice data voice data passage 2 ... voice data passage n, distribute voice data passage 1, voice data passage 2 ... the data field of voice data passage n, passage control information district and service control information district, the information in passage control information district comprises passage unlatching sign, the write information (initial, the current writing data quantity of passage that the current moving window of passage is write) of passage, channel audio parameter (channel data sampling rate, channel data channel number, channel data sample size); The information in service control information district comprises the read message (that the current moving window of service processes is read is initial, the current read data of service processes amount, buffer size) of audio device configuration parameter (device data sampling rate, device data sound channel number, device data sample size), passage, the configuration parameter (device data sampling rate, device data sound channel number, device data sample size) of current audio frequency apparatus is filled up to service control information district, the current moving window of initialization current service process reads to be initiated with 0, and the current read data of service processes amount is 0; Buffer size is the data field size of passage; Passage in the initialization passage control information district is opened and is masked as 0.
The audio service module enters armed state: (passage is opened and is masked as 1, and then expression is opened to open the opening that indicates each voice data passage of cycle detection by the passage in the passage control information district; Passage is opened and is masked as 0, and then expression is not opened.)。If there is the voice data passage to open, then carry out frame output and handle, get back to armed state after finishing; Do not open if there is passage, then stay in armed state; Become 0 if there is the passage of voice data passage to open sign by 1, then remove the information in its passage control information district and service control information district, close this voice data passage, and stay in armed state.The audio service module also can directly directly judge whether to close this voice data passage according to the passage control information district of each voice data passage, the information in service control information district, if fruit is, then remove the information in its passage control information district and service control information district, close this voice data passage, and stay in armed state.When system need close, then the audio service module is closed audio frequency apparatus, and withdraws from.
The voice data passage is carried out frame output to be treated to: if voice data passage 1 is opened, then the service processes moving window is current from the data field of voice data passage 1 reads the data that reference position reads a frame (current writing data quantity of passage and the current reading of data of service processes amount poor is the current data volume that can read for service processes.One frame data acquiescence can be chosen as 2048 bytes, the passage control module is once write 2 frame data at least, be that the moving window size can be chosen as 4096 bytes) to the data buffer of audio service module, and the current read data of update service process amount, read the position that reference position moves to the next frame data with the service processes moving window is current; If the channel audio parameter in the passage control information district of voice data passage 1 is inconsistent with the audio device configuration parameter in the service control information district, then the frame data to voice data passage 1 carry out audio frequency parameter normalizeds such as frequency resampling, make the channel audio parameter consistent with the audio device configuration parameter.The audio service module is whenever read the voice data of the data field of a frame voice data passage, just judges whether it needs to carry out the audio frequency parameter normalized.If the difference of the current writing data quantity of passage of voice data passage 1 and the current reading of data of service processes amount is zero, illustrate that voice data passage 1 is halted state at present, there is not the voice data input, then to produce data all be zero quiet data frame to the audio service module, and this Frame promptly is considered to this input data of voice data passage 1.That reads voice data from voice data passage n is identical with the above-mentioned method that reads voice data passage 1.The voice data passage 1 that the audio service module will have been opened, voice data passage 2 ... the frame data that reach voice data passage n (after the audio frequency parameter normalized) superpose and synthesize a frame voice data, output in the audio frequency apparatus buffer zone and are exported by audio frequency apparatus.If the available sounds data volume of voice data passage is greater than frame data, frame output processing is carried out in circulation so.
Such as the audio service module audio frequency apparatus is initialized to following mode of operation: sampling rate 44.1KHZ, each sample size 16 bit, two-channel; The A of audio program takies voice data passage 1, and the parameter of the voice data that the A of audio program will play is: sampling rate 44.1KHZ, each sample size 16 bit, two-channel; The B of audio program takies voice data voice data passage 2, the parameter of the voice data that the B of audio program will play is: sampling rate 24KHZ, each sample size 16 bit, monophony, so when frame output is handled, voice data to voice data voice data passage 2 carries out the audio frequency parameter normalized: software is re-sampled to 44.1KHZ, duplicates channel data after the sampling, and mono data is synthesized the two-channel data; At last, with the data of voice data passage 1 and the data of the voice data passage 2 after the processing, carry out the add operation stack and overflow processing, deliver to audio frequency apparatus output, what audio frequency apparatus was heard has been exactly the data after two passages stacks are synthesized.
Referring to Fig. 1, the workflow of voice data passage is: the A of audio program visit audio sound data channel 1, audio sound data channel 1 initialization: obtain data field, passage control information district and service control information regional address that the audio service module is distributed for voice data passage 1 in advance, and its channel audio parameter (channel data sampling rate, channel data channel number, channel data sample size) is filled up in the passage control information district of voice data passage 1.The A of audio program to voice data passage 1 input audio data is: the control module of voice data passage 1 is according to the current writing data quantity of the passage of voice data passage 1, service processes current read data amount and channel data district size, calculate voice data passage 1 when prepass moving window available data area size: if the available data area size is greater than zero, then the A of audio program import this available data area size voice data in the buffer zone of the data field of voice data passage 1, and upgrade the current writing data quantity of passage of voice data passage 1, the current moving window of passage is write the initial position that moves to the next frame data; Carry out aforesaid operations repeatedly, these all voice datas that need import up to the A of audio program (data volume of the voice data of general each circulation input is the moving window size, and the sound of can underwriter's ear hearing is continuous) are all imported and are finished.If in the voice data passage 1 again the voiceless sound data need output, then close the passage of voice data passage 1 and open sign, be about to passage and open sign and be made as 0, and write information, the channel audio parameter of passage are removed.If the available data area size, is then represented the audio service module less than zero and also will not work as the voice data output in the prepass moving window that voice data passage 1 enters waiting status, after the wait fixed time (such as 10 milliseconds), reworks.Workflow to voice data passage n input audio data is identical with voice data passage 1.If there is voice data to need output in the voice data passage, then its passage opened sign and be made as 1.
Through experimental verification, the present invention can effectively solve embedded system audio frequency apparatus exclusivity, makes things convenient for transparent share of realization equipment between multiprogram.The invention provides the middleware that an embedded system sound intermediate frequency equipment is shared.
For example, the present invention is applied on the vehicle mounted guidance terminal.Vehicle mounted guidance terminal has the function of voice broadcast road name and music.In the real-time navigation process, open music playback function; The backstage playing back music, foreground show navigator picture, navigation software is when needs are reported voice road name simultaneously, can't need time-out to fall music because of the audio frequency apparatus conflict, play Lu Minghou and recover music again, but share audio frequency apparatus by the present invention, music and voice road name are play to superpose simultaneously and are carried out.In concrete enforcement, 2 voice data passages of audio service module creation again, and define the volume gain function of each voice data passage.Music takies voice data passage 1, voice road name is reported and is taken voice data passage 2, when having only voice data passage 1 or 2 work, the volume of this passage is 100%, when two voice data passages are worked simultaneously, the volume of voice data passage 1 becomes 20%, and the volume of voice data passage 2 is 80%.Though music and voice road name voice data superpose like this, the effect that sounds is that musical sound has gone down for a short time, and the volume that voice road name is reported is just relatively bigger more clear.

Claims (6)

1. the method for multi-program sharing audiofrequency apparatus is characterized in that, the audio service module is set, and described audio service module is carried out the following step:
A1, initialization audio frequency apparatus are created at least 2 voice data passages, and audio program's formula of monopolizing is visited described voice data passage;
Whether a2, each voice data passage of cycle detection have voice data output, if then read voice data, and carry out entering step a3 after the audio frequency parameter normalized; Otherwise repeating step a2;
A3, with the synthetic audio frequency apparatus that outputs to of the voice data of each voice data passage stack;
Described voice data passage is carried out the following step:
B1, the initialization of voice data passage;
B2, audio program are to voice data passage input audio data.
2. the method for multi-program sharing audiofrequency apparatus as claimed in claim 1, it is characterized in that, among the described step a2, the audio frequency parameter normalized is: if the audio device configuration parameter of the channel audio parameter of voice data passage and initialization audio frequency apparatus is inconsistent, then the voice data passage resamples to voice data, makes the channel audio parameter consistent with the audio device configuration parameter.
3. the method for multi-program sharing audiofrequency apparatus as claimed in claim 1 or 2 is characterized in that, described voice data passage comprises data field, passage control information district, service control information district, and the voice data of audio program leaves described data field in; Passage unlatching sign, the write information of passage, channel audio parameter leave described passage control information district in; The read message of audio device configuration parameter, passage leaves described service control information district in.
4. the method for multi-program sharing audiofrequency apparatus as claimed in claim 3 is characterized in that, described step b2 comprises the following steps:
1. according to the information decision available data area size in passage control information district and service control information district, audio program imports the data field of the voice data of described available data area size to the voice data passage, and the information in new tunnel control information district more;
2. 1. repeating step is all imported up to all voice datas of audio program and to be finished.
5. the method for multi-program sharing audiofrequency apparatus as claimed in claim 3 is characterized in that, described each voice data passage is execution in step b3 also: judge whether the output of voiceless sound data, if then closing passage is opened sign again;
Described audio service module is execution in step a4 also: open sign according to passage and judge whether to close the voice data passage, if then close, and return step a2.
6. the method for multi-program sharing audiofrequency apparatus as claimed in claim 3 is characterized in that, described channel audio parameter comprises channel data sampling rate, channel data channel number, channel data sample size; Described audio device configuration parameter comprises device data sampling rate, device data block tone channel number, device data sample size.
CN2008103014763A 2008-05-08 2008-05-08 Method for multi- program sharing audiofrequency apparatus Expired - Fee Related CN101286114B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2008103014763A CN101286114B (en) 2008-05-08 2008-05-08 Method for multi- program sharing audiofrequency apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2008103014763A CN101286114B (en) 2008-05-08 2008-05-08 Method for multi- program sharing audiofrequency apparatus

Publications (2)

Publication Number Publication Date
CN101286114A true CN101286114A (en) 2008-10-15
CN101286114B CN101286114B (en) 2011-09-28

Family

ID=40058336

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2008103014763A Expired - Fee Related CN101286114B (en) 2008-05-08 2008-05-08 Method for multi- program sharing audiofrequency apparatus

Country Status (1)

Country Link
CN (1) CN101286114B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105204816A (en) * 2015-09-29 2015-12-30 北京元心科技有限公司 Method and device for controlling audios in multisystem
CN105980999A (en) * 2014-06-13 2016-09-28 歌乐株式会社 Terminal connection device, processing information execution system, processing information execution method
CN108334302A (en) * 2017-12-26 2018-07-27 努比亚技术有限公司 A kind of sound transmission method, mobile terminal and computer readable storage medium
CN112071338A (en) * 2019-06-10 2020-12-11 海信视像科技股份有限公司 Recording control method and device and display equipment

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105980999A (en) * 2014-06-13 2016-09-28 歌乐株式会社 Terminal connection device, processing information execution system, processing information execution method
US10326842B2 (en) 2014-06-13 2019-06-18 Clarion Co., Ltd. Terminal connection device, processing information execution system, processing information execution method
CN105980999B (en) * 2014-06-13 2020-02-21 歌乐株式会社 Terminal connection device, processing information execution system, and processing information execution method
CN105204816A (en) * 2015-09-29 2015-12-30 北京元心科技有限公司 Method and device for controlling audios in multisystem
CN108334302A (en) * 2017-12-26 2018-07-27 努比亚技术有限公司 A kind of sound transmission method, mobile terminal and computer readable storage medium
CN112071338A (en) * 2019-06-10 2020-12-11 海信视像科技股份有限公司 Recording control method and device and display equipment

Also Published As

Publication number Publication date
CN101286114B (en) 2011-09-28

Similar Documents

Publication Publication Date Title
CN108337601A (en) The control method and device of speaker
CN101286114B (en) Method for multi- program sharing audiofrequency apparatus
US20060168114A1 (en) Audio processing system
CN106897146A (en) The data processing method and the terminal with microphone of a kind of microphone of terminal
CN109032559B (en) Configuration method and system for sharing same recording equipment by multiple applications
CN103226947A (en) Mobile terminal-based audio processing method and device
US11587560B2 (en) Voice interaction method, device, apparatus and server
CN105096981A (en) Multipath sound playing method, multipath sound playing device and multipath sound playing system
CN106528133B (en) Equipment request processing method and device applied to multiple systems
CN108460120A (en) Data save method, device, terminal device and storage medium
CN101140527A (en) Audio driver sound management method
CN106528040A (en) Method and apparatus for improving audio quality of android device
CN108986814A (en) A kind of method and device waking up application service
CN103456330A (en) Audio control method and device
CN104104705B (en) The cut-in method and equipment of distributed memory system
CN110289024A (en) A kind of audio editing method, apparatus, electronic equipment and storage medium
CN103049192A (en) Method and device for opening application programs
JP2020504835A (en) Intelligent preset
CN110022449A (en) A kind of audio and video synthetic method, device, electronic equipment and storage medium
EP3745252B1 (en) Voice control method and apparatus of electronic device, computer device and storage medium
CN113870912A (en) Recording method, device, equipment and storage medium
CN102789795B (en) Method and system used for playing vehicle-mounted compact disc and based on Android operating system
CN111580766B (en) Information display method and device and information display system
CN109040904B (en) Audio playing method and device of intelligent sound box
CN105468360A (en) Third-party audio player oriented data interception method

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
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20110928

Termination date: 20210508