CN1307550C - Method for united controlling sound channel of computer via intermediate hier - Google Patents

Method for united controlling sound channel of computer via intermediate hier Download PDF

Info

Publication number
CN1307550C
CN1307550C CNB2003101023888A CN200310102388A CN1307550C CN 1307550 C CN1307550 C CN 1307550C CN B2003101023888 A CNB2003101023888 A CN B2003101023888A CN 200310102388 A CN200310102388 A CN 200310102388A CN 1307550 C CN1307550 C CN 1307550C
Authority
CN
China
Prior art keywords
channel
state
sound
middle layer
application 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.)
Expired - Fee Related
Application number
CNB2003101023888A
Other languages
Chinese (zh)
Other versions
CN1612106A (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.)
Inventec Corp
Original Assignee
Inventec Corp
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 Inventec Corp filed Critical Inventec Corp
Priority to CNB2003101023888A priority Critical patent/CN1307550C/en
Publication of CN1612106A publication Critical patent/CN1612106A/en
Application granted granted Critical
Publication of CN1307550C publication Critical patent/CN1307550C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Abstract

The present invention relates to a method for united controlling voice frequency channels of a computer through a middle layer, which comprises the following steps: firstly, initializing a sound card, selecting a voice frequency channel to be controlled uniformly, and setting a timer for the selected channel; then, designating a callback function which responses the timer to be a voice frequency control interface for refreshing an application program; finally, monitoring the change of the state of the voice frequency channel of an operating system. As the timer arrives at set time, according to the state of the voice frequency channels of the system, the voice frequency control interface of the application program to refreshed. Because the middle layer is arranged between voice control of the system and the application program, a voice state between the system and other application programs can be kept synchronously by the present invention.

Description

