CN114070838A - Method and device for controlling voice playing sound ray overlapping of intelligent sound box based on JS - Google Patents

Method and device for controlling voice playing sound ray overlapping of intelligent sound box based on JS Download PDF

Info

Publication number
CN114070838A
CN114070838A CN202210029435.3A CN202210029435A CN114070838A CN 114070838 A CN114070838 A CN 114070838A CN 202210029435 A CN202210029435 A CN 202210029435A CN 114070838 A CN114070838 A CN 114070838A
Authority
CN
China
Prior art keywords
party website
browser plug
playing
pause
javascript
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210029435.3A
Other languages
Chinese (zh)
Other versions
CN114070838B (en
Inventor
钟瑞
高裘生
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zhixiang Information Technology Co ltd
Original Assignee
Beijing Zhixiang Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Zhixiang Information Technology Co ltd filed Critical Beijing Zhixiang Information Technology Co ltd
Priority to CN202210029435.3A priority Critical patent/CN114070838B/en
Publication of CN114070838A publication Critical patent/CN114070838A/en
Application granted granted Critical
Publication of CN114070838B publication Critical patent/CN114070838B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • H04L67/025Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The embodiment of the invention provides a method for controlling voice playing and sound ray overlapping of an intelligent sound box based on JS, which comprises the following steps: when the intelligent sound box plays audio, after receiving an operation of opening a third-party website by a user, sending a pause instruction to a server through JavaScript to pause the audio playing of the intelligent sound box, sending a playing instruction to a browser plug-in through an appointed message channel of the JavaScript, and informing the third-party website to play after the browser plug-in receives a message; when the third-party website is played, after receiving the operation that a user calls the intelligent sound box to play, sending a pause instruction to the browser plug-in through a designated message channel of JavaScript, and after receiving the message, the browser plug-in informs the third-party website to pause playing. According to the method and the device for controlling the overlapping of the sound ray played by the voice of the intelligent sound box based on the JS, interaction is performed based on the front-end JavaScript technology and the browser plug-in, and the problem of the overlapping of the sound ray played by the voice of the intelligent sound box and the voice played by the third-party website is solved.

Description

Method and device for controlling voice playing sound ray overlapping of intelligent sound box based on JS
Technical Field
The invention relates to the technical field of intelligent sound boxes, in particular to a method and a device for controlling voice playing sound ray overlapping of an intelligent sound box based on JS.
Background
With the development of smart speakers, in order to provide diversified applications for users, in addition to the traditional playing of audio contents such as news, music, stories, etc. according to user instructions, smart speakers further support accessing third-party websites for audio or video playing. On the operating system, besides the android system, the method is further extended to the Linux system.
However, when the smart speaker is playing audio, if the smart speaker enters a third-party website to play audio or video, the audio of the smart speaker and the audio and video of the third-party website may be played simultaneously, which may cause overlapping of sound lines, because the prior audio cannot be automatically paused; correspondingly, if the audio and video of the third-party website is being played and the smart sound box is awakened to play the audio, the audio and video of the third-party website cannot be stopped, so that the sound lines are overlapped. Even if the volume of the audio played in advance is adjusted, the audio continues to be played, so that the playing progress at the time of switching cannot be reserved.
Disclosure of Invention
The invention aims to solve the technical problem of providing a method and a device for controlling the overlapping of sound rays of voice playing of an intelligent sound box based on JS.
In a first aspect, the invention provides a method for controlling overlapping of voice playing sound lines of an intelligent sound box based on JS, which comprises the following steps:
when the smart sound box plays audio, after receiving an operation that a user opens a third-party website or opens the third-party website and plays the audio, sending a pause instruction to a server through JavaScript to pause the audio playing of the smart sound box, sending a play instruction to a browser plug-in through an appointed message channel of the JavaScript, and informing the third-party website to play after the browser plug-in receives a message;
when the third-party website is played, after receiving the operation that a user calls the intelligent sound box to play, sending a pause instruction to the browser plug-in through a designated message channel of JavaScript, and after receiving the message, the browser plug-in informs the third-party website to pause playing.
Further, the notifying, by the browser plug-in, the third-party website to pause playing after receiving the message specifically includes: and capturing a video tag of the played video through the browser plug-in, and then operating the tag by using a JavaScript script to pause the video playing.
Further, the method further comprises: adding a browser plug-in a built-in browser of the intelligent sound box, wherein the browser plug-in is used for receiving a message sent by a JavaScript specified message channel and then executing playing or playing pause operation on a third-party website according to the message.
Further, the method further comprises: and when receiving an operation of opening another third-party website by the user, destroying the process of the previous third-party website.
In a second aspect, the present invention provides a device for controlling overlapping of sound lines of voice playing of a smart speaker based on JS, including: a switching module; the switching module is configured to:
when the smart sound box plays audio, after receiving an operation that a user opens a third-party website or opens the third-party website and plays the audio, sending a pause instruction to a server through JavaScript to pause the audio playing of the smart sound box, sending a play instruction to a browser plug-in through an appointed message channel of the JavaScript, and informing the third-party website to play after the browser plug-in receives a message;
when the third-party website is played, after receiving the operation that a user calls the intelligent sound box to play, sending a pause instruction to the browser plug-in through a designated message channel of JavaScript, and after receiving the message, the browser plug-in informs the third-party website to pause playing.
Further, the notifying, by the browser plug-in, the third-party website to play after receiving the message specifically includes: and capturing a video tag of the played video through a browser plug-in, and then operating the tag by using a JavaScript script to pause the video playing.
Further, still include: a plug-in adding module; the plug-in adding module is used for adding a browser plug-in a built-in browser of the intelligent sound box, and the browser plug-in is used for receiving a message sent by a JavaScript specified message channel and then executing playing or playing pause operation on a third-party website according to the message.
Further, still include: a process destruction module; and the process destroying module is used for destroying the process of the previous third-party website after receiving the operation of opening another third-party website by the user.
The technical scheme provided by the embodiment of the invention at least has the following technical effects or advantages:
the playing or pausing of the third-party audio and video is realized through a front-end JavaScript technology and a lightweight mode: when the intelligent sound box plays audio, after receiving an operation that a user opens a third-party website or opens the third-party website and plays the audio, actively sending a pause instruction to the server through JavaScript, thereby pausing the audio playing of the intelligent sound box; sending a playing/pausing instruction to the browser plug-in through a designated message channel of JavaScript, thereby realizing the playing/pausing of the third-party website; therefore, the problem of sound ray overlapping of voice playing of the intelligent sound box and voice playing of a third-party website is solved.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
The invention will be further described with reference to the following examples with reference to the accompanying drawings.
FIG. 1 is a flow chart of a method according to one embodiment of the present invention;
fig. 2 is a schematic structural diagram of a device according to a second embodiment of the present invention.
Detailed Description
The embodiment of the application provides a method and a device for controlling overlapping of sound rays of voice playing of a smart sound box based on JS, and interaction is performed based on a front-end JavaScript technology and a browser plug-in, so that the problem of overlapping of sound rays of voice playing of the smart sound box and voice playing of a third-party website is solved.
The invention idea is as follows:
under a Linux system, interaction is carried out through a front-end JavaScript technology and a browser plug-in:
(1) the main UI is sent to the browser plug-in through a postmessage channel of JavaScript;
(2) the browser plug-in receives the message notification audio playing website;
(3) the audio playing website receives the message and plays or pauses the player;
thereby realizing the control of the third-party website.
Example one
The embodiment provides a method for controlling overlapping of sound rays in voice playing of a smart speaker based on JS, as shown in fig. 1, the method may include:
when the smart sound box plays audio, after receiving an operation that a user opens a third-party website or opens the third-party website and plays the audio, sending a pause instruction to a server through JavaScript to pause the audio playing of the smart sound box, sending a play instruction to a browser plug-in through an appointed message channel of the JavaScript, and informing the third-party website to play after the browser plug-in receives a message;
when the third-party website is played, after receiving the operation that a user calls the intelligent sound box to play, sending a pause instruction to the browser plug-in through a designated message channel of JavaScript, and after receiving the message, the browser plug-in informs the third-party website to pause playing.
When the intelligent sound box plays audio, after receiving an operation that a user opens a third-party website or opens the third-party website and plays the audio, actively sending a pause instruction to the server through JavaScript, thereby pausing the audio playing of the intelligent sound box; sending a playing/pausing instruction to the browser plug-in through a designated message channel of JavaScript, thereby realizing the playing/pausing of the third-party website; therefore, the problem of sound ray overlapping of voice playing of the intelligent sound box and voice playing of a third-party website is solved. The third-party website may be set in a program, for example, a plurality of third-party websites such as youku, love art, YouTube, and the like, and the playing of the smart sound box may be stopped when the user opens the third-party website, or when the user opens the third-party website and plays the resource. And the playing or pausing of the third-party audio and video is realized in a lightweight mode through a front-end JavaScript technology.
The method further comprises the following steps: adding a browser plug-in (realized by JavaScript according to official documents of the browser) in a built-in browser of the smart speaker, wherein the browser plug-in is used for receiving a message sent by a JavaScript specified message channel (such as a postmessage message channel), and then executing playing or pause playing operation on a third-party website according to the message.
In one possible implementation, the method further includes: and when receiving an operation of opening another third-party website by the user, destroying the process of the previous third-party website. Because the program can be internally provided with a plurality of third-party websites, for the convenience of management, after receiving the operation of opening another third-party website by the user, the process of the previous third-party website can be destroyed, so that only the operation of playing and pausing the third-party website opened by the user last is always kept. The speaker wakeup process runs all the time in the background waiting for interaction with the user, while the processes of the third party website can be opened and destroyed.
A specific implementation manner of this embodiment:
the YouTube website is opened when the intelligent sound box plays music, and at the moment, a pause instruction can be sent to the intelligent sound box server by JavaScript to actively pause Alexa music; when YouTube plays videos, for example, a user calls a smart sound box to play music by voice, at this time, the user captures a video tag of the played videos through a Google browser plug-in, and operates the tag by a JavaScript script to pause the video playing.
In a second aspect, the present invention provides a device for controlling overlapping of sound lines of voice playing of a smart speaker based on JS, as shown in fig. 2, including: a switching module; the switching module is configured to:
when the smart sound box plays audio, after receiving an operation that a user opens a third-party website or opens the third-party website and plays the audio, sending a pause instruction to a server through JavaScript to pause the audio playing of the smart sound box, sending a play instruction to a browser plug-in through an appointed message channel of the JavaScript, and informing the third-party website to play after the browser plug-in receives a message;
when the third-party website is played, after receiving the operation that a user calls the intelligent sound box to play, sending a pause instruction to the browser plug-in through a designated message channel of JavaScript, and after receiving the message, the browser plug-in informs the third-party website to pause playing.
Specifically, the notifying, by the browser plug-in, the third-party website to play after receiving the message specifically includes: and capturing a video tag of the played video through a browser plug-in, and then operating the tag by using a JavaScript script to pause the video playing.
Preferably, the method further comprises the following steps: a plug-in adding module; the plug-in adding module is used for adding a browser plug-in a built-in browser of the intelligent sound box, and the browser plug-in is used for receiving a message sent by a JavaScript specified message channel and then executing playing or playing pause operation on a third-party website according to the message.
Preferably, the method further comprises the following steps: a process destruction module; and the process destroying module is used for destroying the process of the previous third-party website after receiving the operation of opening another third-party website by the user.
The playing or pausing of the third-party audio and video is realized through a front-end JavaScript technology and a lightweight mode: when the intelligent sound box plays audio, after receiving an operation that a user opens a third-party website or opens the third-party website and plays the audio, actively sending a pause instruction to the server through JavaScript, thereby pausing the audio playing of the intelligent sound box; sending a playing/pausing instruction to the browser plug-in through a designated message channel of JavaScript, thereby realizing the playing/pausing of the third-party website; therefore, the problem of sound ray overlapping of voice playing of the intelligent sound box and voice playing of a third-party website is solved.
Although specific embodiments of the invention have been described above, it will be understood by those skilled in the art that the specific embodiments described are illustrative only and are not limiting upon the scope of the invention, and that equivalent modifications and variations can be made by those skilled in the art without departing from the spirit of the invention, which is to be limited only by the appended claims.

Claims (8)

1. The utility model provides a method for controlling overlapping of voice play sound ray of smart sound box based on JS, which is characterized by comprising the following steps:
when the smart sound box plays audio, after receiving an operation that a user opens a third-party website or opens the third-party website and plays the audio, sending a pause instruction to a server through JavaScript to pause the audio playing of the smart sound box, sending a play instruction to a browser plug-in through an appointed message channel of the JavaScript, and informing the third-party website to play after the browser plug-in receives a message;
when the third-party website is played, after receiving the operation that a user calls the intelligent sound box to play, sending a pause instruction to the browser plug-in through a designated message channel of JavaScript, and after receiving the message, the browser plug-in informs the third-party website to pause playing.
2. The method of claim 1, wherein: the method for notifying the third-party website to pause playing after the browser plug-in receives the message specifically comprises the following steps: and capturing a video tag of the played video through the browser plug-in, and then operating the tag by using a JavaScript script to pause the video playing.
3. The method according to claim 1 or 2, characterized in that the method further comprises: adding a browser plug-in a built-in browser of the intelligent sound box, wherein the browser plug-in is used for receiving a message sent by a JavaScript specified message channel and then executing playing or playing pause operation on a third-party website according to the message.
4. The method according to claim 1 or 2, characterized in that the method further comprises: and when receiving an operation of opening another third-party website by the user, destroying the process of the previous third-party website.
5. The utility model provides a device based on JS control intelligence audio amplifier pronunciation broadcast sound ray overlaps which characterized in that includes: a switching module; the switching module is configured to:
when the smart sound box plays audio, after receiving an operation that a user opens a third-party website or opens the third-party website and plays the audio, sending a pause instruction to a server through JavaScript to pause the audio playing of the smart sound box, sending a play instruction to a browser plug-in through an appointed message channel of the JavaScript, and informing the third-party website to play after the browser plug-in receives a message;
when the third-party website is played, after receiving the operation that a user calls the intelligent sound box to play, sending a pause instruction to the browser plug-in through a designated message channel of JavaScript, and after receiving the message, the browser plug-in informs the third-party website to pause playing.
6. The apparatus of claim 5, wherein: the method for notifying the third-party website to play after the browser plug-in receives the message specifically comprises the following steps: and capturing a video tag of the played video through a browser plug-in, and then operating the tag by using a JavaScript script to pause the video playing.
7. The apparatus of claim 5 or 6, further comprising: a plug-in adding module; the plug-in adding module is used for adding a browser plug-in a built-in browser of the intelligent sound box, and the browser plug-in is used for receiving a message sent by a JavaScript specified message channel and then executing playing or playing pause operation on a third-party website according to the message.
8. The apparatus of claim 5 or 6, further comprising: a process destruction module; and the process destroying module is used for destroying the process of the previous third-party website after receiving the operation of opening another third-party website by the user.
CN202210029435.3A 2022-01-12 2022-01-12 Method and device for controlling voice playing sound ray overlapping of intelligent sound box based on JS Active CN114070838B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210029435.3A CN114070838B (en) 2022-01-12 2022-01-12 Method and device for controlling voice playing sound ray overlapping of intelligent sound box based on JS

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210029435.3A CN114070838B (en) 2022-01-12 2022-01-12 Method and device for controlling voice playing sound ray overlapping of intelligent sound box based on JS

Publications (2)

Publication Number Publication Date
CN114070838A true CN114070838A (en) 2022-02-18
CN114070838B CN114070838B (en) 2022-11-22

Family

ID=80230819

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210029435.3A Active CN114070838B (en) 2022-01-12 2022-01-12 Method and device for controlling voice playing sound ray overlapping of intelligent sound box based on JS

Country Status (1)

Country Link
CN (1) CN114070838B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040028025A1 (en) * 2002-08-06 2004-02-12 Fen-Man Chang System and method for providing a two-way audio communication via a web browser
WO2011050664A1 (en) * 2009-11-02 2011-05-05 中兴通讯股份有限公司 Method for mobile terminal processing music tracks and mobile terminal thereof
WO2011060636A1 (en) * 2009-11-23 2011-05-26 腾讯科技(深圳)有限公司 Media file playing system and media file playing method
CN102665137A (en) * 2012-04-01 2012-09-12 深圳Tcl新技术有限公司 Method for controlling media player and terminal thereof
CN106528735A (en) * 2016-10-27 2017-03-22 北京小米移动软件有限公司 Method and device for controlling browser to play media resources
CN110334500A (en) * 2019-06-28 2019-10-15 百度在线网络技术(北京)有限公司 Authority control method, device, intelligent sound box and the storage medium of intelligent sound box
CN110769280A (en) * 2019-10-23 2020-02-07 北京地平线机器人技术研发有限公司 Method and device for continuously playing files
CN112258086A (en) * 2020-11-13 2021-01-22 Oppo广东移动通信有限公司 Cross-device task relay method and device, cloud platform and storage medium
CN113672748A (en) * 2021-08-25 2021-11-19 阿波罗智联(北京)科技有限公司 Multimedia information playing method and device

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040028025A1 (en) * 2002-08-06 2004-02-12 Fen-Man Chang System and method for providing a two-way audio communication via a web browser
WO2011050664A1 (en) * 2009-11-02 2011-05-05 中兴通讯股份有限公司 Method for mobile terminal processing music tracks and mobile terminal thereof
WO2011060636A1 (en) * 2009-11-23 2011-05-26 腾讯科技(深圳)有限公司 Media file playing system and media file playing method
CN102665137A (en) * 2012-04-01 2012-09-12 深圳Tcl新技术有限公司 Method for controlling media player and terminal thereof
CN106528735A (en) * 2016-10-27 2017-03-22 北京小米移动软件有限公司 Method and device for controlling browser to play media resources
CN110334500A (en) * 2019-06-28 2019-10-15 百度在线网络技术(北京)有限公司 Authority control method, device, intelligent sound box and the storage medium of intelligent sound box
CN110769280A (en) * 2019-10-23 2020-02-07 北京地平线机器人技术研发有限公司 Method and device for continuously playing files
CN112258086A (en) * 2020-11-13 2021-01-22 Oppo广东移动通信有限公司 Cross-device task relay method and device, cloud platform and storage medium
CN113672748A (en) * 2021-08-25 2021-11-19 阿波罗智联(北京)科技有限公司 Multimedia information playing method and device

Also Published As

Publication number Publication date
CN114070838B (en) 2022-11-22

Similar Documents

Publication Publication Date Title
CN109658932B (en) Equipment control method, device, equipment and medium
US11227598B2 (en) Method for controlling terminal by voice, terminal, server and storage medium
WO2020078300A1 (en) Method for controlling screen projection of terminal and terminal
WO2021012665A1 (en) Interactive audio and video playing method and apparatus
CN105957530A (en) Speech control method, device and terminal equipment
JP2020008854A (en) Method and apparatus for processing voice request
CN107948672B (en) Method and system for storing video data, server and wearable device
CN102469363A (en) Television system with speech comment function and speech comment method
CN102143403B (en) Method and device for displaying and processing multimedia service, and multimedia service system
US8646021B2 (en) Method and apparatus for providing an interactive application within a media stream
CN111462744B (en) Voice interaction method and device, electronic equipment and storage medium
WO2018130173A1 (en) Dubbing method, terminal device, server and storage medium
US20220360849A1 (en) Information processing apparatus, information processing method, transmission apparatus, and transmission method
CN111447519A (en) Smart speaker, interaction method based on smart speaker and program product
CN105812845A (en) Media resource pushing method, media resource pushing system, and media player based on Android system
CN111124229A (en) Method, system and browser for realizing webpage animation control through voice interaction
CN114070838B (en) Method and device for controlling voice playing sound ray overlapping of intelligent sound box based on JS
WO2017071642A1 (en) Media playback method, device and computer storage medium
US11831946B2 (en) Audio only playback from STB in standby mode
CN105357588A (en) Data display method and terminal
US20180176631A1 (en) Methods and systems for providing an interactive second screen experience
CN115565557A (en) Audio acquisition method and device, display screen, electronic equipment and storage medium
CN211860471U (en) Intelligent sound box
CN112786031B (en) Man-machine conversation method and system
CN113411532A (en) Method, device, terminal and storage medium for recording content

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant