WO2015074548A1 - Method for sound control in browser, and browser - Google Patents

Method for sound control in browser, and browser Download PDF

Info

Publication number
WO2015074548A1
WO2015074548A1 PCT/CN2014/091469 CN2014091469W WO2015074548A1 WO 2015074548 A1 WO2015074548 A1 WO 2015074548A1 CN 2014091469 W CN2014091469 W CN 2014091469W WO 2015074548 A1 WO2015074548 A1 WO 2015074548A1
Authority
WO
WIPO (PCT)
Prior art keywords
webpage
sound
label
browser
tag
Prior art date
Application number
PCT/CN2014/091469
Other languages
French (fr)
Chinese (zh)
Inventor
耿兆贺
熊鹏
任寰
Original Assignee
北京奇虎科技有限公司
奇智软件(北京)有限公司
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 北京奇虎科技有限公司, 奇智软件(北京)有限公司 filed Critical 北京奇虎科技有限公司
Publication of WO2015074548A1 publication Critical patent/WO2015074548A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/16Sound input; Sound output
    • G06F3/165Management of the audio stream, e.g. setting of volume, audio stream path
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation

Definitions

  • the present invention relates to the field of computer network technologies, and in particular, to a method and a browser for performing sound control in a browser.
  • a web browser is an application that displays files within a web server or file system and lets users interact with them.
  • the content presented by web pages is more and more abundant.
  • web pages can also present information with sound, such as music files, multimedia files, and so on.
  • the sound control of the webpage in the browser is realized by the webpage mute button in the browser, and the button is added in the status bar of the browser, and the sound data outputted by the browser to the sound card is shielded, thereby realizing All browser sound data is not played.
  • the mute function of the existing browser webpage is to turn off the sound of all the browser tabs, that is, all the sound output in the webpage process is closed, so that the user can not obtain any sound data; or the sound of all the tabs It does not turn off. If there is audio data in multiple tags that need to be played, the sounds will be mixed together, affecting the original sound playback in each tag.
  • the present invention has been made in order to provide a method and corresponding browser for performing sound control in a browser that overcomes the above problems or at least partially solves or alleviates the above problems.
  • a method for sound control in a browser comprising: creating a webpage tag in a browser, and creating a tag process independent of a main process of the browser for the webpage tag; creating a webpage The mapping relationship between the label and the label process, and the mapping relationship is saved in the main process to control the sound in the webpage label in the display interface of the main process; and the sound control instruction input through the display interface of the main process is sent to the label
  • the process controls the sound in the webpage tag through the audio application interface in the webpage tag according to the sound control command.
  • a browser comprising:
  • the mapping unit is adapted to establish a mapping relationship between the webpage label and the labeling process, and save the mapping relationship in the main process to control the sound in the webpage label in the display interface of the main process;
  • a sending unit configured to send a sound control instruction input through a display interface of the main process to the label process
  • the control unit is adapted to control the sound in the webpage label through the audio application interface in the webpage tag according to the sound control instruction.
  • the embodiment of the present invention separates different webpage label processes by establishing a technical process of a label process independent of the main process of the browser, thereby avoiding the influence of the sound control of one webpage on the sound state of other webpages, and ensuring that each The sounds in the webpages are individually controlled; and the embodiment of the present invention provides a specific implementation manner of sound control in a single webpage by receiving sound control commands through the display interface of the main process and calling the technical means of the corresponding audio application interface.
  • the technical solution can separately control the sound of each browser tab, thereby improving the performance and user experience of the browser.
  • a computer program comprising computer readable code, when the computer readable code is run on a computing device, causing the computing device to perform the browsing described in any of the above The method of sound control in the device.
  • a computer readable medium wherein the computer program described above is stored.
  • FIG. 1 is a schematic structural diagram of an apparatus for performing sound control in a browser according to an embodiment of the present invention
  • FIG. 2 is a flowchart showing a process of a method for performing sound control in a browser according to an embodiment of the present invention
  • FIG. 3 is a flow chart showing specific steps of a process of finding a page where a web page tag is located, in accordance with one embodiment of the present invention
  • FIG. 4 is a flowchart showing a process of controlling sound in a first web page tag according to an embodiment of the present invention
  • FIG. 5 is a flow chart showing the opening of a webpage according to an embodiment of the present invention.
  • FIG. 6 is a flowchart showing a process of a user performing a mute operation on a webpage by clicking a control icon according to an embodiment of the present invention
  • FIG. 7 is a diagram showing information for displaying a plurality of web page tags in a floating window according to an embodiment of the present invention.
  • FIG. 8 is a diagram showing control information for displaying a sound file in a floating window according to an embodiment of the present invention.
  • FIG. 9 is a flow chart showing a method for performing sound control in a browser according to still another embodiment of the present invention.
  • FIG. 10 is a flow chart showing a method for performing sound control in a browser according to still another embodiment of the present invention.
  • FIG. 11 is a schematic structural diagram of a browser according to still another embodiment of the present invention.
  • Figure 12 is a schematic illustration of a computing device for performing a method of sound control in a browser in accordance with the present invention Prepared block diagram
  • Fig. 13 schematically shows a storage unit for holding or carrying program code for implementing a method of sound control in a browser according to the present invention.
  • FIG. 1 is a block diagram showing the structure of an apparatus for performing sound control in a browser according to an embodiment of the present invention.
  • the apparatus for performing sound control in the browser includes at least an establishing module 110, a searching module 120, and a control module 130.
  • the architecture and functions of each of the above modules are described in detail.
  • the building module 110 is introduced.
  • the browser can open multiple webpages at the same time, each webpage will create a webpage label accordingly, and in the background, each webpage will have a corresponding process. Therefore, the creation module 110 can be used to create a webpage label and establish a mapping relationship between the webpage label and the page process where the webpage label is located.
  • the lookup module 120 is introduced. Referring to FIG. 1, the lookup module 120 is coupled to the setup module 110.
  • the user opens a plurality of webpage tabs at the same time, if the sound of one of the webpage tabs is selected for control, an instruction to control the sound in the webpage tab is issued.
  • a first webpage label in order to distinguish the webpage label selected by the user and to be controlled by the sound, it may be referred to as a first webpage label.
  • the first is only used as a distinguishing identifier, and has no meaning to the webpage label and the corresponding webpage itself.
  • the searching module 120 may find the page process where the first webpage label is located according to the mapping relationship between the established webpage label and the page process.
  • control module 130 is introduced. Referring to FIG. 1, control module 130 is coupled to lookup module 120. After the search module 120 finds the page process of the first webpage tag, the control module 130 controls the sound in the first webpage tag by using the found page process of the first webpage tag.
  • the sound of the webpage label may be controlled by using the page process of each webpage label separately, instead of all the webpage labels by a unified mute function or function.
  • the sound in the control is unified. It can be seen that the embodiment of the present invention can separately control the sound in each webpage label, improve the accuracy of the webpage sound control, and improve the user's feeling experience.
  • the above mentioned building module 110 is capable of establishing a mapping relationship between a web page tag and a page process where the web page tag is located.
  • mapping methods used in the mapping relationship, for example, random mapping, digital mapping, sort mapping, etc.
  • the mapping elements used may also be various, such as keywords, weights, and the like.
  • a preferred mapping relationship is provided, that is, a mapping relationship between a webpage label identifier (ID) and a page process ID where the webpage label is located is established.
  • the establishing module 110 can establish a mapping relationship between the webpage label and the page process where the webpage label is located when the webpage process in which the webpage label is located is created.
  • the search module 120 receives the sound control instruction input by the user for the first webpage label in the first webpage label, where the sound control instruction includes the first webpage label Sign the ID. Then, the search module 120 searches the mapping relationship between the established webpage label and the page process according to the first webpage label ID, obtains the ID of the page process corresponding to the first webpage label, and notifies the ID of the page process to the ID of the page process. Control module 130.
  • control module 130 After learning the ID of the page process, the control module 130 searches for the corresponding page process according to the ID of the page process corresponding to the first webpage tag. Further, the control module 130 controls the sound in the first webpage tag through the sound API (Application Program Interface) function of the operating system in the page process.
  • sound API Application Program Interface
  • the device for performing sound control in the browser may further set a window generating module 140 coupled to the searching module 120 for generating a floating window.
  • the window generating module 140 may generate a floating window prompting for sound control at a label header of the first webpage label or a webpage element of the first webpage that generates sound, wherein the floating window is loaded with An entry to receive an instruction to control the sound in the first web page tag.
  • the user can issue an instruction to control the sound in the first webpage tab at the floating window, and the window generation module 140 receives the corresponding instruction and transfers it to the lookup module 120 for subsequent processing.
  • Floating windows have certain advantages over control icons set on the page. Floating windows can float on a specific page or float on all pages, even if the first page that is open is not required for sound control.
  • the label can also control the sound in the first webpage label, making the control of the sound more convenient and quick.
  • the sound in the first webpage label includes a plurality of sounds, such as the sound generated by the video plug-in in the webpage, and the sound generated by the audio plug-in, for example. , or both, and so on.
  • Multiple plugins can sound at the same time in a web page tag.
  • control module 130 controls the sound in the first webpage tab
  • at least one of the following operational controls may be performed:
  • the prompting module 150 can be set in the device for performing sound control in the browser, and The establishing module 110 is coupled to provide a prompt for the webpage label in which the sound data exists after each webpage label and the corresponding process are established. It should be noted that there may be multiple prompting manners herein, and the webpage label with the sound data may be identified.
  • the webpage label with the sound data may be prompted by the highlighting of the label item, or
  • the webpage label with the sound data is prompted by the background color of the label item, and the webpage label with the sound data can be prompted by using the title font size, color, and the like of the label item, and the like. Since the highlighting effect is more obvious, it is preferable to prompt by means of highlighting the label item.
  • display module 160 is coupled to window generation module 140 and lookup module 120, respectively.
  • the display module 160 may display information of the sound data in the plurality of webpage tags in a floating window.
  • the display module 160 may also display information of the plurality of sound data that the first webpage label exists at the same time in a floating window. The information of multiple sound data is presented in a floating window, and the information is centrally managed, which is convenient for the user to select according to needs and improve the efficiency of sound control.
  • the display module 160 can display any information of the sound file or the sound data on the floating window, and generally preferably displays the following information:
  • the sound data still has other information that can play a certain role in the user's selection, other information such as the remaining playing time of the sound data can also be displayed.
  • control module 130 can select to control the sound in the first webpage label in the floating window.
  • different icon buttons may be set in the floating window according to different operations on the sound data, for example, a start icon, a pause icon, a stop icon, an acceleration icon, a slow icon, and the like may be set.
  • the user can click the icon to achieve the purpose.
  • the display module 160 can display the currently processed web page tag in a plurality of web page tags. This sorting method is beneficial for improving the control efficiency of the sound data and reducing the waste of time caused by finding the webpage where the sound data is located. For example, the user closes the sound file in the first web page tab, and the display module 160 sorts the web page label to the first position displayed by the browser. Subsequently, if the user wants to open the sound file, the first webpage label can be directly opened, and no one webpage label is needed to search, so as to improve the control efficiency of the sound data.
  • control module 130 may also provide other information in the floating window, for example, may provide a recommended link of the audio/video file that has not been muted or has been muted, and for example, may also provide Links to search tools related to audio/video files.
  • the provision of these other information may be analyzed by the browser according to the information related to the user's selection of the sound file, or may be analyzed by the browser according to the usual browsing history of the user.
  • the information of the sound file controlled in the first webpage tab may be saved in the saving module 170.
  • the saving module 170 may also save the saved sound file information as part of the browser user information on the local side of the browser, or Synchronize it on the network side. If it is saved on the network side, when the corresponding information is extracted again, the browser needs to obtain the related information stored on the network side first, and then open and perform subsequent control operations.
  • the embodiment of the present invention further provides a method for performing sound control in a browser, and the implementation of the method is based on the device for performing sound control in the browser provided in any one of the above embodiments.
  • 2 is a process flow diagram of a method of sound control in a browser in accordance with one embodiment of the present invention. The method includes steps S202 to S206.
  • Step S202 Create a webpage label, and establish a mapping relationship between the webpage label and the page process where the webpage label is located.
  • Step S204 When receiving an instruction input by the user to control the sound in the first webpage label, according to the mapping relationship between the established webpage label and the page process, the page process where the first webpage label is located is found.
  • Step S206 Control the sound in the first webpage label in the page process of the found first webpage label.
  • the sound of the webpage label may be controlled by using the page process of each webpage label separately, instead of all the webpage labels by a unified mute function or function.
  • the sound in the control is unified. It can be seen that the embodiment of the present invention can separately control the sound in each webpage label, improve the accuracy of the webpage sound control, and improve the user's feeling experience.
  • step S202 refers to establishing a mapping relationship between a webpage label and a page process where the webpage label is located.
  • mapping methods used in the mapping relationship, for example, random mapping, digital mapping, sort mapping, etc.
  • the mapping elements used may also be various, such as keywords, weights, and the like.
  • a preferred mapping relationship is provided, that is, a mapping relationship between a webpage label identifier (ID) and a page process ID where the webpage label is located is established.
  • ID webpage label identifier
  • the mapping relationship between the webpage label and the page process where the webpage label is located can be established synchronously.
  • step S204 the specific step of receiving the user-input command to control the sound in the first webpage label and searching for the page process where the first webpage label is located may be referred to in step S204.
  • Step S302 receiving, in the first webpage label, a sound control instruction input by the user for the first webpage label, where the sound control instruction includes a first webpage label ID;
  • Step S304 Perform a search in a mapping relationship between the established webpage label and the page process according to the first webpage label ID.
  • Step S306 Obtain an ID of a page process corresponding to the first webpage label.
  • step S206 is triggered.
  • step of controlling the sound in the first webpage label in the page process of the first webpage label that is found please refer to FIG. 4, including steps S402 to S404.
  • step S402 the ID of the page process corresponding to the first webpage label is obtained according to the search, and the corresponding page process is found.
  • Step S404 Control the sound in the first webpage label through the sound API function of the operating system in the found page process.
  • a floating window prompting for sound control may be generated at a label head of the first webpage label or a webpage element of the first webpage label that generates sound.
  • the floating window is loaded with an entry for receiving an instruction to control the sound in the first webpage label.
  • Floating windows have certain advantages over control icons set on the page. Floating windows can float on a specific page or float on all pages, even if the first page that is open is not required for sound control.
  • the label can also control the sound in the first webpage label, making the control of the sound more convenient and quick.
  • the sounds in the first webpage label include various types, such as sounds generated by video plug-ins in webpages, such as sounds generated by audio plug-ins, or sounds generated simultaneously, and the like. Multiple plugins can sound at the same time in a web page tag.
  • the sound in the first webpage label is controlled, including at least one of the following operational controls:
  • a prompt is provided for the webpage tag in which the sound data exists.
  • the webpage label with the sound data may be identified.
  • the webpage label with the sound data may be prompted by the highlighting of the label item, or
  • the webpage label with the sound data is prompted by the background color of the label item, and the webpage label with the sound data can be prompted by using the title font size, color, and the like of the label item, and the like. Since the highlighting effect is more obvious, it is preferable to prompt by means of highlighting the label item.
  • the advantage of the floating window can be fully utilized in order to facilitate the user to select a file that generates sound and control in time.
  • sound data is simultaneously present in a plurality of webpage tags
  • information of the sound data in the plurality of webpage tags is displayed in a floating window.
  • the first webpage label has a plurality of sound data at the same time
  • the information of the plurality of sound data that the first webpage label exists at the same time may be displayed in a floating window.
  • the information of multiple sound data is presented in a floating window, and the information is centrally managed, which is convenient for the user to select according to needs and improve the efficiency of sound control.
  • any information of the sound file or the sound data can be displayed on the floating window, and the following information is usually preferably displayed:
  • the sound data still has other information that can play a certain role in the user's selection, other information such as the remaining playing time of the sound data can also be displayed.
  • the currently processed web page tag can be displayed in front of the plurality of web page tags.
  • This sorting method is beneficial for improving the control efficiency of the sound data and reducing the waste of time caused by finding the webpage where the sound data is located. For example, the user closes the sound file in the first web page tab and sorts the web page label to the first place displayed by the browser. Subsequently, if the user wants to open the sound file, the first webpage label can be directly opened, and no one webpage label is needed to search, so as to improve the control efficiency of the sound data.
  • a recommended link of the audio/video file that is not muted or muted may be provided, and for example, may also be provided for audio/video.
  • File related search tool links may be analyzed by the browser according to the information related to the user's selection of the sound file, or may be analyzed by the browser according to the usual browsing history of the user.
  • the information of the sound file controlled in the first webpage label may be saved.
  • the information of the saved sound file may be saved as a part of the browser user information on the local side of the browser, or may be performed. Synchronization on the network side. If it is saved on the network side, when the corresponding information is extracted again, the browser needs to obtain the related information stored on the network side first, and then open and perform subsequent control operations.
  • the system sound can be controlled by using the new Core Audio APIs function in Windows.
  • the application can control the sound behavior through this set of API functions, such as playing music and muting.
  • the process when the process is the basic unit (each web page label corresponds to one process), the process can contain multiple sound channels (correspondingly, there may be multiple sound files or sound data in each web page label). If you mute a process, it will not sound from all of the sound channels it contains. For example, a web page tag can play both flash and mp3 music, which includes two sound channels. If you mute this process, there is no sound in both flash and mp3.
  • the browser is first set up, and the web pages in each web page tab are opened in a separate process.
  • a new process is created.
  • the newly opened web page is located in a new tab with an id as the identifier, referred to as "tag ID" or "tabid”.
  • process_id When the process is created, note the correspondence between the process ID (process_id) and the tag ID.
  • the data structure is: [ ⁇ tabid:process_id ⁇ , ⁇ tabid:process_id ⁇ ...]
  • process_id When the user chooses to mute a webpage tab, the process_id is found according to the tabid, and the process_id is passed to the operating system's API function MuteProcess(process_id) to achieve the purpose of muting.
  • the process of opening the webpage includes steps S502 to S506.
  • Step S502 opening a new webpage, and creating a new webpage label
  • Step S504 creating a new webpage process for the webpage
  • Step S506 recording the tabid of the webpage label and the process_id of the webpage process and the mapping relationship between the two.
  • Step S602 the user selects to mute a certain webpage, and finds an ID of the corresponding webpage label
  • Step S604 searching for the process ID according to the tag ID, and then finding the corresponding process
  • Step S606 Calling the system API to mute the process.
  • FIG. 7 shows a schematic diagram of displaying information of a plurality of web page tags in a floating window in accordance with one embodiment of the present invention.
  • the current webpage is labeled with the home page of Baidu website, and the other webpage label is the webpage of the flash video plug-in that plays "Diagram 2", and another webpage label is playing "The Cost of Love”.
  • the browser recognizes the identification of the plugin that may play the sound file in the loaded webpage, such as the loading of the Flash plugin or the loading of the MP3 audio plugin (can be called according to the called
  • the CLSID of the plugin is installed to identify which plugin is called, thereby obtaining related description information of the audio, video or game webpage played by the plugin, such as the name, category, and singer information of the sound file.
  • a floating window also called a pop-up window
  • three sound files are displayed in the pop-up window.
  • the first one is "Diagram 2" Flash video
  • the second is the mp3 file "The Cost of Love”
  • the third is the game "Imperial Age”. See Figure 7 for details.
  • the checked file will be muted, that is, the sound related to the page label. Will be muted.
  • a control button or icon of each sound file can be set, such as the open or close logo in FIG. 7, and clicking the logo enables the sound of the corresponding sound file to be turned on or off.
  • the webpage containing the mute or unmute is changed into the current webpage label, and the webpage label header is highlighted.
  • the sound file and the control icon in FIG. 7 are enumerated, and the specific web page label and the sound file on the opposite side are not limited.
  • the number of sound files depends on the number of open webpage tags, which can be four or more.
  • the control icon can also include other identifications, such as adjusting the volume level identification, playing the identification, and the like.
  • the trigger condition shown in Figure 7 for the floating window to appear on the page may be that the user clicks on the sound symbol in the browser status bar (usually appears as a horn in the status bar).
  • other trigger conditions can also occur, such as clicking on a file plugin or other plugin. It can also be set to automatically appear when you open a web page label each time.
  • the mute processing for the sound in the above embodiment is performed using the solution in the foregoing embodiment of the present invention, and details are not described herein.
  • the specified page can be directly opened through the interface shown in FIG. 7 above, so that the user can directly open the webpage with sound in a plurality of webpage notes, for example, the label is placed high. Brightly displayed, so that users can not find it in many webpage tags.
  • the title of the webpage label and the sound played by the webpage may also be included.
  • the type of the file, the name of the sound file, etc. can be obtained from the web page label.
  • FIG. 8 shows a schematic diagram of control information for displaying a sound file in a floating window in accordance with one embodiment of the present invention.
  • the control information can be integrated into the existing plug-in of the browser, or a new plug-in can be generated in the browser for implementing the control information.
  • this example is implemented by integrating control information into an existing plug-in of the browser.
  • the control information of the sound file is presented in the pop-up window.
  • Baidu's music box which is playing the song of "Never Treatment” by Ren Xianqi through the MP3 player plug-in.
  • the MP3 player plug-in is loaded (see Figure 7 for details).
  • the song name, the singer information, the current web page title information, and the like of the played music are acquired.
  • the sound file is the mp3 file of Ren Xianqi's "Never Treatment".
  • the information of the sound file can be obtained from the webpage label, such as the author, the album, the file type, the duration, and so on.
  • the control information may preferably include a start, a louder sound, a smaller sound, and a mute option, the given link triggering an API that generates a corresponding command for the sound control in the current web page process and concurrently to the browser side.
  • the function performs corresponding sound control.
  • FIG. 8 although there is no sound file in the current webpage label, when right-clicking in the current webpage tab, the information of the file having the sound playing in all the webpage tabs can be viewed, and the corresponding control operation can be performed. .
  • the current webpage label can also carry a sound file, and will not be described here. It should be noted that, similar to FIG. 7, FIG.
  • FIG. 8 is only a schematic diagram. If other sound files exist in the browser, related information of other sound files and corresponding control information may also be displayed in the floating window, that is, Floating windows can control the sound playback of multiple sound files in a web page tag, or control the sound playback of sound files in multiple web page tags.
  • the control processing for the sound in the above embodiment is performed using the solution in the foregoing embodiment of the present invention, and details are not described herein.
  • FIG. 8 also illustrates providing some links related to the controlled sound file in the floating window, such as the recommendation of other songs of Ren Xianqi, which may be actively recommended by the server side corresponding to the browser.
  • a search box of a song ie, a commonly used search engine
  • this embodiment adds a function of separately controlling the mute of the webpage, thereby improving the user experience.
  • the sound of the webpage label may be controlled by using the page process of each webpage label separately, instead of all the webpage labels by a unified mute function or function.
  • the sound in the control is unified. It can be seen that the embodiment of the present invention can separately control the sound in each webpage label, improve the accuracy of the webpage sound control, and improve the user's feeling experience.
  • a further embodiment of the present invention provides a method for performing sound control in a browser, which implements a tab-based scheme for separately controlling sounds in different labels. Referring to FIG. 9, the method includes the following steps:
  • S900 Create a web page tag in the browser and create a tag process for the web page tag that is independent of the browser's main process.
  • a notification is generated for generating a page.
  • the notification of the page creation is intercepted, and an independent process is created for each webpage label of the browser.
  • the method before creating a label process independent of the main process of the browser for the webpage label, the method further includes: identifying whether the created webpage label includes an audio/video file, and if so, creating a The browser's main process is a separate tag process. If not, a tag process that is independent of the browser's main process is not created for the web page tag. This type of processing, for web pages that do not contain audio and video files, is not loaded in a separate process, so as to avoid too many processes starting in the browser and reduce the efficiency of the browser.
  • the foregoing creating a webpage label in the browser includes:
  • the browser user is sent a prompt message to enter the silent mode, or the display interface of the main process is set to enter the mute control interface.
  • S902 Establish a mapping relationship between the webpage label and the labeling process, and save the mapping relationship in the main process to control the sound in the webpage label in the display interface of the main process.
  • establishing a mapping relationship between the label process identifier (ID) and the title of the webpage label in this manner, the label process ID and the title of the webpage label are saved in the main process; In this manner, the mapping relationship between the label process ID and the title of the webpage label and the URL (Uniform Resource Locator) is established. In this manner, the label process ID, the title of the webpage label, and the URL are saved in the main process. in.
  • S904 Send a sound control instruction input through the display interface of the main process to the label process.
  • the sound control command includes at least a sound control command for prohibiting sound output in the web page tab and a sound control command for instructing sound output in the web page tab.
  • the call of the webpage label to the audio application interface is intercepted according to the sound control instruction to prohibit the output of the sound in the webpage label, that is, the sound signal is prohibited from being transmitted to the sound card; and/or, according to the sound control instruction, the webpage label is allowed to interface with the audio application.
  • the operation of allowing the webpage tag to call the audio application interface in one case, the webpage tag is allowed to call the audio application interface to output the sound according to the sound control instruction when the newly opened webpage tag is loaded, and the other case is After the sound in the webpage tag is intercepted, the interception operation is cancelled according to the sound control instruction, and the call to the audio application interface is resumed.
  • S906 Control the sound in the webpage label through the audio application interface in the webpage label according to the sound control instruction.
  • the foregoing audio application interface includes at least one interface function as follows:
  • WaveOutWrite interface function midi stream output interface (midiStreamOut) interface function, client audio rendering (IAudioRenderClient) interface function, audio creation (DirectSoundCreate) interface function and audio creation 8 (DirectSoundCreate8) interface function.
  • the waveOutWrite interface function can send a data to the waveform audio output device, as shown in the following code:
  • the parameter hwo represents the handle of the waveform audio output device
  • the parameter pwh points to the WAVEHDR structure pointer
  • the parameter cbwh represents the size of the WAVEHDR structure.
  • MMSYSERR_NOERROR is returned when the function call succeeds.
  • the values returned on failure are shown in Table 1 below.
  • the midiStreamOut interface function plays a stream (buffer) or MIDI (Musical Instrument Digital Interface) data to a MIDI output device, as shown in the following code:
  • the parameter hMidiStream represents the handle of the MIDI stream;
  • the parameter lpMidiHdr points to the MIDIHDR structure for representing a midi data;
  • the parameter cbMidiHdr represents the size of the MIDIHDR structure.
  • MMSYSERR_NOERROR is returned when the function call succeeds.
  • the values returned on failure are shown in Table 2 below.
  • the IAudioRenderClient interface function allows the client to write data buffers to render endpoints.
  • the client obtains a stream object referenced by the IAudioRenderClient interface by calling the IAudioClient::GetService method and setting the parameter to REFIID IID_IAudioRenderClient riid.
  • the data packet managed by this interface function contains audio rendering data.
  • the length of a packet is expressed as the number of packets of the audio frame.
  • the size of an audio frame specifies the member structure of nBlockAlign WAVEFORMATEX.
  • the number of audio frames in a byte size is equal to the channel stream multiplied by the sample size per channel. For example, the audio frame size is 4 bytes for a stereo (2 channel) stream with 16 bit samples.
  • a packet always contains an integer number of audio frames.
  • the DirectSoundCreate8 interface function uses the DSound.h file and the Dsound.lib file.
  • the specific structure of the function is shown in the following code:
  • LPCGUID lpcGuidDevice / / sound card device global flag, generally NULL, indicating the default sound card
  • a webpage tag may include one or more of a waveOutWrite interface function, a midiStreamOut interface function, an IAudioRenderClient interface function, a DirectSoundCreate interface function, and a DirectSoundCreate8 interface function, and the webpage is present through the audio application interface existing in the webpage tag according to the sound control instruction. The sound in the label is controlled.
  • the embodiment of the present invention separates different webpage label processes by establishing a technical process of a label process independent of the main process of the browser, thereby avoiding the influence of the sound control of one webpage on the sound state of other webpages, and ensuring that each The sounds in the webpages are individually controlled; and the embodiment of the present invention provides a specific implementation manner of sound control in a single webpage by receiving sound control commands through the display interface of the main process and calling the technical means of the corresponding audio application interface.
  • the technical solution can separately control the sound of each browser tab, thereby improving the performance and user experience of the browser.
  • a method for performing sound control in a browser provided by still another embodiment of the present invention will be described below with reference to FIG.
  • the manner in which the main process of the browser controls the label process and the communication mode between the two are mainly described.
  • Other contents in the method for performing sound control in the browser are referred to other embodiments of the present invention. Referring to Figure 10, the method includes the following steps:
  • S1000 Create a label process that is independent of the browser's main process.
  • a tag process separate from the main browser process is created and a mapping relationship between the web page tag and the tag is established.
  • the tag process and the running of the main process do not affect each other.
  • the operation of data in a tag process does not affect the data running in the main process or other tag processes.
  • a message indicating that the label process is created is generated in the browser, and the label process is completed when the message is detected.
  • the tag process in which the tag is located sends its own information (mapping relationship) to the main process and can be displayed in the display interface. After that, the user can individually control whether each webpage label is muted through the display interface.
  • the information transmitted to the main process is also different.
  • the mapping relationship between the label process ID and the title of the webpage label is established, and the label process ID is set in this manner.
  • the title of the webpage label is passed to the main process; in another way, the mapping relationship between the label process ID and the title of the webpage label and the URL of the webpage label is established, and in this way, the label process ID and the webpage label are The title and URL are passed to the main process.
  • the sender of the information when it is required to transfer information from the label process to the main process or needs to transfer information from the main process to the label process, the sender of the information firstly sets the content of the information (for example, a function to be executed and a parameter of the function). Encoding is a unified format, and then the encoded information is sent to the corresponding process message loop through the IPC (Inter-Process Communication) channel, and the receiving end receives the content of the information according to the unified encoding format, and then Call the relevant function to perform the operation.
  • IPC Inter-Process Communication
  • a message loop is created for the main process and the label process respectively, and the main process and the label process respectively use the message loop to receive information from the peer, parse the content in the information, and execute the operation according to the content calling function.
  • the communication mechanism between processes of some browsers is synchronous and asynchronous.
  • the adoption is Asynchronous communication scheme.
  • the process in which the main interface of the browser is located is the main process, and the main process manages the status display of each web page label and controls whether each web page label is muted.
  • the mapping between the web page tag and the tag process is saved in the main process.
  • the main process displays information about the webpage label on the display interface according to the mapping relationship, such as the title of each label, the URL, and the status of whether or not to mute.
  • the user can send a sound control command to the main process by clicking on the information of the tag process on the display interface.
  • the main process receives the voice control command of the user to modify the mute state, the main process notifies the process of the corresponding tag, and the process of the tag receives the mute control signal, and then changes whether the current play is intercepted.
  • the mute state of the webpage label in order to modify the mute state of the webpage label to be muted, it can be understood that the mute state of the webpage label can also be modified to play by the same method.
  • S1008 Intercept the audio application interface that plays the sound.
  • the audio application interface existing in the webpage tag of the voice control command that receives the notification mute is intercepted, and the sound signal in the webpage tag is prohibited from being output to the sound card.
  • S1010 The sound in the webpage label is intercepted, and the label of the webpage is muted.
  • the browser includes a creating unit 1110, a mapping unit 1112, a transmitting unit 1114, a control unit 1116, an identifying unit 1118, and a determining unit 1120. The following description will be respectively made.
  • the creation unit 1110 is adapted to create a web page tag in the browser and create a tag process for the web page tag that is separate from the main process of the browser.
  • the tag process and the running of the main process do not affect each other.
  • the operation of data in a tag process does not affect the data running in the main process or other tag processes.
  • the mapping unit 1112 is adapted to establish a mapping relationship between the webpage label and the labeling process, and save the mapping relationship in the main process to control the sound in the webpage label in the display interface of the main process.
  • the mapping unit 1112 is adapted to establish a mapping relationship between the label process ID and the title of the webpage label, and/or establish a mapping relationship between the label process ID and the title of the webpage label, and the uniform resource locator URL;
  • the tag process ID and the title of the web page tag are saved in the main process, and/or, the tag process ID, the title of the web page tag, and the URL are saved in the main process.
  • the transmitting unit 1114 is adapted to send a sound control instruction input through the presentation interface of the main process to the tag process.
  • the control unit 1116 is adapted to control the sound in the web page tag via the audio application interface in the web page tag in accordance with the sound control command.
  • the audio application interface includes at least one of the following interface functions: a waveOutWrite interface function, a midiStreamOut interface function, an IAudioRenderClient interface function, a DirectSoundCreate interface function, and a DirectSoundCreate8 interface function.
  • the control unit 1116 is adapted to intercept the call of the webpage label to the audio application interface according to the sound control instruction to prohibit the output of the sound in the webpage label; and/or, according to the sound control instruction, allow the webpage label to invoke the audio application interface, To achieve the output of the sound in the web page tag.
  • the browser further includes an identifying unit 1118, configured to: before creating a label process independent of the main process of the browser for the webpage label, identifying whether the created webpage label includes an audio/video file, and if so, the webpage
  • the tag creates a tag process that is separate from the browser's main process. If not, it does not create a tag process that is separate from the browser's main process for the page tag.
  • the browser further includes: the determining unit 1120 is configured to: if there is at least one muted webpage label in the browser, and determine that the newly created webpage label includes the audio and video file, send the prompt information to the browser user to enter the silent mode. , or set the display interface to enter the mute control interface
  • the embodiment of the present invention separates different webpage label processes by establishing a technical process of a label process independent of the main process of the browser, thereby avoiding the influence of the sound control of one webpage on the sound state of other webpages, and ensuring that each The sounds in the webpages are individually controlled; and the embodiment of the present invention provides a specific implementation manner of sound control in a single webpage by receiving sound control commands through the display interface of the main process and calling the technical means of the corresponding audio application interface.
  • the technical solution can separately control the sound of each browser tab, thereby improving the performance and user experience of the browser.
  • modules in the devices of the embodiments can be adaptively changed and placed in one or more devices different from the embodiment.
  • the modules or units or components of the embodiments may be combined into one module or unit or component, and further they may be divided into a plurality of sub-modules or sub-units or sub-components.
  • any combination of the features disclosed in the specification, including the accompanying claims, the abstract and the drawings, and any methods so disclosed, or All processes or units of the device are combined.
  • Each feature disclosed in this specification (including the accompanying claims, the abstract and the drawings) may be replaced by alternative features that provide the same, equivalent or similar purpose.
  • the various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof.
  • a microprocessor or digital signal processor may be used in practice to implement some or all of some or all of the components of the browser for sound control in a browser in accordance with an embodiment of the present invention. All features.
  • the invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein.
  • Such a program implementing the present invention may be stored on a computer readable medium or may have The form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
  • Figure 12 illustrates a computing device that can implement a method of sound control in a browser in accordance with the present invention.
  • the computing device conventionally includes a processor 1210 and a computer program product or computer readable medium in the form of a memory 1220.
  • the memory 1220 may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read Only Memory), an EPROM, a hard disk, or a ROM.
  • Memory 1220 has a memory space 1230 for program code 1231 for performing any of the method steps described above.
  • storage space 1230 for program code may include various program codes 1231 for implementing various steps in the above methods, respectively.
  • the program code can be read from or written to one or more computer program products.
  • Such computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks.
  • Such a computer program product is typically a portable or fixed storage unit as described with reference to FIG.
  • the storage unit may have storage segments, storage spaces, and the like that are similarly arranged to memory 1220 in the computing device of FIG.
  • the program code can be compressed, for example, in an appropriate form.
  • the storage unit includes computer readable code 1231 ', ie, code readable by a processor, such as 1210, that when executed by a computing device causes the computing device to perform each of the methods described above step.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Multimedia (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

Disclosed are a method for sound control in a browser, and a browser. The method for sound control in a browser provided in an embodiment of the present invention comprises: creating a webpage label in a browser, and creating a label process independent of a master process of the browser for the webpage label; establishing a mapping relationship between the webpage label and the label process and storing the mapping relationship into the master process, so that a sound in the webpage label is controlled in a display interface of the master process; sending a sound control instruction input through the display interface of the master process to the label process; and controlling the sound in the webpage label through an audio application interface of the webpage label according to the sound control instruction.

Description

浏览器中进行声音控制的方法和浏览器Method and browser for sound control in a browser 技术领域Technical field
本发明涉及计算机网络技术领域,尤其涉及一种浏览器中进行声音控制的方法和浏览器。The present invention relates to the field of computer network technologies, and in particular, to a method and a browser for performing sound control in a browser.
背景技术Background technique
网页浏览器是一种显示网站服务器或文件系统内的文件,并让用户与这些文件交互的应用软件。随着技术的发展,网页呈现的内容越来越多,越来越丰富。除简单的文字信息外,网页上还能够呈现带声音的信息,例如音乐文件、多媒体文件等等。A web browser is an application that displays files within a web server or file system and lets users interact with them. With the development of technology, the content presented by web pages is more and more abundant. In addition to simple text information, web pages can also present information with sound, such as music files, multimedia files, and so on.
目前浏览器中网页的声音控制是通过浏览器中的网页静音按钮来实现的,其在浏览器的状态栏中添加了该按钮,会将浏览器输出到声卡中的声音数据屏蔽掉,从而实现所有的浏览器声音数据都得不到播放。At present, the sound control of the webpage in the browser is realized by the webpage mute button in the browser, and the button is added in the status bar of the browser, and the sound data outputted by the browser to the sound card is shielded, thereby realizing All browser sound data is not played.
然而,现有浏览器网页的静音功能是将所有的浏览器标签页的声音全部关闭掉,即将网页进程中的所有声音输出都关闭,导致用户无法获得任何声音数据;或者是全部标签页的声音都不关闭,如果多个标签中都有音频数据需要播放时,就会出现声音被混杂在一起,影响各个标签中本来的声音播放。However, the mute function of the existing browser webpage is to turn off the sound of all the browser tabs, that is, all the sound output in the webpage process is closed, so that the user can not obtain any sound data; or the sound of all the tabs It does not turn off. If there is audio data in multiple tags that need to be played, the sounds will be mixed together, affecting the original sound playback in each tag.
发明内容Summary of the invention
鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决或者减缓上述问题的浏览器中进行声音控制的方法和相应的浏览器。In view of the above problems, the present invention has been made in order to provide a method and corresponding browser for performing sound control in a browser that overcomes the above problems or at least partially solves or alleviates the above problems.
根据本发明的一个方面,提供了一种浏览器中进行声音控制的方法,包括:在浏览器中创建网页标签,并为网页标签创建一个与浏览器的主进程相独立的标签进程;建立网页标签与标签进程之间的映射关系,将该映射关系保存在主进程中,以在主进程的展示界面中控制网页标签中的声音;将通过主进程的展示界面输入的声音控制指令发送至标签进程;根据声音控制指令通过网页标签中的音频应用接口,对网页标签中的声音进行控制。According to an aspect of the present invention, a method for sound control in a browser is provided, comprising: creating a webpage tag in a browser, and creating a tag process independent of a main process of the browser for the webpage tag; creating a webpage The mapping relationship between the label and the label process, and the mapping relationship is saved in the main process to control the sound in the webpage label in the display interface of the main process; and the sound control instruction input through the display interface of the main process is sent to the label The process controls the sound in the webpage tag through the audio application interface in the webpage tag according to the sound control command.
根据本发明的另一个方面,提供了一种浏览器,包括:According to another aspect of the present invention, a browser is provided, comprising:
创建单元,适于在浏览器中创建网页标签,并为网页标签创建一个与浏览器的主进程相独立的标签进程;Creating a unit adapted to create a web page tag in the browser and create a tag process for the web page tag that is separate from the main process of the browser;
映射单元,适于建立网页标签与标签进程之间的映射关系,将该映射关系保存在主进程中,以在主进程的展示界面中控制网页标签中的声音;The mapping unit is adapted to establish a mapping relationship between the webpage label and the labeling process, and save the mapping relationship in the main process to control the sound in the webpage label in the display interface of the main process;
发送单元,适于将通过主进程的展示界面输入的声音控制指令发送至标签进程;a sending unit, configured to send a sound control instruction input through a display interface of the main process to the label process;
控制单元,适于根据声音控制指令通过网页标签中的音频应用接口,对网页标签中的声音进行控制。The control unit is adapted to control the sound in the webpage label through the audio application interface in the webpage tag according to the sound control instruction.
本发明有益效果为: The beneficial effects of the invention are:
本发明实施例通过建立与浏览器主进程相独立的标签进程的技术手段,使不同的网页标签进程相分离,避免了对一个网页的声音控制对其它网页的声音状态造成影响,保证了对每个网页中的声音单独控制;以及,本发明实施例通过主进程的展示界面接收声音控制指令并调用相应音频应用接口的技术手段,提供了对单个网页中声音控制的具体实现方式。本技术方案能够对各浏览器标签页的声音分别进行控制,提高了浏览器的性能和用户体验。The embodiment of the present invention separates different webpage label processes by establishing a technical process of a label process independent of the main process of the browser, thereby avoiding the influence of the sound control of one webpage on the sound state of other webpages, and ensuring that each The sounds in the webpages are individually controlled; and the embodiment of the present invention provides a specific implementation manner of sound control in a single webpage by receiving sound control commands through the display interface of the main process and calling the technical means of the corresponding audio application interface. The technical solution can separately control the sound of each browser tab, thereby improving the performance and user experience of the browser.
根据本发明的又一个方面,提供了一种计算机程序,其包括计算机可读代码,当所述计算机可读代码在计算设备上运行时,导致所述计算设备执行上述任一项所述的浏览器中进行声音控制的方法。According to still another aspect of the present invention, a computer program is provided, comprising computer readable code, when the computer readable code is run on a computing device, causing the computing device to perform the browsing described in any of the above The method of sound control in the device.
根据本发明的再一个方面,提供了一种计算机可读介质,其中存储了上述的计算机程序。According to still another aspect of the present invention, a computer readable medium is provided, wherein the computer program described above is stored.
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solutions of the present invention, and the above-described and other objects, features and advantages of the present invention can be more clearly understood. Specific embodiments of the invention are set forth below.
附图说明DRAWINGS
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those skilled in the art from a The drawings are only for the purpose of illustrating the preferred embodiments and are not to be construed as limiting. Throughout the drawings, the same reference numerals are used to refer to the same parts. In the drawing:
图1示出了根据本发明一个实施例的浏览器中进行声音控制的装置的结构示意图;1 is a schematic structural diagram of an apparatus for performing sound control in a browser according to an embodiment of the present invention;
图2示出了根据本发明一个实施例的浏览器中进行声音控制的方法的处理流程图;2 is a flowchart showing a process of a method for performing sound control in a browser according to an embodiment of the present invention;
图3示出了根据本发明一个实施例的查找一网页标签所在的页面进程的具体步骤的流程图;3 is a flow chart showing specific steps of a process of finding a page where a web page tag is located, in accordance with one embodiment of the present invention;
图4示出了根据本发明一个实施例的对第一网页标签中的声音进行控制的处理流程图;4 is a flowchart showing a process of controlling sound in a first web page tag according to an embodiment of the present invention;
图5示出了根据本发明一个实施例的网页的打开流程图;FIG. 5 is a flow chart showing the opening of a webpage according to an embodiment of the present invention; FIG.
图6示出了根据本发明一个实施例的用户点击控制图标对网页进行静音操作的处理流程图;6 is a flowchart showing a process of a user performing a mute operation on a webpage by clicking a control icon according to an embodiment of the present invention;
图7示出了根据本发明一个实施例的在一个浮动窗口显示多个网页标签的信息的示意图;FIG. 7 is a diagram showing information for displaying a plurality of web page tags in a floating window according to an embodiment of the present invention; FIG.
图8示出了根据本发明一个实施例的在一个浮动窗口显示声音文件的控制信息的示意图;FIG. 8 is a diagram showing control information for displaying a sound file in a floating window according to an embodiment of the present invention; FIG.
图9示出了根据本发明又一个实施例的一种浏览器中进行声音控制的方法流程图;FIG. 9 is a flow chart showing a method for performing sound control in a browser according to still another embodiment of the present invention; FIG.
图10示出了根据本发明又一个实施例的一种浏览器中进行声音控制的方法流程图;FIG. 10 is a flow chart showing a method for performing sound control in a browser according to still another embodiment of the present invention; FIG.
图11示出了根据本发明又一个实施例的一种浏览器的结构示意图;FIG. 11 is a schematic structural diagram of a browser according to still another embodiment of the present invention; FIG.
图12示意性地示出了用于执行根据本发明的浏览器中进行声音控制的方法的计算设 备的框图;以及Figure 12 is a schematic illustration of a computing device for performing a method of sound control in a browser in accordance with the present invention Prepared block diagram;
图13示意性地示出了用于保持或者携带实现根据本发明的浏览器中进行声音控制的方法的程序代码的存储单元。Fig. 13 schematically shows a storage unit for holding or carrying program code for implementing a method of sound control in a browser according to the present invention.
具体实施方式detailed description
下面结合附图和具体的实施方式对本发明作进一步的描述。The invention is further described below in conjunction with the drawings and specific embodiments.
本发明实施例提供了一种浏览器中进行声音控制的装置。图1示出了根据本发明一个实施例的浏览器中进行声音控制的装置的结构示意图。Embodiments of the present invention provide an apparatus for performing sound control in a browser. FIG. 1 is a block diagram showing the structure of an apparatus for performing sound control in a browser according to an embodiment of the present invention.
参见图1,浏览器中进行声音控制的装置中至少包括建立模块110、查找模块120以及控制模块130。现分别对上述各模块的架构以及功能进行详细说明。Referring to FIG. 1, the apparatus for performing sound control in the browser includes at least an establishing module 110, a searching module 120, and a control module 130. The architecture and functions of each of the above modules are described in detail.
首先,介绍建立模块110。浏览器能够同时打开多个网页,每个网页会相应创建一个网页标签,且在后台,每个网页会有一个相应的进程。因此,可以使用建立模块110创建网页标签,并建立网页标签与网页标签所在页面进程之间的映射关系。First, the building module 110 is introduced. The browser can open multiple webpages at the same time, each webpage will create a webpage label accordingly, and in the background, each webpage will have a corresponding process. Therefore, the creation module 110 can be used to create a webpage label and establish a mapping relationship between the webpage label and the page process where the webpage label is located.
然后,介绍查找模块120。参见图1,查找模块120与建立模块110相耦合。用户同时打开多个网页标签时,若选择其中的一个网页标签的声音进行控制,则发出对该网页标签中声音进行控制的指令。此处为区别出用户选择的、即将进行声音控制的网页标签,可以将其称为第一网页标签。此处的第一仅作为区别标识使用,对网页标签以及对应网页自身没有任何限定意义。在接收用户输入的对第一网页标签中声音进行控制的指令时,查找模块120可以依据建立的网页标签与页面进程之间的映射关系,查找到第一网页标签所在的页面进程。Then, the lookup module 120 is introduced. Referring to FIG. 1, the lookup module 120 is coupled to the setup module 110. When the user opens a plurality of webpage tabs at the same time, if the sound of one of the webpage tabs is selected for control, an instruction to control the sound in the webpage tab is issued. Here, in order to distinguish the webpage label selected by the user and to be controlled by the sound, it may be referred to as a first webpage label. The first here is only used as a distinguishing identifier, and has no meaning to the webpage label and the corresponding webpage itself. When receiving an instruction input by the user to control the sound in the first webpage label, the searching module 120 may find the page process where the first webpage label is located according to the mapping relationship between the established webpage label and the page process.
最后,介绍控制模块130。参见图1,控制模块130与查找模块120相耦合。当查找模块120查找到的第一网页标签的页面进程后,控制模块130利用查找到的第一网页标签的页面进程对第一网页标签中的声音进行控制。Finally, the control module 130 is introduced. Referring to FIG. 1, control module 130 is coupled to lookup module 120. After the search module 120 finds the page process of the first webpage tag, the control module 130 controls the sound in the first webpage tag by using the found page process of the first webpage tag.
在本发明实施例中,当存在至少一个网页标签时,可以分别利用每个网页标签的页面进程对该网页标签中的声音进行控制,而不是由一个统一的静音功能或者函数对所有的网页标签中的声音进行统一的控制。由此可见,本发明实施例能够针对每个网页标签中的声音进行单独控制,提高网页声音控制的精准性,提高用户的感受体验。In the embodiment of the present invention, when there is at least one webpage label, the sound of the webpage label may be controlled by using the page process of each webpage label separately, instead of all the webpage labels by a unified mute function or function. The sound in the control is unified. It can be seen that the embodiment of the present invention can separately control the sound in each webpage label, improve the accuracy of the webpage sound control, and improve the user's feeling experience.
上文提及建立模块110能够建立网页标签与网页标签所在页面进程之间的映射关系。映射关系中利用的映射方式可以有多种,例如,随机映射、数字映射、排序映射等等,采用的映射元素也可以为多种,例如关键字、权值等等。本例中提供了一种优选的映射关系,即,建立网页标签标识(ID)与网页标签所在页面进程ID之间的映射关系。其中,建立模块110在创建网页标签所在的页面进程时,就可以将网页标签与网页标签所在页面进程之间的映射关系同步建立出来。The above mentioned building module 110 is capable of establishing a mapping relationship between a web page tag and a page process where the web page tag is located. There are various mapping methods used in the mapping relationship, for example, random mapping, digital mapping, sort mapping, etc., and the mapping elements used may also be various, such as keywords, weights, and the like. In this example, a preferred mapping relationship is provided, that is, a mapping relationship between a webpage label identifier (ID) and a page process ID where the webpage label is located is established. The establishing module 110 can establish a mapping relationship between the webpage label and the page process where the webpage label is located when the webpage process in which the webpage label is located is created.
若映射关系为网页标签ID与页面进程ID之间的映射关系时,用户可以在对声音进行控制的指令中携带网页标签ID。相应的,查找模块120会在第一网页标签中接收到用户输入的针对该第一网页标签的声音控制指令,其中,该声音控制指令包括第一网页标 签ID。随后,查找模块120依据第一网页标签ID,在建立的网页标签与页面进程之间的映射关系中进行查找,得到第一网页标签所对应的页面进程的ID,将该页面进程的ID通知给控制模块130。If the mapping relationship is a mapping relationship between the webpage tag ID and the page process ID, the user may carry the webpage tag ID in the instruction to control the voice. Correspondingly, the search module 120 receives the sound control instruction input by the user for the first webpage label in the first webpage label, where the sound control instruction includes the first webpage label Sign the ID. Then, the search module 120 searches the mapping relationship between the established webpage label and the page process according to the first webpage label ID, obtains the ID of the page process corresponding to the first webpage label, and notifies the ID of the page process to the ID of the page process. Control module 130.
控制模块130在获知页面进程的ID之后,依据查找得到第一网页标签所对应的页面进程的ID查找到相应的页面进程。进一步,控制模块130在该页面进程中通过操作系统的声音API(Application Program Interface,应用程序编程接口)函数对第一网页标签中的声音进行控制。After learning the ID of the page process, the control module 130 searches for the corresponding page process according to the ID of the page process corresponding to the first webpage tag. Further, the control module 130 controls the sound in the first webpage tag through the sound API (Application Program Interface) function of the operating system in the page process.
由于浏览器中包括多个网页标签,而对于网页标签中的声音的控制,若每次打开各个网页标签再进行控制,则会造成时间的浪费,处理结果不是很理想。因此,浏览器中进行声音控制的装置中还可以设置窗口生成模块140,与查找模块120相耦合,用于生成浮动窗口。具体在本例中,窗口生成模块140可以在第一网页标签的标签头部或者第一网页标签中的产生声音的网页元素处生成提示进行声音控制的浮动窗口,其中,该浮动窗口中加载有接收对第一网页标签中的声音进行控制的指令的入口。进一步,用户可以在浮动窗口处发出对第一网页标签中的声音进行控制的指令,窗口生成模块140接收相应指令,并将其转至查找模块120,以备后续处理。浮动窗口相对于设置在页面上的控制图标来说有着一定的优势,浮动窗口可以浮现在某一指定页面上,也可以浮动在所有页面上,即使打开的并不是需要进行声音控制的第一网页标签,也可以对第一网页标签中的声音进行控制,使得对声音的控制更为方便快捷。Since the browser includes a plurality of webpage tags, and the control of the sounds in the webpage tags, if each webpage tag is opened and then controlled, time is wasted, and the processing result is not ideal. Therefore, the device for performing sound control in the browser may further set a window generating module 140 coupled to the searching module 120 for generating a floating window. Specifically, in this example, the window generating module 140 may generate a floating window prompting for sound control at a label header of the first webpage label or a webpage element of the first webpage that generates sound, wherein the floating window is loaded with An entry to receive an instruction to control the sound in the first web page tag. Further, the user can issue an instruction to control the sound in the first webpage tab at the floating window, and the window generation module 140 receives the corresponding instruction and transfers it to the lookup module 120 for subsequent processing. Floating windows have certain advantages over control icons set on the page. Floating windows can float on a specific page or float on all pages, even if the first page that is open is not required for sound control. The label can also control the sound in the first webpage label, making the control of the sound more convenient and quick.
前文一直提到对第一网页标签中的声音进行控制,此处需要说明的是,第一网页标签中的声音包括多种,例如网页中的视频插件产生的声音,再例如音频插件产生的声音,或者两者同时产生的声音,等等。一个网页标签中可以同时有多个插件发出声音。The foregoing has always mentioned the control of the sound in the first webpage label. Here, it should be noted that the sound in the first webpage label includes a plurality of sounds, such as the sound generated by the video plug-in in the webpage, and the sound generated by the audio plug-in, for example. , or both, and so on. Multiple plugins can sound at the same time in a web page tag.
控制模块130对第一网页标签中的声音进行控制时,可以执行以下操作控制中的至少一项:When the control module 130 controls the sound in the first webpage tab, at least one of the following operational controls may be performed:
关闭第一网页标签中的声音;Turn off the sound in the first webpage tab;
打开第一网页标签中的声音;Open the sound in the first webpage tab;
调节第一网页标签中的声音大小。Adjust the size of the sound in the first web page tab.
上述仅仅是对声音的基本控制方式的枚举。若声音存在其他属性,例如双声道、中英文切换,还可以根据情况选择左声道或右声道进行声音播放,或者选择声音的语种,等等。The above is just an enumeration of the basic control of sound. If the sound has other attributes, such as two-channel, Chinese and English switching, you can also select the left or right channel for sound playback, or select the language of the sound, etc., depending on the situation.
进一步,由于本发明实施例中提及的浏览器能够同时打开多个网页标签,则当其中部分网页标签同时存在声音数据时,可以在浏览器中进行声音控制的装置中设置提示模块150,与建立模块110耦合,当各网页标签以及相应进程建立之后,对存在声音数据的网页标签提供提示。需要说明的是,此处的提示方式可以有多种,能够将存在声音数据的网页标签识别出来即可,例如,可以利用标签项的高亮显示对存在声音数据的网页标签进行提示,也可以利用标签项的背景色对存在声音数据的网页标签进行提示,还可以利用标签项的标题字体大小、颜色等选项对存在声音数据的网页标签进行提示,等等。 由于高亮显示效果较为明显,因此,优选利用高亮显示标签项的方式进行提示。Further, since the browser mentioned in the embodiment of the present invention can simultaneously open a plurality of webpage tags, when some of the webpage tags have sound data at the same time, the prompting module 150 can be set in the device for performing sound control in the browser, and The establishing module 110 is coupled to provide a prompt for the webpage label in which the sound data exists after each webpage label and the corresponding process are established. It should be noted that there may be multiple prompting manners herein, and the webpage label with the sound data may be identified. For example, the webpage label with the sound data may be prompted by the highlighting of the label item, or The webpage label with the sound data is prompted by the background color of the label item, and the webpage label with the sound data can be prompted by using the title font size, color, and the like of the label item, and the like. Since the highlighting effect is more obvious, it is preferable to prompt by means of highlighting the label item.
由于多网页显示,且每个网页中能够提供声音数据的文件可能不止一个,因此,为方便用户选择产生声音的文件并及时进行控制,可以考虑在浏览器中进行声音控制的装置中设置显示模块160。参见图1,显示模块160分别与窗口生成模块140以及查找模块120相耦合。当多个网页标签同时存在声音数据时,显示模块160可以在一浮动窗口中显示多个网页标签中的声音数据的信息。当然,若出现第一网页标签同时存在多个声音数据时,显示模块160也可以在一浮动窗口中显示第一网页标签同时存在的多个声音数据的信息。将多个声音数据的信息均放在一个浮动窗口中呈现,对信息进行集中化管理,便于用户根据需要进行选择,提高声音控制的效率。Since there are more than one web page display, and there may be more than one file capable of providing sound data in each web page, in order to facilitate the user to select a file that generates sound and control in time, it may be considered to set the display module in the device for sound control in the browser. 160. Referring to FIG. 1, display module 160 is coupled to window generation module 140 and lookup module 120, respectively. When a plurality of webpage tags have sound data at the same time, the display module 160 may display information of the sound data in the plurality of webpage tags in a floating window. Of course, if there is a plurality of sound data in the first webpage label, the display module 160 may also display information of the plurality of sound data that the first webpage label exists at the same time in a floating window. The information of multiple sound data is presented in a floating window, and the information is centrally managed, which is convenient for the user to select according to needs and improve the efficiency of sound control.
为便于用户选择,显示模块160可以在浮动窗口上显示声音文件或声音数据的任意信息,通常优选显示下列信息:To facilitate user selection, the display module 160 can display any information of the sound file or the sound data on the floating window, and generally preferably displays the following information:
网页标签的标题;The title of the web page label;
网页中声音数据的类型;The type of sound data in the web page;
网页中声音数据的名称。The name of the sound data in the web page.
若声音数据还存在其他信息能够对于用户的选择起到一定的作用,则也可以显示其他信息,例如声音数据的剩余播放时间。If the sound data still has other information that can play a certain role in the user's selection, other information such as the remaining playing time of the sound data can also be displayed.
利用浮动窗口进行信息显示的优势在前文也做了相应说明,在此无须赘述。相应的,控制模块130可以选择在浮动窗口中对第一网页标签中的声音进行控制操作。为方便操作,可以在浮动窗口中根据对声音数据的不同操作设置不同的图标按钮,例如,可以设置开始图标、暂停图标、停止图标、加速图标、放慢图标等。用户在进行指令输入时,可以通过点击图标达成目的。The advantages of using the floating window for information display have also been explained in the previous section, and need not be described here. Correspondingly, the control module 130 can select to control the sound in the first webpage label in the floating window. For convenience of operation, different icon buttons may be set in the floating window according to different operations on the sound data, for example, a start icon, a pause icon, a stop icon, an acceleration icon, a slow icon, and the like may be set. When the user inputs an instruction, the user can click the icon to achieve the purpose.
若某一网页标签已经被处理,则显示模块160可以在多个网页标签中,将当前被处理的网页标签置前显示。这种排序方式有益于提高声音数据的控制效率,降低查找声音数据所在网页所造成的时间浪费。例如,用户关闭第一网页标签中的声音文件,显示模块160将该网页标签排序到浏览器显示的第一位。后续,用户又想打开该声音文件,则直接打开第一位的网页标签即可,不需要再一个个网页标签去查找,达到提高声音数据的控制效率的目的。If a web page tag has been processed, the display module 160 can display the currently processed web page tag in a plurality of web page tags. This sorting method is beneficial for improving the control efficiency of the sound data and reducing the waste of time caused by finding the webpage where the sound data is located. For example, the user closes the sound file in the first web page tab, and the display module 160 sorts the web page label to the first position displayed by the browser. Subsequently, if the user wants to open the sound file, the first webpage label can be directly opened, and no one webpage label is needed to search, so as to improve the control efficiency of the sound data.
在用户选择的声音文件被控制之后,控制模块130还可以在浮动窗口中提供其他信息,例如,可以提供没有被静音或者已被静音的音/视频文件的推荐链接,再例如,也可以提供针对音/视频文件相关的搜索工具链接。这些其他信息的提供可以由浏览器根据用户选择声音文件的相关信息进行分析得出,也可以由浏览器根据用户平时的浏览记录进行分析得出。After the sound file selected by the user is controlled, the control module 130 may also provide other information in the floating window, for example, may provide a recommended link of the audio/video file that has not been muted or has been muted, and for example, may also provide Links to search tools related to audio/video files. The provision of these other information may be analyzed by the browser according to the information related to the user's selection of the sound file, or may be analyzed by the browser according to the usual browsing history of the user.
实施时,第一网页标签中的声音文件被控制之后,可以在保存模块170中保存第一网页标签中被进行控制的声音文件的信息。为方便后续对已控制过的声音文件再次提取或者访问等处理操作,进一步,保存模块170也可以将保存的声音文件的信息作为浏览器用户信息的一部分进行浏览器本地侧保存,或者,还可以将其进行网络侧的同步。若 是保存在网络侧,则再次提取相应信息时,浏览器需要先到网络侧获取保存的相关信息,进而再次打开并进行后续控制操作。In implementation, after the sound file in the first webpage tab is controlled, the information of the sound file controlled in the first webpage tab may be saved in the saving module 170. In order to facilitate subsequent processing operations such as re-extracting or accessing the controlled sound file, the saving module 170 may also save the saved sound file information as part of the browser user information on the local side of the browser, or Synchronize it on the network side. If If it is saved on the network side, when the corresponding information is extracted again, the browser needs to obtain the related information stored on the network side first, and then open and perform subsequent control operations.
基于同一发明构思,本发明实施例还提供了一种浏览器中进行声音控制的方法,该方法的实施基础为上述任意一个实施例中提供的浏览器中进行声音控制的装置。图2示出了根据本发明一个实施例的浏览器中进行声音控制的方法的处理流程图。该方法包括步骤S202至步骤S206。Based on the same inventive concept, the embodiment of the present invention further provides a method for performing sound control in a browser, and the implementation of the method is based on the device for performing sound control in the browser provided in any one of the above embodiments. 2 is a process flow diagram of a method of sound control in a browser in accordance with one embodiment of the present invention. The method includes steps S202 to S206.
步骤S202、创建网页标签,并建立网页标签与网页标签所在页面进程之间的映射关系。Step S202: Create a webpage label, and establish a mapping relationship between the webpage label and the page process where the webpage label is located.
步骤S204、在接收用户输入的对第一网页标签中声音进行控制的指令时,依据建立的网页标签与页面进程之间的映射关系,查找到第一网页标签所在的页面进程。Step S204: When receiving an instruction input by the user to control the sound in the first webpage label, according to the mapping relationship between the established webpage label and the page process, the page process where the first webpage label is located is found.
步骤S206、在查找到的第一网页标签的页面进程中对第一网页标签中的声音进行控制。Step S206: Control the sound in the first webpage label in the page process of the found first webpage label.
在本发明实施例中,当存在至少一个网页标签时,可以分别利用每个网页标签的页面进程对该网页标签中的声音进行控制,而不是由一个统一的静音功能或者函数对所有的网页标签中的声音进行统一的控制。由此可见,本发明实施例能够针对每个网页标签中的声音进行单独控制,提高网页声音控制的精准性,提高用户的感受体验。In the embodiment of the present invention, when there is at least one webpage label, the sound of the webpage label may be controlled by using the page process of each webpage label separately, instead of all the webpage labels by a unified mute function or function. The sound in the control is unified. It can be seen that the embodiment of the present invention can separately control the sound in each webpage label, improve the accuracy of the webpage sound control, and improve the user's feeling experience.
参见图2所示流程,步骤S202提及建立网页标签与网页标签所在页面进程之间的映射关系。映射关系中利用的映射方式可以有多种,例如,随机映射、数字映射、排序映射等等,采用的映射元素也可以为多种,例如关键字、权值等等。本例中提供了一种优选的映射关系,即,建立网页标签标识(ID)与网页标签所在页面进程ID之间的映射关系。其中,在创建网页标签所在的页面进程时,就可以将网页标签与网页标签所在页面进程之间的映射关系同步建立出来。Referring to the process shown in FIG. 2, step S202 refers to establishing a mapping relationship between a webpage label and a page process where the webpage label is located. There are various mapping methods used in the mapping relationship, for example, random mapping, digital mapping, sort mapping, etc., and the mapping elements used may also be various, such as keywords, weights, and the like. In this example, a preferred mapping relationship is provided, that is, a mapping relationship between a webpage label identifier (ID) and a page process ID where the webpage label is located is established. When the page process where the webpage label is located is created, the mapping relationship between the webpage label and the page process where the webpage label is located can be established synchronously.
在一个优选的实施例中,步骤S204所提及的接收用户输入的对第一网页标签中声音进行控制的指令并查找到第一网页标签所在的页面进程的具体步骤可以参见图3,包括步骤S302至步骤S306。In a preferred embodiment, the specific step of receiving the user-input command to control the sound in the first webpage label and searching for the page process where the first webpage label is located may be referred to in step S204. S302 to step S306.
步骤S302、在第一网页标签中接收到用户输入的针对该第一网页标签的声音控制指令,其中,该声音控制指令包括第一网页标签ID;Step S302, receiving, in the first webpage label, a sound control instruction input by the user for the first webpage label, where the sound control instruction includes a first webpage label ID;
步骤S304、依据第一网页标签ID,在建立的网页标签与页面进程之间的映射关系中进行查找;Step S304: Perform a search in a mapping relationship between the established webpage label and the page process according to the first webpage label ID.
步骤S306、得到第一网页标签所对应的页面进程的ID。Step S306: Obtain an ID of a page process corresponding to the first webpage label.
步骤S306结束后,触发步骤S206,此时在查找到的第一网页标签的页面进程中对第一网页标签中的声音进行控制的步骤请参见图4,包括步骤S402至步骤S404。After the step S306 is completed, the step S206 is triggered. In the step of controlling the sound in the first webpage label in the page process of the first webpage label that is found, please refer to FIG. 4, including steps S402 to S404.
步骤S402、依据查找得到第一网页标签所对应的页面进程的ID,查找到相应的页面进程。In step S402, the ID of the page process corresponding to the first webpage label is obtained according to the search, and the corresponding page process is found.
步骤S404、在查找到的页面进程中通过操作系统的声音API函数对第一网页标签中的声音进行控制。 Step S404: Control the sound in the first webpage label through the sound API function of the operating system in the found page process.
需要说明的是,在对声音数据或声音文件进行控制的过程中,可以在第一网页标签的标签头部或者第一网页标签中的产生声音的网页元素处生成提示进行声音控制的浮动窗口,其中,该浮动窗口中加载有接收对第一网页标签中的声音进行控制的指令的入口。浮动窗口相对于设置在页面上的控制图标来说有着一定的优势,浮动窗口可以浮现在某一指定页面上,也可以浮动在所有页面上,即使打开的并不是需要进行声音控制的第一网页标签,也可以对第一网页标签中的声音进行控制,使得对声音的控制更为方便快捷。It should be noted that, in the process of controlling the sound data or the sound file, a floating window prompting for sound control may be generated at a label head of the first webpage label or a webpage element of the first webpage label that generates sound. The floating window is loaded with an entry for receiving an instruction to control the sound in the first webpage label. Floating windows have certain advantages over control icons set on the page. Floating windows can float on a specific page or float on all pages, even if the first page that is open is not required for sound control. The label can also control the sound in the first webpage label, making the control of the sound more convenient and quick.
此处需要说明的是,第一网页标签中的声音包括多种,例如网页中的视频插件产生的声音,再例如音频插件产生的声音,或者两者同时产生的声音,等等。一个网页标签中可以同时有多个插件发出声音。It should be noted here that the sounds in the first webpage label include various types, such as sounds generated by video plug-ins in webpages, such as sounds generated by audio plug-ins, or sounds generated simultaneously, and the like. Multiple plugins can sound at the same time in a web page tag.
优选的,对第一网页标签中的声音进行控制,包括以下操作控制中的至少一个:Preferably, the sound in the first webpage label is controlled, including at least one of the following operational controls:
关闭第一网页标签中的声音;Turn off the sound in the first webpage tab;
打开第一网页标签中的声音;Open the sound in the first webpage tab;
调节第一网页标签中的音量大小。Adjust the volume level in the first web page tab.
上述仅仅是对声音的基本控制方式的枚举。若声音存在其他属性,例如双声道、中英文切换,还可以根据情况选择左声道或右声道进行声音播放,或者选择声音的语种,等等。The above is just an enumeration of the basic control of sound. If the sound has other attributes, such as two-channel, Chinese and English switching, you can also select the left or right channel for sound playback, or select the language of the sound, etc., depending on the situation.
进一步,当多个网页标签同时存在声音数据时,对存在声音数据的网页标签提供提示。需要说明的是,此处的提示方式可以有多种,能够将存在声音数据的网页标签识别出来即可,例如,可以利用标签项的高亮显示对存在声音数据的网页标签进行提示,也可以利用标签项的背景色对存在声音数据的网页标签进行提示,还可以利用标签项的标题字体大小、颜色等选项对存在声音数据的网页标签进行提示,等等。由于高亮显示效果较为明显,因此,优选利用高亮显示标签项的方式进行提示。Further, when a plurality of webpage tags have sound data at the same time, a prompt is provided for the webpage tag in which the sound data exists. It should be noted that there may be multiple prompting manners herein, and the webpage label with the sound data may be identified. For example, the webpage label with the sound data may be prompted by the highlighting of the label item, or The webpage label with the sound data is prompted by the background color of the label item, and the webpage label with the sound data can be prompted by using the title font size, color, and the like of the label item, and the like. Since the highlighting effect is more obvious, it is preferable to prompt by means of highlighting the label item.
由于多网页显示,且每个网页中能够提供声音数据的文件可能不止一个,因此,为方便用户选择产生声音的文件并及时进行控制,可以充分利用浮动窗口的优势。当多个网页标签同时存在声音数据时,在一浮动窗口中显示多个网页标签中的声音数据的信息。当然,若当第一网页标签同时存在多个声音数据时,也可以在一浮动窗口中显示第一网页标签同时存在的多个声音数据的信息。将多个声音数据的信息均放在一个浮动窗口中呈现,对信息进行集中化管理,便于用户根据需要进行选择,提高声音控制的效率。Since there are more than one web page display and more than one file capable of providing sound data in each web page, the advantage of the floating window can be fully utilized in order to facilitate the user to select a file that generates sound and control in time. When sound data is simultaneously present in a plurality of webpage tags, information of the sound data in the plurality of webpage tags is displayed in a floating window. Of course, if the first webpage label has a plurality of sound data at the same time, the information of the plurality of sound data that the first webpage label exists at the same time may be displayed in a floating window. The information of multiple sound data is presented in a floating window, and the information is centrally managed, which is convenient for the user to select according to needs and improve the efficiency of sound control.
为便于用户选择,可以在浮动窗口上显示声音文件或声音数据的任意信息,通常优选显示下列信息:For the convenience of the user, any information of the sound file or the sound data can be displayed on the floating window, and the following information is usually preferably displayed:
网页标签的标题;The title of the web page label;
网页中声音数据的类型;The type of sound data in the web page;
网页中声音数据的名称。The name of the sound data in the web page.
若声音数据还存在其他信息能够对于用户的选择起到一定的作用,则也可以显示其他信息,例如声音数据的剩余播放时间。If the sound data still has other information that can play a certain role in the user's selection, other information such as the remaining playing time of the sound data can also be displayed.
利用浮动窗口进行信息显示的优势在前文也做了相应说明,在此无须赘述。相应的, 可以选择在浮动窗口中对第一网页标签中的声音进行控制操作。为方便操作,可以在浮动窗口中根据对声音数据的不同操作设置不同的图标按钮,例如,可以设置开始图标、暂停图标、停止图标、加速图标、放慢图标等。用户在进行指令输入时,可以通过点击图标达成目的。The advantages of using the floating window for information display have also been explained in the previous section, and need not be described here. corresponding, You can choose to control the sound in the first web page label in the floating window. For convenience of operation, different icon buttons may be set in the floating window according to different operations on the sound data, for example, a start icon, a pause icon, a stop icon, an acceleration icon, a slow icon, and the like may be set. When the user inputs an instruction, the user can click the icon to achieve the purpose.
若某一网页标签已经被处理,则可以在多个网页标签中,将当前被处理的网页标签置前显示。这种排序方式有益于提高声音数据的控制效率,降低查找声音数据所在网页所造成的时间浪费。例如,用户关闭第一网页标签中的声音文件,将该网页标签排序到浏览器显示的第一位。后续,用户又想打开该声音文件,则直接打开第一位的网页标签即可,不需要再一个个网页标签去查找,达到提高声音数据的控制效率的目的。If a web page tag has been processed, the currently processed web page tag can be displayed in front of the plurality of web page tags. This sorting method is beneficial for improving the control efficiency of the sound data and reducing the waste of time caused by finding the webpage where the sound data is located. For example, the user closes the sound file in the first web page tab and sorts the web page label to the first place displayed by the browser. Subsequently, if the user wants to open the sound file, the first webpage label can be directly opened, and no one webpage label is needed to search, so as to improve the control efficiency of the sound data.
在用户选择的声音文件被控制之后,还可以在浮动窗口中提供其他信息,例如,可以提供没有被静音或者已被静音的音/视频文件的推荐链接,再例如,也可以提供针对音/视频文件相关的搜索工具链接。这些其他信息的提供可以由浏览器根据用户选择声音文件的相关信息进行分析得出,也可以由浏览器根据用户平时的浏览记录进行分析得出。After the sound file selected by the user is controlled, other information may also be provided in the floating window, for example, a recommended link of the audio/video file that is not muted or muted may be provided, and for example, may also be provided for audio/video. File related search tool links. The provision of these other information may be analyzed by the browser according to the information related to the user's selection of the sound file, or may be analyzed by the browser according to the usual browsing history of the user.
实施时,第一网页标签中的声音文件被控制之后,可以保存第一网页标签中被进行控制的声音文件的信息。为方便后续对已控制过的声音文件再次提取或者访问等处理操作,进一步,也可以将保存的声音文件的信息作为浏览器用户信息的一部分进行浏览器本地侧保存,或者,还可以将其进行网络侧的同步。若是保存在网络侧,则再次提取相应信息时,浏览器需要先到网络侧获取保存的相关信息,进而再次打开并进行后续控制操作。In implementation, after the sound file in the first webpage label is controlled, the information of the sound file controlled in the first webpage label may be saved. In order to facilitate subsequent processing operations such as re-extracting or accessing the controlled sound file, the information of the saved sound file may be saved as a part of the browser user information on the local side of the browser, or may be performed. Synchronization on the network side. If it is saved on the network side, when the corresponding information is extracted again, the browser needs to obtain the related information stored on the network side first, and then open and perform subsequent control operations.
现利用具体实施例对本发明实施例提供的浏览器中进行声音控制的具体方法进行详细的阐述和说明,以对网页静音为例。The specific method for performing sound control in the browser provided by the embodiment of the present invention is described and illustrated in detail by using a specific embodiment to take the mute of the webpage as an example.
本例中,通过在Windows系统中可以采用全新的Core Audio APIs函数来控制系统声音。应用程序通过这套API函数能够控制声音行为,比如播放音乐,还可以静音。In this case, the system sound can be controlled by using the new Core Audio APIs function in Windows. The application can control the sound behavior through this set of API functions, such as playing music and muting.
本例在实施时,以进程为基本单元(每个网页标签对应一个进程),进程可以包含多个声音通道(相应的,每个网页标签中可能会有多个声音文件或声音数据)。如果对某个进程静音,那么它包含的所有声音通道都不会发出声音。举个例子,某个网页标签上可以同时播放flash和mp3音乐,这样就包含了两个声音通道。如果对这个进程静音了,flash和mp3都没有声音了。In this example, when the process is the basic unit (each web page label corresponds to one process), the process can contain multiple sound channels (correspondingly, there may be multiple sound files or sound data in each web page label). If you mute a process, it will not sound from all of the sound channels it contains. For example, a web page tag can play both flash and mp3 music, which includes two sound channels. If you mute this process, there is no sound in both flash and mp3.
本例中首先对浏览器进行相应设置,对每个网页标签中的网页,都在一个单独的进程中打开。新开一个标签,就新创建了一个进程。对于多标签式浏览器,新打开的网页位于一个新的标签中,有一个id作为标识,简称“标签ID”或“tabid”。In this example, the browser is first set up, and the web pages in each web page tab are opened in a separate process. When you open a new tab, a new process is created. For multi-tab browsers, the newly opened web page is located in a new tab with an id as the identifier, referred to as "tag ID" or "tabid".
在进程创建时,记下进程ID(process_id)和标签ID的对应关系。When the process is created, note the correspondence between the process ID (process_id) and the tag ID.
数据结构为:[{tabid:process_id},{tabid:process_id}…]The data structure is: [{tabid:process_id}, {tabid:process_id}...]
当用户选择对某个网页tab静音时,根据tabid找到process_id,将process_id传给操作系统的API函数MuteProcess(process_id),达到静音的目的。When the user chooses to mute a webpage tab, the process_id is found according to the tabid, and the process_id is passed to the operating system's API function MuteProcess(process_id) to achieve the purpose of muting.
网页的打开流程请参见图5,包括步骤S502至步骤S506。 Referring to FIG. 5, the process of opening the webpage includes steps S502 to S506.
步骤S502、打开新网页,创建新的网页标签;Step S502, opening a new webpage, and creating a new webpage label;
步骤S504、为该网页创建新的网页进程;Step S504, creating a new webpage process for the webpage;
步骤S506、记录网页标签的tabid和网页进程的process_id以及两者的映射关系。Step S506, recording the tabid of the webpage label and the process_id of the webpage process and the mapping relationship between the two.
用户点击控制图标对网页进行静音操作的处理流程请参见图6,包括步骤S602至步骤S606。Please refer to FIG. 6 for the process of the user performing the mute operation on the webpage by clicking the control icon, including steps S602 to S606.
步骤S602、用户选择对某个网页进行静音,找到对应的网页标签的ID;Step S602, the user selects to mute a certain webpage, and finds an ID of the corresponding webpage label;
步骤S604、根据标签ID查找到进程ID,进而查找到相应的进程;Step S604, searching for the process ID according to the tag ID, and then finding the corresponding process;
步骤S606、调用系统API对进程进行静音。Step S606: Calling the system API to mute the process.
当有多个网页标签中具有声音时,会弹出界面(相当于浮动窗口)供用户进行进程声音的控制(设置可以发出声音的网页)。图7示出了根据本发明一个实施例的在一个浮动窗口显示多个网页标签的信息的示意图。图7中有4个网页标签,其中当前网页时标签百度网站的首页,另外的一个网页标签是播放着《敢死队2》的flash视频插件的网页,另外一个网页标签是播放着《爱的代价》的MP3音频插件的网页;还有一个网页标签是以Flash插件的形式加载的网页游戏《帝国时代》,其中也是播放着游戏的背景声音的。在上述的每一个网页标签在浏览器侧进行加载时,都会通过浏览器识别加载网页中的可能播放声音文件的插件的识别,例如Flash插件的加载或者MP3音频插件的加载(可以根据被调用的安装插件的CLSID识别出哪个插件被调用),从而获取到该插件所播放的音频、视频或者游戏网页的相关描述信息,例如声音文件的名称、类别、歌手信息等。这样在浏览器的状态栏中的声音控制按钮处进行点击后可以产生浮动窗口(也可以称为弹窗),在该弹窗中显示了三个声音文件,第一个是《敢死队2》的flash视频,第二个是mp3文件《爱的代价》,第三个是游戏《帝国时代》,具体参见附图7,被勾选的文件将会被静音,即该网页标签中的声音相关播放将被静音处理。在该浮动窗口中可以设置每个声音文件的控制按钮或图标,例如图7中的打开或关闭标识,点击该标识就能够打开或关闭相应的声音文件的声音。或者是将包含该被静音或者取消静音的网页变成当前网页标签,对网页标签头进行高亮显示。图7中的声音文件和控制图标都是枚举,对具体的网页标签以及相上的声音文件并不造成限定。在实际应用中,声音文件的数量取决于打开的网页标签的数量,可以是四个五个甚至更多。控制图标也可以包括其他标识,例如调节音量大小标识、播放标识等等。图7中所示的浮动窗口浮现在页面上的触发条件可以是用户点击浏览器状态栏中的声音符号(通常在状态栏中以喇叭的形象出现)。当然,也可以出现其他的触发条件,例如点击文件插件或者其他插件。也可以设置为每次打开网页标签时会自动出现该浮动窗口。上述该实施例中对于声音的静音处理,就是使用本发明前述实施例中的方案进行的,这里就不再进行赘述。When there are multiple webpage tags with sound, an interface (equivalent to a floating window) is popped up for the user to control the process sound (set the webpage that can make a sound). FIG. 7 shows a schematic diagram of displaying information of a plurality of web page tags in a floating window in accordance with one embodiment of the present invention. In Figure 7, there are 4 webpage tabs, where the current webpage is labeled with the home page of Baidu website, and the other webpage label is the webpage of the flash video plug-in that plays "Diagram 2", and another webpage label is playing "The Cost of Love". The webpage of the MP3 audio plug-in; there is also a webpage tag loaded with the Flash plug-in web game "Imperial Age", which also plays the background sound of the game. When each of the above webpage tags is loaded on the browser side, the browser recognizes the identification of the plugin that may play the sound file in the loaded webpage, such as the loading of the Flash plugin or the loading of the MP3 audio plugin (can be called according to the called The CLSID of the plugin is installed to identify which plugin is called, thereby obtaining related description information of the audio, video or game webpage played by the plugin, such as the name, category, and singer information of the sound file. In this way, after clicking on the sound control button in the status bar of the browser, a floating window (also called a pop-up window) can be generated, and three sound files are displayed in the pop-up window. The first one is "Diagram 2" Flash video, the second is the mp3 file "The Cost of Love", and the third is the game "Imperial Age". See Figure 7 for details. The checked file will be muted, that is, the sound related to the page label. Will be muted. In the floating window, a control button or icon of each sound file can be set, such as the open or close logo in FIG. 7, and clicking the logo enables the sound of the corresponding sound file to be turned on or off. Or, the webpage containing the mute or unmute is changed into the current webpage label, and the webpage label header is highlighted. The sound file and the control icon in FIG. 7 are enumerated, and the specific web page label and the sound file on the opposite side are not limited. In practical applications, the number of sound files depends on the number of open webpage tags, which can be four or more. The control icon can also include other identifications, such as adjusting the volume level identification, playing the identification, and the like. The trigger condition shown in Figure 7 for the floating window to appear on the page may be that the user clicks on the sound symbol in the browser status bar (usually appears as a horn in the status bar). Of course, other trigger conditions can also occur, such as clicking on a file plugin or other plugin. It can also be set to automatically appear when you open a web page label each time. The mute processing for the sound in the above embodiment is performed using the solution in the foregoing embodiment of the present invention, and details are not described herein.
当有声音发出的网页需要直接打开时,可以通过上述图7中显示的界面进行指定页面的直接打开,便于用户在众多的网页便签中直接打开有声音的网页,例如是使得该标签置前高亮显示,免得用户在众多网页标签中进行寻找。When a webpage with a sound needs to be directly opened, the specified page can be directly opened through the interface shown in FIG. 7 above, so that the user can directly open the webpage with sound in a plurality of webpage notes, for example, the label is placed high. Brightly displayed, so that users can not find it in many webpage tags.
对于图7所呈现的界面中加载的信息,还可以包括网页标签的标题、播放的有声音 文件的类型、声音文件的名称等,这些数据均可以从网页标签中进行获取。For the information loaded in the interface presented in FIG. 7, the title of the webpage label and the sound played by the webpage may also be included. The type of the file, the name of the sound file, etc., can be obtained from the web page label.
图8示出了根据本发明一个实施例的在一个浮动窗口显示声音文件的控制信息的示意图。该控制信息可以集成在浏览器的已有插件中进行实现,也可以在浏览器中生成一个新的插件用于实现该控制信息。参见图8,本例是将控制信息集成在浏览器的已有插件中进行实现。当用户打开一个弹窗(例如用户右键单击网页标签),在该弹窗中呈现出声音文件的控制信息。图8中,有两个网页标签,其中的一个是百度的搜索页面。另外一个是百度的音乐盒其中正在通过MP3的播放插件播放任贤齐的《永不退缩》的歌曲,在加载该百度音乐盒的网页时,识别出其中加载了MP3播放插件(具体细节参见图7中对应的实施例中的揭示),获取到该播放音乐的歌曲名称、歌手信息以及当前网页标题信息等。声音文件是任贤齐的《永不退缩》的mp3文件,声音文件的信息可以从网页标签中获取,例如作者、所属专辑、文件类型、时长等等。控制信息则优选可以包括开始、声音变大、声音变小以及静音选项,其给出的链接都会激发产生一个对于当前网页进程中对于声音控制的对应指令,并发到浏览器侧的操作系统的API函数进行对应的声音控制,具体的技术细节还请参见本发明前述实施例中的技术揭示。在图8所示可知,虽然当前网页标签中没有声音文件的存在,但是在当前网页标签中右键点击时可以查看到整个所有网页标签中有声音播放的文件的信息,并可以进行相应的控制操作。当然所述的当前网页标签中也是可以带有声音文件的,这里就不再赘述。需要说明的是,和图7相类似,图8也仅仅是一个示意图,若浏览器中还存在其他的声音文件,也可以在浮动窗口中显现其他声音文件的相关信息以及相应的控制信息,即浮动窗口可以出现对一个网页标签中的多个声音文件的声音播放进行控制,或者对多个网页标签中的声音文件的声音播放进行控制。上述该实施例中对于声音的控制处理,就是使用本发明前述实施例中的方案进行的,这里就不再进行赘述。FIG. 8 shows a schematic diagram of control information for displaying a sound file in a floating window in accordance with one embodiment of the present invention. The control information can be integrated into the existing plug-in of the browser, or a new plug-in can be generated in the browser for implementing the control information. Referring to Figure 8, this example is implemented by integrating control information into an existing plug-in of the browser. When the user opens a pop-up window (for example, the user right-clicks on the web page tab), the control information of the sound file is presented in the pop-up window. In Figure 8, there are two web page tags, one of which is Baidu's search page. The other one is Baidu's music box, which is playing the song of "Never Retreat" by Ren Xianqi through the MP3 player plug-in. When loading the page of the Baidu music box, it recognizes that the MP3 player plug-in is loaded (see Figure 7 for details). In the corresponding embodiment, the song name, the singer information, the current web page title information, and the like of the played music are acquired. The sound file is the mp3 file of Ren Xianqi's "Never Retreat". The information of the sound file can be obtained from the webpage label, such as the author, the album, the file type, the duration, and so on. The control information may preferably include a start, a louder sound, a smaller sound, and a mute option, the given link triggering an API that generates a corresponding command for the sound control in the current web page process and concurrently to the browser side. The function performs corresponding sound control. For specific technical details, please refer to the technical disclosure in the foregoing embodiments of the present invention. As shown in FIG. 8, although there is no sound file in the current webpage label, when right-clicking in the current webpage tab, the information of the file having the sound playing in all the webpage tabs can be viewed, and the corresponding control operation can be performed. . Of course, the current webpage label can also carry a sound file, and will not be described here. It should be noted that, similar to FIG. 7, FIG. 8 is only a schematic diagram. If other sound files exist in the browser, related information of other sound files and corresponding control information may also be displayed in the floating window, that is, Floating windows can control the sound playback of multiple sound files in a web page tag, or control the sound playback of sound files in multiple web page tags. The control processing for the sound in the above embodiment is performed using the solution in the foregoing embodiment of the present invention, and details are not described herein.
除控制信息外,图8还示意在浮动窗口中提供一些与控制的声音文件相关的链接,例如任贤齐的其他歌曲的推荐,该推荐可以是由浏览器对应的服务器侧主动推荐下来的。进一步地,再例如可以提供一歌曲的搜索框(即常用的搜索引擎),方便用户进行更多歌曲信息的获取。In addition to the control information, FIG. 8 also illustrates providing some links related to the controlled sound file in the floating window, such as the recommendation of other songs of Ren Xianqi, which may be actively recommended by the server side corresponding to the browser. Further, for example, a search box of a song (ie, a commonly used search engine) may be provided to facilitate the user to obtain more song information.
由上述实施例的描述可知,本实施例增加了单独控制网页静音的功能,提升了用户体验。As can be seen from the description of the foregoing embodiment, this embodiment adds a function of separately controlling the mute of the webpage, thereby improving the user experience.
根据本发明实施例提供的方法和装置,能够达到如下有益效果:According to the method and apparatus provided by the embodiments of the present invention, the following beneficial effects can be achieved:
在本发明实施例中,当存在至少一个网页标签时,可以分别利用每个网页标签的页面进程对该网页标签中的声音进行控制,而不是由一个统一的静音功能或者函数对所有的网页标签中的声音进行统一的控制。由此可见,本发明实施例能够针对每个网页标签中的声音进行单独控制,提高网页声音控制的精准性,提高用户的感受体验。In the embodiment of the present invention, when there is at least one webpage label, the sound of the webpage label may be controlled by using the page process of each webpage label separately, instead of all the webpage labels by a unified mute function or function. The sound in the control is unified. It can be seen that the embodiment of the present invention can separately control the sound in each webpage label, improve the accuracy of the webpage sound control, and improve the user's feeling experience.
本发明又一个实施例提供了一种浏览器中进行声音控制的方法,实现一种基于标签(Tab)的、对不同标签中声音分别控制的方案,参见图9,该方法包括如下步骤: A further embodiment of the present invention provides a method for performing sound control in a browser, which implements a tab-based scheme for separately controlling sounds in different labels. Referring to FIG. 9, the method includes the following steps:
S900:在浏览器中创建网页标签,并为网页标签创建一个与浏览器的主进程相独立的标签进程。S900: Create a web page tag in the browser and create a tag process for the web page tag that is independent of the browser's main process.
在浏览器中创建一个新的网页标签时,对生成一个页面创建通知,本实施例对该页面创建通知进行拦截,为浏览器的每个网页标签创建一个独立的进程。When a new webpage label is created in the browser, a notification is generated for generating a page. In this embodiment, the notification of the page creation is intercepted, and an independent process is created for each webpage label of the browser.
可选的,在为网页标签创建一个与浏览器的主进程相独立的标签进程之前,上述方法还包括:识别所创建的网页标签中是否包括音视频文件,若是,为该网页标签创建一个与浏览器的主进程相独立的标签进程,若否,不为该网页标签创建一个与浏览器的主进程相独立的标签进程。这种处理方式,对于不包含音视频文件的网页,就不在独立进程中进行加载,以免浏览器中启动的进程过多,降低浏览器的效率。Optionally, before creating a label process independent of the main process of the browser for the webpage label, the method further includes: identifying whether the created webpage label includes an audio/video file, and if so, creating a The browser's main process is a separate tag process. If not, a tag process that is independent of the browser's main process is not created for the web page tag. This type of processing, for web pages that do not contain audio and video files, is not loaded in a separate process, so as to avoid too many processes starting in the browser and reduce the efficiency of the browser.
可选的,上述在浏览器中创建网页标签包括:Optionally, the foregoing creating a webpage label in the browser includes:
若浏览器中存在至少一个被静音的网页标签,判断新创建的网页标签中包括音视频文件时,向浏览器用户发送进入静音模式的提示信息,或者设置主进程的展示界面进入静音控制界面。这种处理方式,当已经存在一个或多个网页标签的声音被拦截(被静音)时,若判断新打开的网页标签中也有声音时(即在新Tab页的加载时判断该网页标签中也有声音),发送信息提示用户进入到静音模式下,或者进入静音控制的界面中,接收用户对网页标签是否静音的选择指令,根据该指令对新打开的网页标签中的声音进行控制,以保证在多个有音视频的网页标签中只有一个网页标签在播放声音。If at least one muted webpage label exists in the browser, and it is determined that the newly created webpage label includes an audio/video file, the browser user is sent a prompt message to enter the silent mode, or the display interface of the main process is set to enter the mute control interface. In this way, when the sound of one or more webpage tags is already intercepted (mute), if it is judged that there is sound in the newly opened webpage label (that is, when the new tabpage is loaded, it is judged that the webpage label also has Sound), send a message prompting the user to enter the silent mode, or enter the mute control interface, receive the user's selection instruction for whether the webpage label is muted, and control the sound in the newly opened webpage label according to the instruction to ensure that Only one of the webpage tags with multiple audio and video tags is playing a sound.
S902:建立网页标签与标签进程之间的映射关系,将该映射关系保存在主进程中,以在主进程的展示界面中控制网页标签中的声音。S902: Establish a mapping relationship between the webpage label and the labeling process, and save the mapping relationship in the main process to control the sound in the webpage label in the display interface of the main process.
可选的,一种方式下,建立标签进程标识(ID)与网页标签的标题之间的映射关系,则这种方式下将标签进程ID和网页标签的标题保存在主进程中;另一种方式下,建立标签进程ID与网页标签的标题、URL(Uniform Resource Locator,统一资源定位符)之间的映射关系,则这种方式下将标签进程ID、网页标签的标题和URL保存在主进程中。Optionally, in a manner, establishing a mapping relationship between the label process identifier (ID) and the title of the webpage label, in this manner, the label process ID and the title of the webpage label are saved in the main process; In this manner, the mapping relationship between the label process ID and the title of the webpage label and the URL (Uniform Resource Locator) is established. In this manner, the label process ID, the title of the webpage label, and the URL are saved in the main process. in.
在建立映射关系时,可以采用上述两种方式中的任一种或者同时采用上述两种方式。When establishing a mapping relationship, either of the above two methods or both of the above methods may be used.
S904:将通过主进程的展示界面输入的声音控制指令发送至标签进程。S904: Send a sound control instruction input through the display interface of the main process to the label process.
上述声音控制指令至少包括指示禁止网页标签中声音输出的声音控制指令和指示允许网页标签中声音输出的声音控制指令。The sound control command includes at least a sound control command for prohibiting sound output in the web page tab and a sound control command for instructing sound output in the web page tab.
即本步骤中根据声音控制指令拦截网页标签对音频应用接口的调用,以禁止网页标签中声音的输出,即禁止声音信号传递至声卡;和/或,根据声音控制指令允许网页标签对音频应用接口的调用,以实现网页标签中声音的输出。这种允许网页标签对音频应用接口的调用的操作,一种情况为,在新打开的网页标签加载时根据声音控制指令就允许该网页标签调用音频应用接口,输出声音,另一种情况为在网页标签中的声音被拦截后,根据声音控制指令解除拦截操作,恢复对音频应用接口的调用。That is, in this step, the call of the webpage label to the audio application interface is intercepted according to the sound control instruction to prohibit the output of the sound in the webpage label, that is, the sound signal is prohibited from being transmitted to the sound card; and/or, according to the sound control instruction, the webpage label is allowed to interface with the audio application. The call to achieve the output of the sound in the web page tag. The operation of allowing the webpage tag to call the audio application interface, in one case, the webpage tag is allowed to call the audio application interface to output the sound according to the sound control instruction when the newly opened webpage tag is loaded, and the other case is After the sound in the webpage tag is intercepted, the interception operation is cancelled according to the sound control instruction, and the call to the audio application interface is resumed.
S906:根据声音控制指令通过网页标签中的音频应用接口,对网页标签中的声音进行控制。S906: Control the sound in the webpage label through the audio application interface in the webpage label according to the sound control instruction.
可选的,上述音频应用接口包括下述的至少一种接口函数: Optionally, the foregoing audio application interface includes at least one interface function as follows:
波形输出(waveOutWrite)接口函数、midi数据流输出(midiStreamOut)接口函数、客户端音频渲染(IAudioRenderClient)接口函数、音频创建(DirectSoundCreate)接口函数和音频创建8(DirectSoundCreate8)接口函数。WaveOutWrite interface function, midi stream output interface (midiStreamOut) interface function, client audio rendering (IAudioRenderClient) interface function, audio creation (DirectSoundCreate) interface function and audio creation 8 (DirectSoundCreate8) interface function.
下面分别对上述接口函数的具体内容进行说明。The specific content of the above interface function will be described below.
waveOutWrite接口函数waveOutWrite interface function
waveOutWrite接口函数能够发送一个数据到波形音频输出设备,具体结构如下述代码所示:The waveOutWrite interface function can send a data to the waveform audio output device, as shown in the following code:
Figure PCTCN2014091469-appb-000001
Figure PCTCN2014091469-appb-000001
其中,参数hwo表示波形音频输出设备的句柄,参数pwh指向WAVEHDR结构体指针,参数cbwh表示WAVEHDR结构体大小。Among them, the parameter hwo represents the handle of the waveform audio output device, the parameter pwh points to the WAVEHDR structure pointer, and the parameter cbwh represents the size of the WAVEHDR structure.
对于waveOutWrite接口函数的返回值,函数调用成功时返回MMSYSERR_NOERROR,失败时返回的值参见下述表1。For the return value of the waveOutWrite interface function, MMSYSERR_NOERROR is returned when the function call succeeds. The values returned on failure are shown in Table 1 below.
表1Table 1
值(Value)Value 描述(Description)Description
MMSYSERR_INVALHANDLEMMSYSERR_INVALHANDLE 设备句柄无效Device handle is invalid
MMSYSERR_NODRIVERMMSYSERR_NODRIVER 当前没有播放设备There is currently no playback device
MMSYSERR_NOMEMMMSYSERR_NOMEM 内存不足Not enough storage
WAVERR_UNPREPAREDWAVERR_UNPREPARED 数据块没有准备好The data block is not ready
midiStreamOut接口函数midiStreamOut interface function
midiStreamOut接口函数播放一个流(缓冲)或MIDI(Musical Instrument Digital Interface,乐器数字接口)数据到一个MIDI输出设备,具体结构如下述代码所示:The midiStreamOut interface function plays a stream (buffer) or MIDI (Musical Instrument Digital Interface) data to a MIDI output device, as shown in the following code:
Figure PCTCN2014091469-appb-000002
Figure PCTCN2014091469-appb-000002
其中,参数hMidiStream表示MIDI流的句柄;参数lpMidiHdr指向MIDIHDR的结构体,用于表示一个midi数据;参数cbMidiHdr表示MIDIHDR结构体的大小。Among them, the parameter hMidiStream represents the handle of the MIDI stream; the parameter lpMidiHdr points to the MIDIHDR structure for representing a midi data; the parameter cbMidiHdr represents the size of the MIDIHDR structure.
对于midiStreamOut接口函数的返回值,函数调用成功时返回MMSYSERR_NOERROR,失败时返回的值参见下述表2。For the return value of the midiStreamOut interface function, MMSYSERR_NOERROR is returned when the function call succeeds. The values returned on failure are shown in Table 2 below.
表2 Table 2
值(Value)Value 描述(Description)Description
MMSYSERR_NOMEMMMSYSERR_NOMEM 内存不足Not enough storage
MIDIERR_STILLPLAYINGMIDIERR_STILLPLAYING Midi流以及在播放了Midi stream and playing
MIDIERR_UNPREPAREDMIDIERR_UNPREPARED Midi流没有准备好Midi stream is not ready
MMSYSERR_INVALHANDLEMMSYSERR_INVALHANDLE Midi句柄无效Midi handle is invalid
MMSYSERR_INVALPARAMMMSYSERR_INVALPARAM Midi流无效Midi stream is invalid
IAudioRenderClient接口函数IAudioRenderClient interface function
IAudioRenderClient接口函数允许客户端写数据缓冲区渲染端点。客户端获得IAudioRenderClient接口引用的一个流对象是通过调用IAudioClient::GetService方法并设置参数为REFIID IID_IAudioRenderClient riid。The IAudioRenderClient interface function allows the client to write data buffers to render endpoints. The client obtains a stream object referenced by the IAudioRenderClient interface by calling the IAudioClient::GetService method and setting the parameter to REFIID IID_IAudioRenderClient riid.
这个接口函数管理的数据包包含音频呈现数据。一个数据包的长度表示为音频帧的数量包。一个音频帧的大小指定了nBlockAlign WAVEFORMATEX的成员结构。字节大小的一个音频帧数等于通道流乘以每通道的样本大小。例如,音频帧大小是4个字节为一个立体声(2声道)流与16位样本。一个数据包总是包含一个整数的音频帧。The data packet managed by this interface function contains audio rendering data. The length of a packet is expressed as the number of packets of the audio frame. The size of an audio frame specifies the member structure of nBlockAlign WAVEFORMATEX. The number of audio frames in a byte size is equal to the channel stream multiplied by the sample size per channel. For example, the audio frame size is 4 bytes for a stereo (2 channel) stream with 16 bit samples. A packet always contains an integer number of audio frames.
DirectSoundCreate8接口函数DirectSoundCreate8 interface function
DirectSoundCreate8接口函数用到DSound.h文件和Dsound.lib文件,该函数的具体结构如下代码所示:The DirectSoundCreate8 interface function uses the DSound.h file and the Dsound.lib file. The specific structure of the function is shown in the following code:
HRESULT DirectSoundCreate8(HRESULT DirectSoundCreate8(
LPCGUID lpcGuidDevice,//声卡设备全局标志,一般是NULL,表示默认的声卡LPCGUID lpcGuidDevice, / / sound card device global flag, generally NULL, indicating the default sound card
LPDIRECTSOUND8*ppDS8,//返回的IDirectSound8接口对象指针LPDirectSOUND8*ppDS8, / / returned IDirectSound8 interface object pointer
LPUNKNOWN pUnkOuter//必须为NULL,因为集合不被支持LPUNKNOWN pUnkOuter / / must be NULL, because the collection is not supported
))
一个网页标签中可以包括waveOutWrite接口函数、midiStreamOut接口函数、IAudioRenderClient接口函数、DirectSoundCreate接口函数和DirectSoundCreate8接口函数中的一种或多种,则根据声音控制指令通过该网页标签中存在的音频应用接口对网页标签中的声音进行控制。A webpage tag may include one or more of a waveOutWrite interface function, a midiStreamOut interface function, an IAudioRenderClient interface function, a DirectSoundCreate interface function, and a DirectSoundCreate8 interface function, and the webpage is present through the audio application interface existing in the webpage tag according to the sound control instruction. The sound in the label is controlled.
本发明实施例通过建立与浏览器主进程相独立的标签进程的技术手段,使不同的网页标签进程相分离,避免了对一个网页的声音控制对其它网页的声音状态造成影响,保证了对每个网页中的声音单独控制;以及,本发明实施例通过主进程的展示界面接收声音控制指令并调用相应音频应用接口的技术手段,提供了对单个网页中声音控制的具体实现方式。本技术方案能够对各浏览器标签页的声音分别进行控制,提高了浏览器的性能和用户体验。 The embodiment of the present invention separates different webpage label processes by establishing a technical process of a label process independent of the main process of the browser, thereby avoiding the influence of the sound control of one webpage on the sound state of other webpages, and ensuring that each The sounds in the webpages are individually controlled; and the embodiment of the present invention provides a specific implementation manner of sound control in a single webpage by receiving sound control commands through the display interface of the main process and calling the technical means of the corresponding audio application interface. The technical solution can separately control the sound of each browser tab, thereby improving the performance and user experience of the browser.
下面结合图10,对本发明又一个实施例提供的浏览器中进行声音控制的方法进行说明。本实施例中主要对浏览器主进程对标签进程的控制方式以及两者之间的通信方式进行说明,浏览器中进行声音控制的方法中的其他内容参见本发明的其他实施例。参见图10,该方法包括如下步骤:A method for performing sound control in a browser provided by still another embodiment of the present invention will be described below with reference to FIG. In this embodiment, the manner in which the main process of the browser controls the label process and the communication mode between the two are mainly described. Other contents in the method for performing sound control in the browser are referred to other embodiments of the present invention. Referring to Figure 10, the method includes the following steps:
S1000:创建与浏览器主进程独立的标签进程。S1000: Create a label process that is independent of the browser's main process.
在浏览器中打开新网页标签时,创建一个与浏览器主进程相分离的标签进程并建立网页标签与标签之间的映射关系。该标签进程和主进程的运行互不影响,对一个标签进程中数据的操作不会影响主进程或其他标签进程中的数据运行。When a new web page tag is opened in the browser, a tag process separate from the main browser process is created and a mapping relationship between the web page tag and the tag is established. The tag process and the running of the main process do not affect each other. The operation of data in a tag process does not affect the data running in the main process or other tag processes.
在标签进程创建成功后,浏览器中生成指示标签进程创建完成的消息,监测到该消息时获知标签进程创建完成。After the label process is successfully created, a message indicating that the label process is created is generated in the browser, and the label process is completed when the message is detected.
S1002:将映射关系传递至主进程。S1002: Pass the mapping relationship to the main process.
当标签打开一个页面的时候,标签所在的标签进程将自己的信息(映射关系)发送给主进程,并可以显示在展示界面中。之后用户就可以通过展示界面单独对每一个网页标签是否静音进行控制。When a tag opens a page, the tag process in which the tag is located sends its own information (mapping relationship) to the main process and can be displayed in the display interface. After that, the user can individually control whether each webpage label is muted through the display interface.
建立的映射关系的具体内容不同时,传递至主进程的信息也不同,例如,一种方式下,建立标签进程ID与网页标签的标题之间的映射关系,则这种方式下将标签进程ID和网页标签的标题传递至主进程中;另一种方式下,建立标签进程ID与网页标签的标题、网页标签的URL之间的映射关系,则这种方式下将标签进程ID、网页标签的标题和URL传递至主进程中。When the specific content of the established mapping relationship is different, the information transmitted to the main process is also different. For example, in one mode, the mapping relationship between the label process ID and the title of the webpage label is established, and the label process ID is set in this manner. And the title of the webpage label is passed to the main process; in another way, the mapping relationship between the label process ID and the title of the webpage label and the URL of the webpage label is established, and in this way, the label process ID and the webpage label are The title and URL are passed to the main process.
进一步的,本实施例中当需要从标签进程向主进程传递信息或者需要从主进程向标签进程传递信息时,信息的发送端首先将信息的内容(例如,要执行的函数以及函数的参数)编码为统一的格式,然后将编码后的信息通过IPC(Inter-Process Communication,进程间通信)通道发送给对应的进程的消息循环,接收端收到之后按照统一的编码格式获知信息的内容,然后调用相关的函数执行操作。Further, in this embodiment, when it is required to transfer information from the label process to the main process or needs to transfer information from the main process to the label process, the sender of the information firstly sets the content of the information (for example, a function to be executed and a parameter of the function). Encoding is a unified format, and then the encoded information is sent to the corresponding process message loop through the IPC (Inter-Process Communication) channel, and the receiving end receives the content of the information according to the unified encoding format, and then Call the relevant function to perform the operation.
其中,本实施中分别为主进程和标签进程创建一个消息循环,主进程和标签进程分别利用该消息循环来接收来自对端的信息,解析信息中的内容并根据该内容调用函数执行操作。In this implementation, a message loop is created for the main process and the label process respectively, and the main process and the label process respectively use the message loop to receive information from the peer, parse the content in the information, and execute the operation according to the content calling function.
另外,一些浏览器(如360安全浏览器)的进程间的通信机制有同步和异步两种,在本实施例的方案中,考虑到对声音的控制操作对实时性要求不高,采用的是异步的通信方案。In addition, the communication mechanism between processes of some browsers (such as the 360 security browser) is synchronous and asynchronous. In the solution of this embodiment, considering that the control operation of the sound is not required for real-time performance, the adoption is Asynchronous communication scheme.
S1004:保存映射关系。S1004: Save the mapping relationship.
浏览器的主界面所在的进程为主进程,主进程管理各个网页标签的状态显示和控制各个网页标签是否静音。将网页标签和标签进程之间的映射关系保存在主进程中。主进程根据该映射关系在展示界面显示网页标签的相关信息,如每个标签的标题、URL以及是否静音的状态。The process in which the main interface of the browser is located is the main process, and the main process manages the status display of each web page label and controls whether each web page label is muted. The mapping between the web page tag and the tag process is saved in the main process. The main process displays information about the webpage label on the display interface according to the mapping relationship, such as the title of each label, the URL, and the status of whether or not to mute.
S1006:主进程通知标签进程静音。 S1006: The main process notifies the label process to mute.
用户可以通过点击在展示界面上的标签进程的信息,向主进程发送声音控制指令。主进程接收到用户修改静音状态的声音控制指令之后,主进程再通知到对应标签所在的进程,标签所在进程接收到静音控制信号后,改变当前是否对声音播放进行拦截。The user can send a sound control command to the main process by clicking on the information of the tag process on the display interface. After the main process receives the voice control command of the user to modify the mute state, the main process notifies the process of the corresponding tag, and the process of the tag receives the mute control signal, and then changes whether the current play is intercepted.
图10示出的场景中为将网页标签的静音状态修改为静音的场景,可以理解,采用相同的方法也可以将网页标签的静音状态修改为播放。In the scenario shown in FIG. 10, in order to modify the mute state of the webpage label to be muted, it can be understood that the mute state of the webpage label can also be modified to play by the same method.
S1008:拦截播放声音的音频应用接口。S1008: Intercept the audio application interface that plays the sound.
对接收到通知静音的声音控制指令的网页标签中存在的音频应用接口进行拦截,禁止该网页标签中的声音信号输出至声卡。The audio application interface existing in the webpage tag of the voice control command that receives the notification mute is intercepted, and the sound signal in the webpage tag is prohibited from being output to the sound card.
S1010:网页标签中的声音都被拦截,实现了对该网页标签的静音。S1010: The sound in the webpage label is intercepted, and the label of the webpage is muted.
本发明又一个实施例提供了一种浏览器。参见图11,该浏览器包括创建单元1110、映射单元1112、发送单元1114、控制单元1116、识别单元1118和判断单元1120。下面分别进行说明。Yet another embodiment of the present invention provides a browser. Referring to FIG. 11, the browser includes a creating unit 1110, a mapping unit 1112, a transmitting unit 1114, a control unit 1116, an identifying unit 1118, and a determining unit 1120. The following description will be respectively made.
创建单元1110适于在浏览器中创建网页标签,并为网页标签创建一个与浏览器的主进程相独立的标签进程。该标签进程和主进程的运行互不影响,对一个标签进程中数据的操作不会影响主进程或其他标签进程中的数据运行。The creation unit 1110 is adapted to create a web page tag in the browser and create a tag process for the web page tag that is separate from the main process of the browser. The tag process and the running of the main process do not affect each other. The operation of data in a tag process does not affect the data running in the main process or other tag processes.
映射单元1112适于建立网页标签与标签进程之间的映射关系,将该映射关系保存在主进程中,以在主进程的展示界面中控制网页标签中的声音。可选的,映射单元1112适于建立标签进程ID与网页标签的标题之间的映射关系,和/或,建立标签进程ID与网页标签的标题、统一资源定位符URL之间的映射关系;以及,将标签进程ID和网页标签的标题保存在主进程中,和/或,,将标签进程ID、网页标签的标题和URL保存在主进程中。The mapping unit 1112 is adapted to establish a mapping relationship between the webpage label and the labeling process, and save the mapping relationship in the main process to control the sound in the webpage label in the display interface of the main process. Optionally, the mapping unit 1112 is adapted to establish a mapping relationship between the label process ID and the title of the webpage label, and/or establish a mapping relationship between the label process ID and the title of the webpage label, and the uniform resource locator URL; The tag process ID and the title of the web page tag are saved in the main process, and/or, the tag process ID, the title of the web page tag, and the URL are saved in the main process.
发送单元1114适于将通过主进程的展示界面输入的声音控制指令发送至标签进程。The transmitting unit 1114 is adapted to send a sound control instruction input through the presentation interface of the main process to the tag process.
控制单元1116适于根据声音控制指令通过网页标签中的音频应用接口,对网页标签中的声音进行控制。可选的,音频应用接口包括下述的至少一种接口函数:waveOutWrite接口函数、midiStreamOut接口函数、IAudioRenderClient接口函数、DirectSoundCreate接口函数和DirectSoundCreate8接口函数。可选的,控制单元1116适于根据声音控制指令拦截网页标签对音频应用接口的调用,以禁止网页标签中声音的输出;和/或,根据声音控制指令允许网页标签对音频应用接口的调用,以实现网页标签中声音的输出。The control unit 1116 is adapted to control the sound in the web page tag via the audio application interface in the web page tag in accordance with the sound control command. Optionally, the audio application interface includes at least one of the following interface functions: a waveOutWrite interface function, a midiStreamOut interface function, an IAudioRenderClient interface function, a DirectSoundCreate interface function, and a DirectSoundCreate8 interface function. Optionally, the control unit 1116 is adapted to intercept the call of the webpage label to the audio application interface according to the sound control instruction to prohibit the output of the sound in the webpage label; and/or, according to the sound control instruction, allow the webpage label to invoke the audio application interface, To achieve the output of the sound in the web page tag.
可选的,浏览器还包括识别单元1118适于在为网页标签创建一个与浏览器的主进程相独立的标签进程之前,识别所创建的网页标签中是否包括音视频文件,若是,为该网页标签创建一个与浏览器的主进程相独立的标签进程,若否,不为该网页标签创建一个与浏览器的主进程相独立的标签进程。Optionally, the browser further includes an identifying unit 1118, configured to: before creating a label process independent of the main process of the browser for the webpage label, identifying whether the created webpage label includes an audio/video file, and if so, the webpage The tag creates a tag process that is separate from the browser's main process. If not, it does not create a tag process that is separate from the browser's main process for the page tag.
可选的,浏览器还包括判断单元1120适于若浏览器中存在至少一个被静音的网页标签,判断新创建的网页标签中包括音视频文件时,向浏览器用户发送进入静音模式的提示信息,或者设置展示界面进入静音控制界面 Optionally, the browser further includes: the determining unit 1120 is configured to: if there is at least one muted webpage label in the browser, and determine that the newly created webpage label includes the audio and video file, send the prompt information to the browser user to enter the silent mode. , or set the display interface to enter the mute control interface
本发明产品实施例中各单元的具体工作方式可以参见本发明方法实施例的相关内容,在此不再赘述。For the specific working mode of each unit in the embodiment of the present invention, reference may be made to the related content of the method embodiment of the present invention, and details are not described herein again.
本发明实施例通过建立与浏览器主进程相独立的标签进程的技术手段,使不同的网页标签进程相分离,避免了对一个网页的声音控制对其它网页的声音状态造成影响,保证了对每个网页中的声音单独控制;以及,本发明实施例通过主进程的展示界面接收声音控制指令并调用相应音频应用接口的技术手段,提供了对单个网页中声音控制的具体实现方式。本技术方案能够对各浏览器标签页的声音分别进行控制,提高了浏览器的性能和用户体验。The embodiment of the present invention separates different webpage label processes by establishing a technical process of a label process independent of the main process of the browser, thereby avoiding the influence of the sound control of one webpage on the sound state of other webpages, and ensuring that each The sounds in the webpages are individually controlled; and the embodiment of the present invention provides a specific implementation manner of sound control in a single webpage by receiving sound control commands through the display interface of the main process and calling the technical means of the corresponding audio application interface. The technical solution can separately control the sound of each browser tab, thereby improving the performance and user experience of the browser.
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. However, it is understood that the embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques are not shown in detail so as not to obscure the understanding of the description.
类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, the various features of the invention are sometimes grouped together into a single embodiment, in the above description of the exemplary embodiments of the invention, Figure, or a description of it. However, the method disclosed is not to be interpreted as reflecting the intention that the claimed invention requires more features than those recited in the claims. Rather, as the following claims reflect, inventive aspects reside in less than all features of the single embodiments disclosed herein. Therefore, the claims following the specific embodiments are hereby explicitly incorporated into the embodiments, and each of the claims as a separate embodiment of the invention.
本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art will appreciate that the modules in the devices of the embodiments can be adaptively changed and placed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and further they may be divided into a plurality of sub-modules or sub-units or sub-components. In addition to such features and/or at least some of the processes or units being mutually exclusive, any combination of the features disclosed in the specification, including the accompanying claims, the abstract and the drawings, and any methods so disclosed, or All processes or units of the device are combined. Each feature disclosed in this specification (including the accompanying claims, the abstract and the drawings) may be replaced by alternative features that provide the same, equivalent or similar purpose.
此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features that are included in other embodiments and not in other features, combinations of features of different embodiments are intended to be within the scope of the present invention. Different embodiments are formed and formed. For example, in the following claims, any one of the claimed embodiments can be used in any combination.
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的浏览器中进行声音控制的浏览器中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有 一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。The various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all of some or all of the components of the browser for sound control in a browser in accordance with an embodiment of the present invention. All features. The invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein. Such a program implementing the present invention may be stored on a computer readable medium or may have The form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
例如,图12示出了可以实现根据本发明的浏览器中进行声音控制的方法的计算设备。该计算设备传统上包括处理器1210和以存储器1220形式的计算机程序产品或者计算机可读介质。存储器1220可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。存储器1220具有用于执行上述方法中的任何方法步骤的程序代码1231的存储空间1230。例如,用于程序代码的存储空间1230可以包括分别用于实现上面的方法中的各种步骤的各个程序代码1231。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。这些计算机程序产品包括诸如硬盘,紧致盘(CD)、存储卡或者软盘之类的程序代码载体。这样的计算机程序产品通常为如参考图13所述的便携式或者固定存储单元。该存储单元可以具有与图12的计算设备中的存储器1220类似布置的存储段、存储空间等。程序代码可以例如以适当形式进行压缩。通常,存储单元包括计算机可读代码1231’,即可以由例如诸如1210之类的处理器读取的代码,这些代码当由计算设备运行时,导致该计算设备执行上面所描述的方法中的各个步骤。For example, Figure 12 illustrates a computing device that can implement a method of sound control in a browser in accordance with the present invention. The computing device conventionally includes a processor 1210 and a computer program product or computer readable medium in the form of a memory 1220. The memory 1220 may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read Only Memory), an EPROM, a hard disk, or a ROM. Memory 1220 has a memory space 1230 for program code 1231 for performing any of the method steps described above. For example, storage space 1230 for program code may include various program codes 1231 for implementing various steps in the above methods, respectively. The program code can be read from or written to one or more computer program products. These computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks. Such a computer program product is typically a portable or fixed storage unit as described with reference to FIG. The storage unit may have storage segments, storage spaces, and the like that are similarly arranged to memory 1220 in the computing device of FIG. The program code can be compressed, for example, in an appropriate form. Typically, the storage unit includes computer readable code 1231 ', ie, code readable by a processor, such as 1210, that when executed by a computing device causes the computing device to perform each of the methods described above step.
本文中所称的“一个实施例”、“实施例”或者“一个或者多个实施例”意味着,结合实施例描述的特定特征、结构或者特性包括在本发明的至少一个实施例中。此外,请注意,这里“在一个实施例中”的词语例子不一定全指同一个实施例。"an embodiment," or "an embodiment," or "an embodiment," In addition, it is noted that the phrase "in one embodiment" is not necessarily referring to the same embodiment.
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It is to be noted that the above-described embodiments are illustrative of the invention and are not intended to be limiting, and that the invention may be devised without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as a limitation. The word "comprising" does not exclude the presence of the elements or steps that are not recited in the claims. The word "a" or "an" The invention can be implemented by means of hardware comprising several distinct elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means can be embodied by the same hardware item. The use of the words first, second, and third does not indicate any order. These words can be interpreted as names.
此外,还应当注意,本说明书中使用的语言主要是为了可读性和教导的目的而选择的,而不是为了解释或者限定本发明的主题而选择的。因此,在不偏离所附权利要求书的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。对于本发明的范围,对本发明所做的公开是说明性的,而非限制性的,本发明的范围由所附权利要求书限定。 In addition, it should be noted that the language used in the specification has been selected for the purpose of readability and teaching, and is not intended to be construed or limited. Therefore, many modifications and changes will be apparent to those skilled in the art without departing from the scope of the invention. The disclosure of the present invention is intended to be illustrative, and not restrictive, and the scope of the invention is defined by the appended claims.