By the method for middle layer to the unified control of computing machine acoustic channel
Technical field
The present invention relates to a kind of control method of computer audio channel, especially about a kind of method of the computer audio channel being unified control by the middle layer.
Background technology
At present, more and more ripe along with multimedia technology, computing machine are strengthening progressively that it is recreational, and not only Video processing is more and more smooth, and is also more and more higher to the requirement of Audio Processing.In order to comply with this trend, except computer operating system is more and more paid attention to the Audio Processing ability, independently Audio Processing application program has appearred accordingly also in a large number.
With regard to computer operating system, no matter be at Windows or under Linux, operating system all provides the interface of control sound size and left and right acoustic channels.But at present a lot of application programs usually can be brought some doubt to the user when regulating sound status.Cite a plain example: a user opens a music player, playing back music.He is set to quiet by system sounds state when leaving.And another user re-uses in this player on this computing machine, he does not also know that the someone has changed system's setting, he can't directly observe the variation of sound status from player, therefore, though he finds that player is in broadcast state, the loudspeaker of computing machine is not but sounded.
The basic reason of this phenomenon is, though the sound status of system has changed, but other application program of this moment also can't be learnt the variation of sound status, therefore caused the sound status of system and the disunity at the sound control interface of application program, this causes suitable doubt to a lot of users.
Have again, continuous enhancing along with the sound card function, its various channels that provide are also in continuous increase, for example: VOL, PCM, CD, BASS, TREBLE, MIC, LINE or the like, and a lot of channels also have the branch of left and right sides balance, therefore application program is in these channels of control, and not having unified access interface can use, especially under (SuSE) Linux OS.If each application program all removes to control sound device by own mode, not only can bring certain exploitation complexity, and might cause the conflict that takies of audio output device.
Summary of the invention
The present invention provides a kind of by the method for middle layer to the unified control of computer audio channel for addressing the above problem, realized between application program and the system sound status synchronously.
The invention provides a kind ofly by the method for middle layer to the unified control of computer audio channel, is to set up a middle layer between operating system and application program, and in order to the state of unified control audio channel, this method comprises the steps: the state of initialization sound card; Select the voice-grade channel of the unified control of desire; For this selected channel is provided with timer; Readjustment (Callback) function (Function) of this timer of response is appointed as refreshes (Refresh) application program audio frequency control interface; The state variation of monitor operating system voice-grade channel; At timer to constantly according to the state refresh application program audio frequency of system audio channel control interface; Wherein said middle layer supplies respectively this application call with the form of shared library, and respectively this application program is read and write the numerical value of specified voice channel and the interface of state by calling an example program.
The present invention is owing to set up a middle layer between system sounds control and each application program, thereby can keep the sound status between system and other application program synchronous, use the present invention can unify calling system sound control mode, simplified sound control interface, and realized that sound status manages automatically, when switching the sound channel state, preserve sound numerical value, be each application program preservation sound channel state and sound numerical value separately, the state and the numerical value of multichannel can also be set simultaneously.
Description of drawings
Fig. 1 is that the present invention is by the method flow diagram of middle layer to the unified control of computer audio channel;
Fig. 2 is an initialization procedure process flow diagram proposed by the invention;
Fig. 3 is an applied environment synoptic diagram of the present invention; And
Fig. 4 is the embodiments of the invention process flow diagrams.
Wherein, description of reference numerals is as follows:
The state of step 101 initialization sound card
Step 102 is selected the voice-grade channel of the unified control of desire
Step 103 is provided with timer for this selected channel
The call back function that step 104 will respond this timer is appointed as and is refreshed application program audio frequency control interface
The state variation of step 105 monitor operating system voice-grade channel
Step 106 arrives constantly at timer and controls the interface according to the state refresh application program audio frequency of system audio channel
Step 201 is opened sound card equipment, checks the support situation of sound card to each sound channel
Step 202 is judged the state of each sound channel, writes down current sound numerical value
Step 203 is set the state and the volume numerical value of each sound channel
Step 401 is opened sound card equipment, checks the support situation of sound card to each sound channel
Step 402 is judged the state of each sound channel, writes down current sound numerical value
Step 403 keeps the state and the volume numerical value of each sound channel, and it is normal setting PCM sound channel state, and volume is set to the numerical value of last record
Timer that is spaced apart 1 second of step 404 registration, the acoustic channel of specified response timer is the PCM channel simultaneously, call back function is appointed as player sound control interface refreshes function
Whether step 405 monitoring system sound status changes
Step 406 judges whether the channel that changes is the channel of having registered timer
Step 407 is called the call back function of registering, and refreshes controls such as the control of player interface volume scroll bar, left and right acoustic channels balance strip and mute option
Whether step 408 inquiry timer is stopped
Step 409 process ends
Embodiment
The invention provides a kind of by the method for middle layer to the unified control of computer audio channel, be between operating system and application program, to set up a middle layer, in order to the state of unified control audio channel, as shown in Figure 1, this method comprises the steps: the state (step 101) of initialization sound card; Select the voice-grade channel (step 102) of the unified control of desire; For this selected channel is provided with timer (step 103); The call back function of this timer of response is appointed as refreshes application program audio frequency control interface (step 104); The state variation (step 105) of monitor operating system voice-grade channel; At timer to constantly according to the state refresh application program audio frequency of system audio channel control interface (step 106).
As shown in Figure 2, this initialization step comprises: open sound card equipment, check the support situation (step 201) of sound card to each sound channel; Judge the state of each sound channel, write down current sound numerical value (step 202); Set the state and the volume numerical value (step 203) of each sound channel.
The step of the state of above-mentioned each sound channel of setting can be the state that keeps each sound channel.That the state of each sound channel can be set at is invalid, normal, L channel, R channel and quiet etc.These voice-grade channels can comprise VOL, PCM, CD, BASS, TREBLE, MIC and LINE or the like.
The sound numerical value of current left and right acoustic channels can be preserved before the state of L channel and R channel switches automatically, when the sound channel state switches back, the numerical value of this preservation can be recovered automatically.
The step of the volume numerical value of above-mentioned each sound channel of setting can be the numerical value that is set to last record.
The present invention has set up a middle layer between system sounds control and application program, as shown in Figure 3, sound key-course of the present invention supplies each application call with the form of shared library, and each application program is read and write the numerical value of specified voice channel and the interface of state by calling (Call) its example (Instance).
Seeing also Fig. 4, is example with audio player control PCM, MIC channel, and implementation procedure of the present invention is described.At first open sound card equipment, check the support situation (step 401) of sound card each sound channel; Judge the state of each sound channel, write down current sound numerical value (step 402); The state and the volume numerical value that keep each sound channel, it is normal setting PCM sound channel state, volume is set to the numerical value (step 403) of last record; Register a duration and be 1 second timer, the acoustic channel of specified response timer is the PCM channel simultaneously, call back function is appointed as player sound control interface refreshes function (step 404); Monitoring system sound status whether change (step 405) then; If change, judge then then whether the channel that changes is the channel (step 406) of having registered timer; If this channel then calls the call back function of registering, refresh controls (Control) (step 407) such as the control of player interface volume scroll bar, left and right acoustic channels balance strip and mute option; If system sounds does not change, perhaps the acoustic channel of Bian Huaing is not an acoustic channel of having registered timer, then do not do action, after 1 second time interval, whether the inquiry timer is stopped (step 408), if do not stop, then continuing the monitoring system sound variation, if timer has stopped, process ends (step 409) then.
The above is preferred embodiment of the present invention only, is not to be used for limiting practical range of the present invention; All equalizations of doing according to description of the present invention change and modify, and are claim of the present invention and contain.

Claims (9)

1, a kind of by the method for middle layer to the unified control of computer audio channel, be between operating system and application program, to set up a middle layer, the state in order to unified control audio channel is characterized in that this method comprises the steps:
The state of initialization sound card;
Select the voice-grade channel of the unified control of desire;
For this selected channel is provided with timer;
The call back function of this timer of response is appointed as refreshes application program audio frequency control interface;
The state variation of monitor operating system voice-grade channel; And
At timer to constantly according to the state refresh application program audio frequency of system audio channel control interface;
Wherein said middle layer supplies respectively this application call with the form of shared library, and respectively this application program is read and write the numerical value of specified voice channel and the interface of state by calling an example program.
2, as claimed in claim 1 by the method for middle layer to the unified control of computer audio channel, it is characterized in that this initialization step comprises:
Open sound card equipment, check the support situation of sound card each sound channel;
Judge the state of each sound channel, write down current sound numerical value; And
Set the state and the volume numerical value of each sound channel.
3, as claimed in claim 2ly it is characterized in that by the method for middle layer to the unified control of computer audio channel this sets the step of the state of each sound channel, can be the state that keeps each sound channel.
4, as claimed in claim 2ly it is characterized in that by the method for middle layer this sets the step of the state of each sound channel, can be set at invalid, normal, L channel, R channel and mute state the unified control of computer audio channel.
5, as claimed in claim 4 by the method for middle layer to the unified control of computer audio channel, it is characterized in that, before switching, this L channel and R channel state can preserve the sound numerical value of current left and right acoustic channels automatically, when the sound channel state switches back, can recover the numerical value of this preservation automatically.
6, as claimed in claim 2ly it is characterized in that by the method for middle layer the step that this sets the volume numerical value of each sound channel can be the numerical value that is set to last record to the unified control of computer audio channel.
7, as claimed in claim 1ly it is characterized in that the time that the time interval of this timer can respond as required and automatic setting by the method for middle layer to the unified control of computer audio channel.
8, as claimed in claim 1ly it is characterized in that by the method for middle layer the step that this refreshes application program audio frequency control interface is on the relevant control of the present application program of change list of system audio state to the unified control of computer audio channel.
9, as claimed in claim 1 by the method for middle layer to the unified control of computer audio channel, it is characterized in that this voice-grade channel comprises VOL, PCM, CD, BASS, TREBLE, MIC and LINE.
CNB2003101023888A 2003-10-27 2003-10-27 Method for united controlling sound channel of computer via intermediate hier Expired - Fee Related CN1307550C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2003101023888A CN1307550C (en) 2003-10-27 2003-10-27 Method for united controlling sound channel of computer via intermediate hier

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2003101023888A CN1307550C (en) 2003-10-27 2003-10-27 Method for united controlling sound channel of computer via intermediate hier