Claims (14)

  1. 一种浏览器中进行声音控制的方法,包括:A method for sound control in a browser, comprising:
    在浏览器中创建网页标签,并为网页标签创建一个与浏览器的主进程相独立的标签进程;Create a web page tag in the browser and create a tag process for the web page tag that is separate from the main process of the browser;
    建立网页标签与标签进程之间的映射关系,将该映射关系保存在主进程中,以在主进程的展示界面中控制网页标签中的声音;Establishing a mapping relationship between the webpage label and the labeling process, and saving the mapping relationship in the main process, so as to control the sound in the webpage label in the display interface of the main process;
    将通过主进程的展示界面输入的声音控制指令发送至标签进程;Sending a sound control command input through the display interface of the main process to the label process;
    根据所述声音控制指令通过网页标签中的音频应用接口,对网页标签中的声音进行控制。The sound in the webpage tag is controlled according to the sound control command through the audio application interface in the webpage tag.
  2. 根据权利要求1所述的方法,其中,所述建立网页标签与标签进程之间的映射关系,将该映射关系保存在主进程中包括:The method of claim 1, wherein the establishing a mapping relationship between the webpage label and the labeling process, and saving the mapping relationship in the main process comprises:
    建立标签进程ID与网页标签的标题之间的映射关系,和/或,建立标签进程ID与网页标签的标题、统一资源定位符URL之间的映射关系;Establishing a mapping relationship between the label process ID and the title of the webpage label, and/or establishing a mapping relationship between the label process ID and the title of the webpage label and the uniform resource locator URL;
    以及,as well as,
    将标签进程ID和网页标签的标题保存在主进程中,和/或,将标签进程ID、网页标签的标题和URL保存在主进程中。The tag process ID and the title of the web page tag are saved in the main process, and/or the tag process ID, the title of the web page tag, and the URL are saved in the main process.
  3. 根据权利要求1所述的方法,其中,所述音频应用接口包括下述的至少一种接口函数:The method of claim 1 wherein said audio application interface comprises at least one interface function described below:
    波形输出waveOutWrite接口函数、midi数据流输出midiStreamOut接口函数、客户端音频渲染IAudioRenderClient接口函数、音频创建DirectSoundCreate接口函数和音频创建DirectSoundCreate8接口函数。Wave output WaveOutWrite interface function, midi data stream output midiStreamOut interface function, client audio rendering IAudioRenderClient interface function, audio creation DirectSoundCreate interface function and audio creation DirectSoundCreate8 interface function.
  4. 根据权利要求3所述的方法,其中,所述根据所述声音控制指令通过网页标签中的音频应用接口,对网页标签中的声音进行控制包括:The method of claim 3, wherein the controlling the sound in the webpage tag through the audio application interface in the webpage tag according to the sound control instruction comprises:
    根据所述声音控制指令拦截网页标签对所述音频应用接口的调用,以禁止网页标签中声音的输出;和/或,Intersecting, by the sound control instruction, a call of the webpage tag to the audio application interface to prohibit output of sound in the webpage tag; and/or,
    根据所述声音控制指令允许网页标签对所述音频应用接口的调用,以实现网页标签中声音的输出。The call of the web application tag to the audio application interface is allowed according to the sound control instruction to implement output of sound in the webpage tag.
  5. 根据权利要求3所述的方法,其中,在所述为网页标签创建一个与浏览器的主进程相独立的标签进程之前,所述方法还包括:The method of claim 3, wherein before the creating a tag process for the web page tag that is independent of the main process of the browser, the method further comprises:
    识别所创建的网页标签中是否包括音视频文件,若是,为该网页标签创建一个与浏览器的主进程相独立的标签进程,若否,不为该网页标签创建一个与浏览器的主进程相独立的标签进程。Identifying whether the created webpage tag includes an audio/video file, and if so, creating a tag process independent of the browser's main process for the webpage tag, if not, creating a webpage tag with the main process of the browser Independent label process.
  6. 根据权利要求1所述的方法,其中,所述在浏览器中创建网页标签包括:The method of claim 1 wherein said creating a web page tag in the browser comprises:
    若浏览器中存在至少一个被静音的网页标签,判断新创建的网页标签中包括音视频文件时,向浏览器用户发送进入静音模式的提示信息,或者设置所述展示界面进入静音 控制界面。If at least one muted webpage label exists in the browser, and it is determined that the newly created webpage label includes an audio/video file, the browser user is sent a prompt message to enter the silent mode, or the display interface is set to be muted. Control interface.
  7. 一种浏览器,包括:A browser that includes:
    创建单元,适于在浏览器中创建网页标签,并为网页标签创建一个与浏览器的主进程相独立的标签进程;Creating a unit adapted to create a web page tag in the browser and create a tag process for the web page tag that is separate from the main process of the browser;
    映射单元,适于建立网页标签与标签进程之间的映射关系,将该映射关系保存在主进程中,以在主进程的展示界面中控制网页标签中的声音;The mapping unit is adapted to establish a mapping relationship between the webpage label and the labeling process, and save the mapping relationship in the main process to control the sound in the webpage label in the display interface of the main process;
    发送单元,适于将通过主进程的展示界面输入的声音控制指令发送至标签进程;a sending unit, configured to send a sound control instruction input through a display interface of the main process to the label process;
    控制单元,适于根据所述声音控制指令通过网页标签中的音频应用接口,对网页标签中的声音进行控制。The control unit is adapted to control the sound in the webpage label through the audio application interface in the webpage tag according to the sound control instruction.
  8. 根据权利要求7所述的浏览器,其中,所述映射单元,适于建立标签进程ID与网页标签的标题之间的映射关系,和/或,建立标签进程ID与网页标签的标题、统一资源定位符URL之间的映射关系;以及,The browser according to claim 7, wherein the mapping unit is adapted to establish a mapping relationship between the label process ID and the title of the webpage label, and/or establish a label process ID and a title of the webpage label, and a unified resource. The mapping relationship between locator URLs; and,
    将标签进程ID和网页标签的标题保存在主进程中,和/或,将标签进程ID、网页标签的标题和URL保存在主进程中。The tag process ID and the title of the web page tag are saved in the main process, and/or the tag process ID, the title of the web page tag, and the URL are saved in the main process.
  9. 根据权利要求7所述的浏览器,其中,所述音频应用接口包括下述的至少一种接口函数:The browser of claim 7, wherein the audio application interface comprises at least one interface function described below:
    波形输出waveOutWrite接口函数、midi数据流输出midiStreamOut接口函数、客户端音频渲染IAudioRenderClient接口函数、音频创建DirectSoundCreate接口函数和音频创建DirectSoundCreate8接口函数。Wave output WaveOutWrite interface function, midi data stream output midiStreamOut interface function, client audio rendering IAudioRenderClient interface function, audio creation DirectSoundCreate interface function and audio creation DirectSoundCreate8 interface function.
  10. 根据权利要求9所述的浏览器,其中,所述控制单元,适于根据所述声音控制指令拦截网页标签对所述音频应用接口的调用,以禁止网页标签中声音的输出;和/或,根据所述声音控制指令允许网页标签对所述音频应用接口的调用,以实现网页标签中声音的输出。The browser according to claim 9, wherein the control unit is adapted to intercept a call of the web application tag to the audio application interface according to the sound control instruction to prohibit output of sound in a webpage tag; and/or, The call of the web application tag to the audio application interface is allowed according to the sound control instruction to implement output of sound in the webpage tag.
  11. 根据权利要求9所述的浏览器,其中,所述浏览器还包括识别单元,适于在所述为网页标签创建一个与浏览器的主进程相独立的标签进程之前,识别所创建的网页标签中是否包括音视频文件,若是,为该网页标签创建一个与浏览器的主进程相独立的标签进程,若否,不为该网页标签创建一个与浏览器的主进程相独立的标签进程。The browser according to claim 9, wherein said browser further comprises an identification unit adapted to identify the created webpage label before said creating a webpage tag that is separate from the main process of the browser Whether the audio and video file is included, if so, a label process independent of the main process of the browser is created for the webpage label, and if not, a label process independent of the main process of the browser is not created for the webpage label.
  12. 根据权利要求7所述的浏览器,其中,所述浏览器还包括判断单元,适于若浏览器中存在至少一个被静音的网页标签,判断新创建的网页标签中包括音视频文件时,向浏览器用户发送进入静音模式的提示信息,或者设置所述展示界面进入静音控制界面。The browser according to claim 7, wherein the browser further comprises a determining unit, configured to: if there is at least one muted webpage label in the browser, and determine that the newly created webpage label includes an audiovisual file, The browser user sends a prompt message to enter the silent mode, or sets the display interface to enter the mute control interface.
  13. 一种计算机程序,包括计算机可读代码,当所述计算机可读代码在计算设备上运行时,导致所述计算设备执行根据权利要求1-6中的任一项所述的浏览器中进行声音控制的方法。A computer program comprising computer readable code, when said computer readable code is run on a computing device, causing said computing device to perform sound in a browser according to any one of claims 1-6 The method of control.
  14. 一种计算机可读介质,其中存储了如权利要求13所述的计算机程序。 A computer readable medium storing the computer program of claim 13.