Publications (2)

Publication Number Publication Date
CN1612106A CN1612106A (en) 2005-05-04
CN1307550C true CN1307550C (en) 2007-03-28

Family

ID=34756392

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2003101023888A Expired - Fee Related CN1307550C (en) 2003-10-27 2003-10-27 Method for united controlling sound channel of computer via intermediate hier

Country Status (1)

Country Link
CN (1) CN1307550C (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002369154A (en) * 2001-04-02 2002-12-20 Matsushita Electric Ind Co Ltd Image playback equipment for digital image contents, image playback method, image playback program, and package media
WO2003005190A1 (en) * 2001-07-06 2003-01-16 E-Genie Australia Pty Limited Method and system for computer software application execution
CN1424684A (en) * 2002-12-23 2003-06-18 南京大学 Method and device for computer aided electroacoustic device power load test

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002369154A (en) * 2001-04-02 2002-12-20 Matsushita Electric Ind Co Ltd Image playback equipment for digital image contents, image playback method, image playback program, and package media
WO2003005190A1 (en) * 2001-07-06 2003-01-16 E-Genie Australia Pty Limited Method and system for computer software application execution
CN1424684A (en) * 2002-12-23 2003-06-18 南京大学 Method and device for computer aided electroacoustic device power load test

Also Published As

Publication number Publication date
CN1612106A (en) 2005-05-04

Similar Documents

Publication Publication Date Title
US8873771B2 (en) Automatic volume adjustment
KR20020027179A (en) Audio apparatus, audio volume control method in audio apparatus, and computer apparatus
CN109032559B (en) Configuration method and system for sharing same recording equipment by multiple applications
DK0786122T3 (en) Digital, intelligent audio-visual reproduction system
JP2003087889A (en) Sound system and method
CN104199633B (en) Multimedia play equipment, player automatic identification equipment and method
CN107799113B (en) Audio processing method and device, storage medium and mobile terminal
KR100783113B1 (en) Method for shortened storing of music file in mobile communication terminal
CN107547732A (en) A kind of media play volume adjusting method, device, terminal and storage medium
US7966085B2 (en) Audio source system and method
CN101093719B (en) Method for protecting hearing ability, and audio playing system with function of protecting hearing ability
JP4347292B2 (en) Audio equipment
WO2006080692A1 (en) Method and mobile communication terminal for playing multimedia content
CN1307550C (en) Method for united controlling sound channel of computer via intermediate hier
KR102110515B1 (en) Hearing aid device of playing audible advertisement or audible data
KR19990040286A (en) Image playback device with screen mute function and screen mute method accordingly
JP2004178558A (en) Computer system and its control method
JP4834146B2 (en) Sound field reproduction apparatus and sound field reproduction method
CN106293607B (en) Method and system for automatically switching audio output modes
WO2002047354A3 (en) Method and device for controlling the transmission and playback of digital signals
JP7178537B2 (en) Playback update method, device and storage medium
CN113778372B (en) Medical care advertising machine double-sound card switching method
JP2001024786A (en) Call-holding device for telephone set and advertising method using the device
JP4985562B2 (en) Recording apparatus, method and program
JP2002176405A (en) Method for generating broadcast program in business broadcast system

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

Granted publication date: 20070328

Termination date: 20101027