PCT/CN2014/091469 2012-12-03 2014-11-18 Method for sound control in browser, and browser WO2015074548A1 (en)

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
CN2012105112786A CN103034695A (en) 2012-12-03 2012-12-03 Method and device for sound control in browser
CN201310594645.8A CN103646046A (en) 2012-12-03 2013-11-21 Method and device for sound control in browser and browser
CN201310594645.8 2013-11-21

Publications (1)

Publication Number Publication Date
WO2015074548A1 true WO2015074548A1 (en) 2015-05-28

Family

ID=48021590

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/091469 WO2015074548A1 (en) 2012-12-03 2014-11-18 Method for sound control in browser, and browser

Country Status (2)

Country Link
CN (2) CN103034695A (en)
WO (1) WO2015074548A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016200431A1 (en) * 2015-06-07 2016-12-15 Apple Inc. Audio control for web browser
US10877720B2 (en) 2015-06-07 2020-12-29 Apple Inc. Browser with docked tabs

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103034695A (en) * 2012-12-03 2013-04-10 北京奇虎科技有限公司 Method and device for sound control in browser
CN104142857B (en) * 2013-05-06 2018-02-23 腾讯科技(深圳)有限公司 A kind of Jing Yin method and device of page
CN104252353B (en) * 2013-06-28 2018-10-02 腾讯科技(深圳)有限公司 The control method and device of page sound in browser
CN104660793A (en) * 2013-11-21 2015-05-27 腾讯科技(深圳)有限公司 Sound control method and system for intelligent terminal and intelligent terminal
CN103995862B (en) * 2014-05-16 2018-09-07 百度在线网络技术(北京)有限公司 The display methods and device of web page tag
CN104080016B (en) * 2014-06-25 2018-08-17 北京奇虎科技有限公司 The method and apparatus that audio/video information is shown are carried out in a kind of browser
CN104065896B (en) * 2014-06-25 2018-10-09 北京奇虎科技有限公司 The method and apparatus that audio/video information is shown are carried out in a kind of browser
CN105677286B (en) * 2014-11-19 2019-11-26 腾讯科技(武汉)有限公司 A kind of browser volume adjusting method and device
CN106020960B (en) * 2016-05-30 2020-02-18 北京奇艺世纪科技有限公司 Calling method and device
CN111124229B (en) * 2019-12-24 2022-03-11 山东舜网传媒股份有限公司 Method, system and browser for realizing webpage animation control through voice interaction

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101650725A (en) * 2009-04-30 2010-02-17 北京搜狗科技发展有限公司 Method and system for controlling sound in browser
US20110113337A1 (en) * 2009-10-13 2011-05-12 Google Inc. Individualized tab audio controls
CN103019710A (en) * 2012-12-03 2013-04-03 北京奇虎科技有限公司 Device and method for controlling sound of browser
CN103646046A (en) * 2012-12-03 2014-03-19 北京奇虎科技有限公司 Method and device for sound control in browser and browser

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8850317B2 (en) * 2007-10-17 2014-09-30 Apple Inc. Web browser audio controls
CN100570610C (en) * 2007-12-07 2009-12-16 腾讯科技(深圳)有限公司 Multi-page browser webpage subwindow disposal route and multi-page browser
CN101504658B (en) * 2009-01-23 2011-09-28 北京搜狗科技发展有限公司 Method and system for implementing message interaction in multi-tag application program
CN101789001B (en) * 2009-04-30 2013-07-24 北京搜狗科技发展有限公司 Method and system for controlling sound in browser
CN101923554A (en) * 2009-06-11 2010-12-22 鸿富锦精密工业(深圳)有限公司 Webpage searching method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101650725A (en) * 2009-04-30 2010-02-17 北京搜狗科技发展有限公司 Method and system for controlling sound in browser
US20110113337A1 (en) * 2009-10-13 2011-05-12 Google Inc. Individualized tab audio controls
CN103019710A (en) * 2012-12-03 2013-04-03 北京奇虎科技有限公司 Device and method for controlling sound of browser
CN103646046A (en) * 2012-12-03 2014-03-19 北京奇虎科技有限公司 Method and device for sound control in browser and browser

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016200431A1 (en) * 2015-06-07 2016-12-15 Apple Inc. Audio control for web browser
US10387104B2 (en) 2015-06-07 2019-08-20 Apple Inc. Audio control for web browser
US10877720B2 (en) 2015-06-07 2020-12-29 Apple Inc. Browser with docked tabs
US11385860B2 (en) 2015-06-07 2022-07-12 Apple Inc. Browser with docked tabs

Also Published As

Publication number Publication date
CN103034695A (en) 2013-04-10
CN103646046A (en) 2014-03-19

Similar Documents

Publication Publication Date Title
WO2015074548A1 (en) Method for sound control in browser, and browser
US8468145B2 (en) Indexing of URLs with fragments
TWI511125B (en) Voice control method, mobile terminal apparatus and voice controlsystem
US6697838B1 (en) Method and system for annotating information resources in connection with browsing, in both connected and disconnected states
KR101143034B1 (en) Centralized method and system for clarifying voice commands
US10102848B2 (en) Hotwords presentation framework
CN109036417B (en) Method and apparatus for processing voice request
US20130031455A1 (en) System for Linking to Documents with Associated Annotations
US20130031457A1 (en) System for Creating and Editing Temporal Annotations of Documents
US20130031453A1 (en) System for Annotating Documents Served by a Document System without Functional Dependence on the Document System
US20130031454A1 (en) System for Programmatically Accessing Document Annotations
TW201506644A (en) Automatic augmentation of content through augmentation services
CN102752664B (en) Display method and device for text subtitle information in webpage
WO2017076315A1 (en) Page display method, device, and system, and page display assist method and device
JP2005512231A (en) How to express emotions in text messages
US20170046023A1 (en) Method and apparatus for processing managing multimedia content
KR20060019545A (en) Method and device for the visibility of media contents available from upnp media servers and for initiating rendering such media contents via a file system on a user interface
CN103019710B (en) Audio control method and device for browser
US20190147863A1 (en) Method and apparatus for playing multimedia
US11019012B2 (en) File sending in instant messaging application
CN104090887A (en) Music search method and device
WO2022111206A1 (en) Audio and text synchronization method and apparatus, readable medium, and electronic device
US20180253504A1 (en) File display method and device
US8165885B2 (en) Methods, systems, and computer-readable media for associating dynamic sound content with a web page in a browser
US20130209981A1 (en) Triggered Sounds in eBooks

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14863554

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14863554

Country of ref document: EP

Kind code of ref document: A1