WO2019228138A1 - Music playback method and apparatus, storage medium, and electronic device - Google Patents

Music playback method and apparatus, storage medium, and electronic device Download PDF

Info

Publication number
WO2019228138A1
WO2019228138A1 PCT/CN2019/085549 CN2019085549W WO2019228138A1 WO 2019228138 A1 WO2019228138 A1 WO 2019228138A1 CN 2019085549 W CN2019085549 W CN 2019085549W WO 2019228138 A1 WO2019228138 A1 WO 2019228138A1
Authority
WO
WIPO (PCT)
Prior art keywords
music
application
party
target
voiceprint feature
Prior art date
Application number
PCT/CN2019/085549
Other languages
French (fr)
Chinese (zh)
Inventor
李冠
达剑
熊万江
李海泉
周伍润
董治
朱忠磊
高亮
刘嘉飞
文昭彦
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2019228138A1 publication Critical patent/WO2019228138A1/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/167Audio in a user interface, e.g. using voice commands for navigating, audio feedback

Definitions

  • the present application relates to the technical field of electronic devices, and in particular, to a method, a device, a storage medium, and an electronic device for playing music.
  • electronic devices can perform specific operations by means of voice instructions. For example, when a user speaks “play music”, the electronic device recognizes "play music” as a music playback instruction and executes the music playback instruction to implement music playback.
  • voice instructions For example, when a user speaks “play music”, the electronic device recognizes "play music” as a music playback instruction and executes the music playback instruction to implement music playback.
  • the electronic device when a user needs to play a specific music and say “play a specific music”, the electronic device will find the specific music locally. If it is not found, the specific music cannot be achieved through the system music application Music playback.
  • an embodiment of the present application provides a method for playing music, including:
  • the voice information is a music playback instruction, determining whether a first target music file corresponding to the music playback instruction exists locally;
  • an embodiment of the present application provides a music playback device, including:
  • An instruction recognition module configured to receive input voice information and determine whether the voice information is a music playback instruction
  • a file determining module configured to determine whether a first target music file corresponding to the music playback instruction exists locally when the voice information is a music playback instruction
  • a file obtaining module configured to obtain the first target music file through a third-party music application when the first target music file does not exist locally;
  • a file playback module configured to play the acquired first target music file through the third-party music application.
  • a storage medium provided in an embodiment of the present application stores a computer program thereon, and when the computer program runs on the computer, the computer program is executed by:
  • the voice information is a music playback instruction, determining whether a first target music file corresponding to the music playback instruction exists locally;
  • the electronic device includes a processor and a memory, where the memory has a computer program, and the processor calls the computer program to execute:
  • the voice information is a music playback instruction, determining whether a first target music file corresponding to the music playback instruction exists locally;
  • FIG. 1 is a schematic flowchart of a music playback method according to an embodiment of the present application.
  • FIG. 2 is an operation diagram of the electronic device determining whether the voice information is a music playback instruction in the embodiment of the present application.
  • FIG. 3 is an operation schematic diagram of triggering installation of a third-party local music application “XX Music” in the embodiment of the present application.
  • FIG. 4 is a schematic diagram of switching from a third-party web music application to a third-party local music application “XX Music” for music playback in the embodiment of the present application.
  • FIG. 5 is another schematic flowchart of a music playing method according to an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of a music playback device according to an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • FIG. 8 is another schematic structural diagram of an electronic device according to an embodiment of the present application.
  • the computer execution referred to herein includes operations by a computer processing unit representing electronic signals in a structured form. This operation transforms the data or maintains it at a location in the computer's memory system, which can be reconfigured or otherwise alter the operation of the computer in a manner well known to testers in the art.
  • the data structure maintained by the data is the physical location of the memory, which has specific characteristics defined by the data format.
  • Testers in the art will understand that various steps and operations described below can also be implemented in hardware.
  • module as used herein can be viewed as a software object executing on the computing system.
  • the different components, modules, engines, and services described in this article can be considered as implementation objects on this computing system.
  • the devices and methods described herein can be implemented in software, and of course, they can also be implemented in hardware, which are all within the protection scope of this application.
  • an embodiment herein means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present application.
  • the appearances of this phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are they independent or alternative embodiments that are mutually exclusive with other embodiments. It is clearly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
  • the embodiment of the present application provides a music playback method.
  • the execution subject of the music playback method may be the music playback device provided by the embodiment of the application, or an electronic device integrated with the music playback device.
  • the music playback device may use hardware or Software way.
  • the electronic device may be a smart phone, a tablet computer, a palmtop computer, a notebook computer, or a desktop computer.
  • An embodiment of the present application provides a method for playing music, which includes:
  • the voice information is a music playback instruction, determining whether a first target music file corresponding to the music playback instruction exists locally;
  • the third-party music application includes a third-party web music application and a third-party local music application
  • the obtaining the first target music file through the third-party music application includes:
  • the first target music file is obtained through the third-party web music application.
  • the method further includes:
  • a second target music file corresponding to the new music playback instruction is determined, and the second target music file is played through the third-party local music application.
  • the method before determining whether the voice information is a music playback instruction, the method further includes:
  • the voiceprint feature matches a preset voiceprint feature, it is determined whether the voice information is a music playback instruction.
  • determining whether the voiceprint feature matches a preset voiceprint feature includes:
  • the method further includes:
  • the method further includes:
  • the voice information is discarded.
  • the method further includes:
  • the local first target music file is played through the system music application
  • the local first target music file is played through the third-party local music application.
  • FIG. 1 is a schematic flowchart of a music playback method according to an embodiment of the present application. As shown in FIG. 1, the flow of the music playing method provided by the embodiment of the present application may be as follows:
  • step 101 the input voice information is received, and it is determined whether the received voice information is a music playback instruction.
  • the electronic device may receive the input voice information through the audio collection device.
  • the audio collection device may be a microphone built in the electronic device or a microphone externally connected to the electronic device. This application does not specifically limit this, and can be selected by those skilled in the art according to actual needs.
  • the electronic device receives input voice information through a built-in microphone.
  • the electronic device After receiving the input voice information, the electronic device performs a voice analysis on the received voice information to obtain a voice analysis result corresponding to the voice information, so as to determine whether the received voice information is a music playback instruction according to the voice analysis result.
  • the speech information is parsed, that is, the conversion process of the speech information from "sound" to "text".
  • the electronic device has a built-in speech parsing engine. Please refer to FIG. 2.
  • the user speaks the voice information of “I want to listen to XXX songs”.
  • the electronic device inputs the speech information to the speech parsing engine. Parse to get the analysis result "I want to listen to XXX songs" corresponding to the voice information, and determine "I want to listen to XXX songs" as a music playback instruction.
  • the electronic device does not have a built-in speech analysis engine, and the user speaks the voice information of "I want to listen to XXX songs".
  • the electronic device sends the voice information to the voice analysis server (the voice analysis server is A server that provides a voice analysis service), instructs the voice analysis server to perform voice analysis on the voice information, and returns the voice analysis result of the music information; after that, receives the voice analysis result of the voice information returned by the voice analysis server, "I want to listen to XXX songs ", And determine” I want to listen to XXX songs "as a music playback instruction.
  • the voice analysis server is A server that provides a voice analysis service
  • step 102 when the received voice information is a music playback instruction, it is determined whether a first target music file corresponding to the music playback instruction exists locally.
  • the received voice information is a music playback instruction
  • music identification information is extracted from the music playback instruction, and according to the voice identification information, whether a first target music file corresponding to the music playback instruction exists locally is found,
  • the search duration of the first target music file when the file is determined, it is determined that the first target music file does not exist locally; or, the search duration of the first target music file locally reaches a preset duration, and the first target music is not found
  • the preset duration may be set to a suitable value according to actual needs.
  • the preset duration may be configured to 500 milliseconds, 1 second, and the like.
  • step 103 when the first target music file does not exist locally, the first target music file is obtained through a third-party music application.
  • step 104 the acquired first target music file is played through a third-party music application.
  • third-party music applications are music applications provided by other manufacturers other than electronic device manufacturers (such as QQ music, music applications provided by electronic device manufacturers, which are usually integrated into the operating system of the electronic device when the electronic device leaves the factory. For system music applications.
  • the electronic device When acquiring the first target music file through a third-party music application, on the one hand, the electronic device first constructs a music acquisition request through a running third-party music application in accordance with a predetermined message format, and the music acquisition request includes at least the first target music file.
  • Music identification information (that is, music identification information extracted from music playback instructions); then, a third-party music application sends a constructed music acquisition request to a music server (the music server provides services to third-party music applications Server), instructs the music server to find and return the first target music file, and correspondingly receives the first target music file returned by the music server; on the other hand, after receiving the music acquisition request sent by the electronic device through the third-party music application, , According to the instruction of the music acquisition request, according to the association between the music identification information and the music file maintained by it, find the music file corresponding to the music identification information in the music acquisition request, and return the music file as the first target music file To electronic equipment
  • the electronic device After receiving the first target music file returned by the music server, the electronic device can play the obtained first target music file through a third-party music application.
  • the electronic device can receive the input voice information, and determine whether the received voice information is a music playback instruction.
  • the received voice information is a music playback instruction
  • the first target music file is obtained through a third-party music application. Playing the acquired first target music file through a third-party music application.
  • the target music file can be played through the third-party music application, which can improve the success of music playback on the electronic device. rate.
  • the third-party music application includes a third-party web music application and a third-party local music application, and obtaining the first target music file through the third-party music application includes:
  • the first target music file is obtained through a third-party web music application.
  • the local application is an application software that can be used by installing the installation package locally on the electronic device, and needs to occupy a certain storage resource of the electronic device.
  • a web application is an application software that uses a web browser to operate on the Internet or an intranet. It is an application written in a web language (such as a programming language such as HTML, JavaScript, Java, etc.) and needs to be executed by a browser. For example, it can be accessed uniformly through an open platform. It needs to be explained that the installation package of the existing web application and the cache data generated during runtime are stored in the server of the open platform, which does not need to be installed and run in the electronic device, thereby saving the storage resources of the electronic device as much as possible.
  • the electronic device can perform data communication with the web server of the manufacturer of the web application through the application interface in the open platform to achieve access to the web application. At this time, the server of the open platform acts as a proxy server, and each web application corresponds to An application interface.
  • the electronic device when the electronic device obtains the first target music file through a third-party music application, it first determines whether a third-party local music application is currently installed. If it is determined that the third-party local music application is not currently installed, the web browsing is performed. The browser runs a third-party webpage music application, and obtains the first target music file through the third-party webpage music application.
  • the electronic device When the first target music file is obtained through a third-party web music application, on the one hand, the electronic device first constructs a music acquisition request through a running third-party web music application in accordance with a predetermined message format.
  • the music acquisition request includes at least the first The music identification information of the target music file (that is, the music identification information extracted from the music playback instruction); after that, the constructed music acquisition request is sent to the music server through a third-party web music application (the music server is to a third party A web music application server), instructs the music server to find and return the first target music file, and receives the first target music file returned by the music server accordingly; on the other hand, the music server receives the electronic device's music through a third-party web page.
  • the standard music file is returned to the electronic device.
  • the electronic device After receiving the first target music file returned by the music server, the electronic device can play the obtained first target music file through a third-party webpage music application.
  • the electronic device may obtain an application installation package of a third-party local music application from the foregoing music server, or may obtain an music installation package of a third-party local music application from an application platform (such as an application store).
  • an application platform such as an application store
  • the electronic device runs a third-party web music application through the XX browser, and plays the first target music file "XX song” through the third-party web music application.
  • the electronic device displays a confirmation interface.
  • the confirmation interface includes a prompt message “Whether to install XX music” prompting the user whether to install a third-party local music application named “XX Music”.
  • the confirmation interface includes a “Yes” control for inputting confirmation information, and input of denial information "No” control.
  • the electronic device obtains an application installation package of the third-party local music application “XX Music” from the music server corresponding to the third-party web music application. After obtaining the application installation package of the third-party local music application "XX Music”, install the third-party local music application "XX Music” according to the application installation package.
  • the method further includes:
  • a second target music file corresponding to the new music playback instruction is determined, and the second target music file is played through a third-party local music application.
  • the third-party local music application can be installed to respond to the newly received music playback instruction.
  • a new music playback instruction input in a voice manner is received.
  • a second target music file corresponding to the new music playback instruction is determined.
  • the third-party web music application will be controlled to stop playing the first target music file, and the web browser running the third-party web music application will be switched to the background.
  • start the third-party local music application to play the local second target music file through the third-party local music. If the second target music file does not exist locally, start the third-party local music application in the same way as before, and then use the third-party local
  • the music application obtains the second target music file and plays it.
  • the electronic device plays XX songs through the “web version” XX music running on the XX browser, and installs the “local version” XX music during playback.
  • a new music playback instruction “play YY” is received, "Song”, the electronic device starts the "local version” of XX music and plays the YY song corresponding to the new music playback instruction.
  • the method further includes:
  • the local first target music file is played through the system music application
  • the first target music file locally is played through the third-party local music application.
  • the method before determining whether the received voice information is a music playback instruction, the method further includes:
  • the acquired voiceprint feature matches the preset voiceprint feature, it is determined whether the received voice information is a music playback instruction.
  • the characteristic of this sound is the voiceprint feature.
  • the voiceprint feature is mainly determined by two factors. The first is the size of the acoustic cavity, which specifically includes the throat, nasal cavity, and oral cavity. The shape, size, and position of these organs determine the vocal cord tension Size and range of sound frequencies. Therefore, although different people say the same thing, the frequency distribution of the sound is different, and some sound low and loud.
  • the second factor that determines the characteristics of the voiceprint is the manner in which the vocal organs are manipulated.
  • the vocal organs include lips, teeth, tongue, soft palate, and diaphragm muscles, and their interaction produces clear speech. And the way they collaborate is learned randomly by people in their interactions with the people around them. In the process of learning to speak, by simulating the speech of different people around them, they will gradually form their own voiceprint characteristics.
  • the electronic device when receiving the input voice information, the electronic device first obtains the voiceprint feature of the voice information.
  • the electronic device After acquiring the voiceprint feature of the voice information, the electronic device further compares the acquired voiceprint feature with a preset voiceprint feature to determine whether the voiceprint feature matches the preset voiceprint feature.
  • the preset voiceprint feature may be a voiceprint feature entered in advance by the owner, to determine whether the voiceprint feature of the input voice information matches the preset voiceprint feature, that is, to determine whether the user who currently inputs voice information is the owner .
  • the electronic device determines that the user currently inputting the voice information is the owner, and at this time determines whether the received voice information is a music playback instruction, and the voice information is music. When the instruction is played, the music playback instruction is responded.
  • the electronic device may obtain the voiceprint feature (the voiceprint feature obtained from the received voice information) and the preset voiceprint feature. Similarity, and determine whether the obtained similarity is greater than or equal to the first preset similarity (set according to actual needs, for example, it can be set to 95%). Wherein, when the acquired similarity is greater than or equal to the first preset similarity, it is determined that the acquired voiceprint feature matches the preset voiceprint feature; when the acquired similarity is less than or lower than the similarity, it is determined that the acquired The voiceprint feature does not match the preset voiceprint feature.
  • the electronic device determines that the user currently inputting the voice information is not the owner, discards the received voice information, and continues to receive the input voice information until When receiving the owner's voice information, determine whether the received voice information is a music playback instruction, and when the voice information is a music playback instruction, respond to the music playback instruction.
  • the electronic device determines whether the received voice information is a music playback instruction, and when the voice information is a music playback instruction, respond to the music playback instruction.
  • the user's identity before responding to the input voice information, the user's identity is first identified according to the voiceprint characteristics of the voice information, and the input voice information is performed only when the user who inputs the voice information is the owner. response. Therefore, the electronic device can be prevented from performing operations that are not intended by the owner, and the use experience of the owner can be improved.
  • the method further includes:
  • the characteristics of the voiceprint are closely related to the physiological characteristics of the human body, in daily life, if the user catches a cold, his voice will become hoarse, and the characteristics of the voiceprint will also change accordingly. In this case, even if the voice information received by the electronic device is spoken by the owner, the electronic device cannot recognize it. In addition, there are many situations that cause the electronic device to fail to identify the owner, which will not be repeated here.
  • the electronic device completes the judgment of the similarity of the voiceprint feature, if the voiceprint feature of the received voice information and the preset voiceprint are The similarity of the features is less than the first preset similarity, and it is further judged whether the voiceprint feature is greater than or equal to the second preset similarity (the second preset similarity is configured to be less than the first preset similarity, which can be specifically determined by the art
  • the technician takes an appropriate value according to actual needs, for example, when the first preset similarity is set to 95%, the second preset similarity may be set to 75%).
  • the electronic device When the judgment result is yes, that is, the voiceprint feature of the acquired voice information and the similarity with the preset voiceprint feature is less than the first preset similarity and greater than or equal to the second preset similarity, the electronic device further Get the current location information.
  • the electronic device may use different positioning technologies such as satellite positioning technology or base station positioning technology to obtain the current position information.
  • the electronic device After acquiring the current position information, the electronic device determines whether it is currently within a preset position range according to the position information.
  • the preset position range can be configured as a common position range of the owner, such as home and company.
  • the electronic device determines that the aforementioned voiceprint feature matches the preset voiceprint feature, and recognizes the current user who inputs the voice information as the owner.
  • the music playing method may include:
  • step 201 input voice information is received, and voiceprint characteristics of the received voice information are acquired.
  • the characteristic of this sound is the voiceprint feature.
  • the voiceprint feature is mainly determined by two factors. The first is the size of the acoustic cavity, which specifically includes the throat, nasal cavity, and oral cavity. The shape, size, and position of these organs determine the vocal cord tension Size and range of sound frequencies. Therefore, although different people say the same thing, the frequency distribution of the sound is different, and some sound low and loud.
  • the second factor that determines the characteristics of the voiceprint is the manner in which the vocal organs are manipulated.
  • the vocal organs include lips, teeth, tongue, soft palate, and diaphragm muscles, and their interaction produces clear speech. And the way they collaborate is learned randomly by people in their interactions with the people around them. In the process of learning to speak, by simulating the speech of different people around them, they will gradually form their own voiceprint characteristics.
  • the electronic device may receive the input voice information through the audio collection device.
  • the audio collection device may be a microphone built in the electronic device or a microphone externally connected to the electronic device. This application does not specifically limit this, and can be selected by those skilled in the art according to actual needs.
  • the electronic device receives input voice information through a built-in microphone.
  • the electronic device After receiving the input voice information, the electronic device first obtains the voiceprint characteristics of the voice information.
  • step 202 it is determined whether the acquired voiceprint feature matches a preset voiceprint feature.
  • the electronic device After acquiring the voiceprint feature of the voice information, the electronic device further compares the acquired voiceprint feature with a preset voiceprint feature to determine whether the voiceprint feature matches the preset voiceprint feature.
  • the preset voiceprint feature may be a voiceprint feature entered in advance by the owner, to determine whether the voiceprint feature of the input voice information matches the preset voiceprint feature, that is, to determine whether the user who currently inputs voice information is the owner .
  • step 203 when the acquired voiceprint feature matches a preset voiceprint feature, it is determined whether the received voice information is a music playback instruction.
  • the electronic device determines that the user currently inputting the voice information is the owner, and at this time determines whether the received voice information is a music playback instruction.
  • the electronic device When determining whether the received voice information is a music playback instruction, the electronic device performs a voice analysis on the received voice information to obtain a voice analysis result corresponding to the voice information, and determines whether the received voice information is music based on the voice analysis result. Play instruction.
  • the speech information is parsed, that is, the conversion process of the speech information from "sound" to "text".
  • the electronic device has a built-in speech parsing engine. Please refer to FIG. 2.
  • the user speaks the voice information of “I want to listen to XXX songs”.
  • the electronic device inputs the speech information to the speech parsing engine. Parse to get the analysis result "I want to listen to XXX songs" corresponding to the voice information, and determine "I want to listen to XXX songs" as a music playback instruction.
  • the electronic device does not have a built-in speech analysis engine, and the user speaks the voice information of "I want to listen to XXX songs".
  • the electronic device sends the voice information to the voice analysis server (the voice analysis server is A server that provides a voice analysis service), instructs the voice analysis server to perform voice analysis on the voice information, and returns a voice analysis result of the music information; and then receives the voice analysis result of the voice information returned by the voice analysis server, "I want to listen to XXX songs ", And determine” I want to listen to XXX songs "as a music playback instruction.
  • the voice analysis server is A server that provides a voice analysis service
  • step 204 when the received voice information is a music playback instruction, it is determined whether a first target music file corresponding to the music playback instruction exists locally.
  • the received voice information is a music playback instruction
  • music identification information is extracted from the music playback instruction, and according to the voice identification information, whether a first target music file corresponding to the music playback instruction exists locally is found,
  • the search duration of the first target music file when the file is determined, it is determined that the first target music file does not exist locally; or, the search duration of the first target music file locally reaches a preset duration, and the first target music is not found
  • the preset duration may be set to a suitable value according to actual needs.
  • the preset duration may be configured to 500 milliseconds, 1 second, and the like.
  • step 205 when the first target music file does not exist locally, the first target music file is obtained through a third-party music application.
  • step 206 the acquired first target music file is played through a third-party music application.
  • third-party music applications are music applications provided by other manufacturers other than electronic device manufacturers (such as QQ music, music applications provided by electronic device manufacturers, which are usually integrated into the operating system of the electronic device when the electronic device leaves the factory. For system music applications.
  • the electronic device When acquiring the first target music file through a third-party music application, on the one hand, the electronic device first constructs a music acquisition request through a running third-party music application in accordance with a predetermined message format, and the music acquisition request includes at least the first target music file.
  • Music identification information (that is, music identification information extracted from music playback instructions); then, a third-party music application sends a constructed music acquisition request to a music server (the music server provides services to third-party music applications Server), instructs the music server to find and return the first target music file, and correspondingly receives the first target music file returned by the music server; on the other hand, after receiving the music acquisition request sent by the electronic device through the third-party music application, , According to the instruction of the music acquisition request, according to the association between the music identification information and the music file maintained by it, find the music file corresponding to the music identification information in the music acquisition request, and return the music file as the first target music file To electronic equipment.
  • a third-party music application sends a constructed music acquisition request to a music server (the music server provides services to third-party music applications Server), instructs the music server to find and return the first target music file, and correspondingly receives the first target music file returned by the music server; on the other hand, after receiving the music acquisition request sent by the electronic device
  • the electronic device After receiving the first target music file returned by the music server, the electronic device can play the obtained first target music file through a third-party music application.
  • a music playback device is also provided.
  • FIG. 6, is a schematic structural diagram of a music playback device 400 according to an embodiment of the present application.
  • the music playback device is applied to an electronic device.
  • the music playback device includes an instruction recognition module 401, a file judgment module 402, a file acquisition module 403, and a file playback module 404, as follows:
  • the instruction recognition module 401 is configured to receive input voice information and determine whether the received voice information is a music playback instruction.
  • the file determining module 402 is configured to determine whether a first target music file corresponding to the music playback instruction exists locally when the received voice information is a music playback instruction.
  • the file obtaining module 403 is configured to obtain the first target music file through a third-party music application when the first target music file does not exist locally.
  • the file playback module 404 is configured to play the acquired first target music file through a third-party music application.
  • the third-party music application includes a third-party web music application and a third-party local music application.
  • the file acquisition module 403 may also be used to:
  • the first target music file is obtained through a third-party web music application.
  • the music playback device further includes an application installation module, which can be used to:
  • the instruction recognition module 401 may be further configured to:
  • the file playback module 404 can be used for:
  • a second target music file corresponding to the new music playback instruction is determined, and the second target music file is played through a third-party local music application.
  • the file playback module 404 may be further configured to:
  • the local first target music file is played through the system music application
  • the first target music file locally is played through the third-party local music application.
  • the instruction recognition module 401 may be further configured to:
  • the acquired voiceprint feature matches the preset voiceprint feature, it is determined whether the received voice information is a music playback instruction.
  • the instruction recognition module 401 may be further configured to:
  • the instruction recognition module 401 may be further configured to:
  • the music playback device 400 may be integrated in an electronic device, such as a mobile phone or a tablet computer.
  • the instruction recognition module 401 may be further configured to:
  • the voice information is discarded.
  • the file playback module 404 may be further configured to:
  • the local first target music file is played through the system music application
  • the first target music file locally is played through the third-party local music application.
  • the above modules can be implemented as independent entities, or can be arbitrarily combined, and implemented as the same or several entities.
  • the specific implementation of the above units can refer to the previous embodiments, and will not be repeated here.
  • the music playback device in this embodiment may receive the input voice information by the instruction recognition module 401 and determine whether the received voice information is a music playback instruction.
  • the file determination module 402 determines whether a first target music file corresponding to the music playback instruction exists locally.
  • the first target music file does not exist locally by the file obtaining module 403
  • the first target music file is obtained through a third-party music application.
  • the first target music file obtained by the file playback module 404 is played by a third-party music application.
  • the target music file that needs to be played does not exist locally, that is, when the music playback cannot be performed through the system music application, the target music file can be played through the third-party music application, which can improve the success of music playback on the electronic device. rate.
  • an electronic device is also provided.
  • the electronic device 500 includes a processor 501 and a memory 502.
  • the processor 501 is electrically connected to the memory 502.
  • the processor 500 is a control center of the electronic device 500. It connects various parts of the entire electronic device by using various interfaces and lines. Various functions of the device 500 and process data.
  • the memory 502 may be configured to store software programs and modules.
  • the processor 501 executes various functional applications and data processing by running computer programs and modules stored in the memory 502.
  • the memory 502 may mainly include a storage program area and a storage data area, where the storage program area may store an operating system, a computer program (such as a sound playback function, an image playback function, etc.) required for at least one function, and the like; Data created by the use of electronic devices, etc.
  • the memory 502 may include a high-speed random access memory, and may further include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 502 may further include a memory controller to provide the processor 501 with access to the memory 502.
  • the processor 501 in the electronic device 500 loads the instructions corresponding to the process of one or more computer programs into the memory 502 according to the following steps, and the processor 501 runs and stores the memory 502 A computer program in the computer to achieve various functions, as follows:
  • the received voice information is a music playback instruction
  • the electronic device 500 may further include a display 503, a radio frequency circuit 504, an audio circuit 505, and a power source 506.
  • the display 503, the radio frequency circuit 504, the audio circuit 505, and the power supply 506 are electrically connected to the processor 501, respectively.
  • the display 503 may be used to display information input by the user or information provided to the user and various graphical user interfaces. These graphical user interfaces may be composed of graphics, text, icons, videos, and any combination thereof.
  • the display 503 may include a display panel.
  • the display panel may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), or an organic light emitting diode (Organic Light-Emitting Diode, OLED).
  • the radio frequency circuit 504 may be used to transmit and receive radio frequency signals to establish wireless communication with a network device or other electronic device through wireless communication, and transmit and receive signals to and from the network device or other electronic device.
  • the audio circuit 505 may be used to provide an audio interface between the user and the electronic device through a speaker or a microphone.
  • the power source 506 may be used to power various components of the electronic device 500.
  • the power supply 506 may be logically connected to the processor 501 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption management through the power management system.
  • the electronic device 500 may further include a camera, a Bluetooth module, and the like, and details are not described herein again.
  • the third-party music application includes a third-party web music application and a third-party local music application.
  • the processor 501 may perform the following steps:
  • the first target music file is obtained through a third-party web music application.
  • the processor 501 may perform the following steps:
  • the processor 501 may perform the following steps:
  • a second target music file corresponding to the new music playback instruction is determined, and the second target music file is played through a third-party local music application.
  • the processor 501 may perform the following steps:
  • the local first target music file is played through the system music application
  • the first target music file locally is played through the third-party local music application.
  • the processor 501 may further perform the following steps:
  • the acquired voiceprint feature matches the preset voiceprint feature, it is determined whether the received voice information is a music playback instruction.
  • the processor 501 may further perform the following steps:
  • the processor 501 may further perform the following steps:
  • the processor 501 may further execute:
  • the voice information is discarded.
  • the processor 501 may further execute:
  • the local first target music file is played through the system music application
  • the first target music file locally is played through the third-party local music application.
  • An embodiment of the present application further provides a storage medium.
  • the storage medium stores a computer program, and when the computer program runs on a computer, the computer causes the computer to execute the music playing method in any of the foregoing embodiments, such as: receiving Enter the voice information and determine whether the received voice information is a music playback instruction.
  • the received voice information is a music playback instruction
  • the first target music file is obtained, the first target music file is obtained through a third-party music application; and the obtained first target music file is played through a third-party music application.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM, ROM), or a random access device (Random Access Memory, RAM).
  • ROM read-only memory
  • RAM Random Access Memory
  • the computer program may be stored in a computer-readable storage medium, such as stored in a memory of an electronic device, and executed by at least one processor in the electronic device, and may include a method such as a music playback method during execution.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory, a random access memory, or the like.
  • the music playback device of the embodiment of the present application its functional modules may be integrated in one processing chip, or each module may exist separately physically, or two or more modules may be integrated in one module.
  • the above integrated modules can be implemented in the form of hardware or software functional modules. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium, such as a read-only memory, a magnetic disk, or an optical disk. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)
  • Electrophonic Musical Instruments (AREA)

Abstract

Disclosed are a music playback method and apparatus, a storage medium, and an electronic device. The electronic device can receive input voice information, and determine whether the received voice information is a music playback instruction; when the received voice information is the music playback instruction, determine whether a first target music file corresponding to the music playback instruction exists locally; when the target music file that is required to be played back does not exist locally, that is, when the music cannot be played back by means of a system music application, playback of the target music file by means of a third party music application is achieved.

Description

音乐播放方法、装置、存储介质及电子设备Music playing method, device, storage medium and electronic equipment
本申请要求于2018年05月30日提交中国专利局、申请号为201810541500.4、发明名称为“音乐播放方法、装置、存储介质及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority from a Chinese patent application filed on May 30, 2018 with the Chinese Patent Office, application number 201810541500.4, and the invention name is "music playback method, device, storage medium and electronic device", the entire contents of which are incorporated by reference. In this application.
技术领域Technical field
本申请涉及电子设备技术领域,具体涉及一种音乐播放方法、装置、存储介质及电子设备。The present application relates to the technical field of electronic devices, and in particular, to a method, a device, a storage medium, and an electronic device for playing music.
背景技术Background technique
目前,电子设备可以通过语音指令的方式来执行特定操作。比如,当用户说出“播放音乐”时,电子设备将“播放音乐”识别为音乐播放指令,并执行音乐播放指令,实现音乐播放。然而,在相关技术中,当用户需要播放某特定音乐,并说出“播放特定音乐”时,电子设备会在本地查找该特定音乐,若未查找到,将无法通过系统音乐应用实现对该特定音乐的播放。Currently, electronic devices can perform specific operations by means of voice instructions. For example, when a user speaks "play music", the electronic device recognizes "play music" as a music playback instruction and executes the music playback instruction to implement music playback. However, in related technologies, when a user needs to play a specific music and say "play a specific music", the electronic device will find the specific music locally. If it is not found, the specific music cannot be achieved through the system music application Music playback.
发明内容Summary of the Invention
第一方面,本申请实施例了提供了的一种音乐播放方法,包括:In a first aspect, an embodiment of the present application provides a method for playing music, including:
接收输入的语音信息,并判断所述语音信息是否为音乐播放指令;Receiving the input voice information, and determining whether the voice information is a music playback instruction;
在所述语音信息为音乐播放指令时,判断本地是否存在对应所述音乐播放指令的第一目标音乐文件;When the voice information is a music playback instruction, determining whether a first target music file corresponding to the music playback instruction exists locally;
在本地不存在所述第一目标音乐文件时,通过第三方音乐应用获取所述第一目标音乐文件;When the first target music file does not exist locally, acquiring the first target music file through a third-party music application;
通过所述第三方音乐应用播放获取到的所述第一目标音乐文件。Playing the acquired first target music file through the third-party music application.
第二方面,本申请实施例了提供了的一种音乐播放装置,包括:In a second aspect, an embodiment of the present application provides a music playback device, including:
指令识别模块,用于接收输入的语音信息,并判断所述语音信息是否为音乐播放指令;An instruction recognition module, configured to receive input voice information and determine whether the voice information is a music playback instruction;
文件判断模块,用于在所述语音信息为音乐播放指令时,判断本地是否存在对应所述音乐播放指令的第一目标音乐文件;A file determining module, configured to determine whether a first target music file corresponding to the music playback instruction exists locally when the voice information is a music playback instruction;
文件获取模块,用于在本地不存在所述第一目标音乐文件时,通过第三方音乐应用获取所述第一目标音乐文件;A file obtaining module, configured to obtain the first target music file through a third-party music application when the first target music file does not exist locally;
文件播放模块,用于通过所述第三方音乐应用播放获取到的所述第一目标音乐文件。A file playback module, configured to play the acquired first target music file through the third-party music application.
第三方面,本申请实施例提供的存储介质,其上存储有计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行:In a third aspect, a storage medium provided in an embodiment of the present application stores a computer program thereon, and when the computer program runs on the computer, the computer program is executed by:
接收输入的语音信息,并判断所述语音信息是否为音乐播放指令;Receiving the input voice information, and determining whether the voice information is a music playback instruction;
在所述语音信息为音乐播放指令时,判断本地是否存在对应所述音乐播放指令的第一目标音乐文件;When the voice information is a music playback instruction, determining whether a first target music file corresponding to the music playback instruction exists locally;
在本地不存在所述第一目标音乐文件时,通过第三方音乐应用获取所述第一目标音乐文件;When the first target music file does not exist locally, acquiring the first target music file through a third-party music application;
通过所述第三方音乐应用播放获取到的所述第一目标音乐文件。Playing the acquired first target music file through the third-party music application.
第四方面,本申请实施例提供的电子设备,包括处理器和存储器,所述存储器有计算机程序,所述处理器通过调用所述计算机程序,用于执行:In a fourth aspect, the electronic device provided in the embodiment of the present application includes a processor and a memory, where the memory has a computer program, and the processor calls the computer program to execute:
接收输入的语音信息,并判断所述语音信息是否为音乐播放指令;Receiving the input voice information, and determining whether the voice information is a music playback instruction;
在所述语音信息为音乐播放指令时,判断本地是否存在对应所述音乐播放指令的第一 目标音乐文件;When the voice information is a music playback instruction, determining whether a first target music file corresponding to the music playback instruction exists locally;
在本地不存在所述第一目标音乐文件时,通过第三方音乐应用获取所述第一目标音乐文件;When the first target music file does not exist locally, acquiring the first target music file through a third-party music application;
通过所述第三方音乐应用播放获取到的所述第一目标音乐文件。Playing the acquired first target music file through the third-party music application.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the technical solutions in the embodiments of the present application more clearly, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are just some embodiments of the application. For those skilled in the art, other drawings can be obtained based on these drawings without paying creative labor.
图1为本申请实施例提供的音乐播放方法的一流程示意图。FIG. 1 is a schematic flowchart of a music playback method according to an embodiment of the present application.
图2是本申请实施例中电子设备判断语音信息是否为音乐播放指令的操作示意图。FIG. 2 is an operation diagram of the electronic device determining whether the voice information is a music playback instruction in the embodiment of the present application.
图3是本申请实施例中触发安装第三方本地音乐应用“XX音乐”的操作示意图。FIG. 3 is an operation schematic diagram of triggering installation of a third-party local music application “XX Music” in the embodiment of the present application.
图4是本申请实施例中由第三方网页音乐应用切换至第三方本地音乐应用“XX音乐”进行音乐播放的示意图。FIG. 4 is a schematic diagram of switching from a third-party web music application to a third-party local music application “XX Music” for music playback in the embodiment of the present application.
图5是本申请实施例提供的音乐播放方法的另一流程示意图。FIG. 5 is another schematic flowchart of a music playing method according to an embodiment of the present application.
图6是本申请实施例提供的音乐播放装置的一结构示意图。FIG. 6 is a schematic structural diagram of a music playback device according to an embodiment of the present application.
图7是本申请实施例提供的电子设备的一结构示意图。FIG. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
图8是本申请实施例提供的电子设备的另一结构示意图。FIG. 8 is another schematic structural diagram of an electronic device according to an embodiment of the present application.
具体实施方式Detailed ways
请参照图式,其中相同的组件符号代表相同的组件,本申请的原理是以实施在一适当的运算环境中来举例说明。以下的说明是基于所例示的本申请具体实施例,其不应被视为限制本申请未在此详述的其它具体实施例。Please refer to the drawings, wherein the same component symbols represent the same components. The principle of the present application is illustrated by implementing in an appropriate computing environment. The following description is based on the exemplified specific embodiments of the present application, which should not be construed as limiting other specific embodiments that are not detailed herein.
在以下的说明中,本申请的具体实施例将参考由一部或多部计算机所执行的步骤及符号来说明,除非另有述明。因此,这些步骤及操作将有数次提到由计算机执行,本文所指的计算机执行包括了由代表了以一结构化型式中的数据的电子信号的计算机处理单元的操作。此操作转换该数据或将其维持在该计算机的内存系统中的位置处,其可重新配置或另外以本领域测试人员所熟知的方式来改变该计算机的运作。该数据所维持的数据结构为该内存的实体位置,其具有由该数据格式所定义的特定特性。但是,本申请原理以上述文字来说明,其并不代表为一种限制,本领域测试人员将可了解到以下所述的多种步骤及操作亦可实施在硬件当中。In the following description, specific embodiments of the present application will be described with reference to steps and symbols performed by one or more computers, unless otherwise stated. Therefore, these steps and operations will be referred to several times by computer execution. The computer execution referred to herein includes operations by a computer processing unit representing electronic signals in a structured form. This operation transforms the data or maintains it at a location in the computer's memory system, which can be reconfigured or otherwise alter the operation of the computer in a manner well known to testers in the art. The data structure maintained by the data is the physical location of the memory, which has specific characteristics defined by the data format. However, the principle of the present application is described by the above text, which does not represent a limitation. Testers in the art will understand that various steps and operations described below can also be implemented in hardware.
本文所使用的术语“模块”可看做为在该运算系统上执行的软件对象。本文所述的不同组件、模块、引擎及服务可看做为在该运算系统上的实施对象。而本文所述的装置及方法可以以软件的方式进行实施,当然也可在硬件上进行实施,均在本申请保护范围之内。The term "module" as used herein can be viewed as a software object executing on the computing system. The different components, modules, engines, and services described in this article can be considered as implementation objects on this computing system. The devices and methods described herein can be implemented in software, and of course, they can also be implemented in hardware, which are all within the protection scope of this application.
本申请中的术语“第一”、“第二”和“第三”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或模块的过程、方法、系统、产品或设备没有限定于已列出的步骤或模块,而是某些实施例还包括没有列出的步骤或模块,或某些实施例还包括对于这些过程、方法、产品或设备固有的其它步骤或模块。The terms "first", "second", "third", and the like in this application are used to distinguish different objects, and are not used to describe a specific order. Furthermore, the terms "including" and "having", as well as any of them, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device containing a series of steps or modules is not limited to the listed steps or modules, but some embodiments also include steps or modules not listed, or certain embodiments Other steps or modules inherent to these processes, methods, products or equipment are also included.
在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。Reference to "an embodiment" herein means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present application. The appearances of this phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are they independent or alternative embodiments that are mutually exclusive with other embodiments. It is clearly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
本申请实施例提供一种音乐播放方法,该音乐播放方法的执行主体可以是本申请实施例提供的音乐播放装置,或者集成了该音乐播放装置的电子设备,其中该音乐播放装置可 以采用硬件或者软件的方式实现。其中,电子设备可以是智能手机、平板电脑、掌上电脑、笔记本电脑、或者台式电脑等设备。The embodiment of the present application provides a music playback method. The execution subject of the music playback method may be the music playback device provided by the embodiment of the application, or an electronic device integrated with the music playback device. The music playback device may use hardware or Software way. The electronic device may be a smart phone, a tablet computer, a palmtop computer, a notebook computer, or a desktop computer.
本申请实施例提供一种音乐播放方法,其中,包括:An embodiment of the present application provides a method for playing music, which includes:
接收输入的语音信息,并判断所述语音信息是否为音乐播放指令;Receiving the input voice information, and determining whether the voice information is a music playback instruction;
在所述语音信息为音乐播放指令时,判断本地是否存在对应所述音乐播放指令的第一目标音乐文件;When the voice information is a music playback instruction, determining whether a first target music file corresponding to the music playback instruction exists locally;
在本地不存在所述第一目标音乐文件时,通过第三方音乐应用获取所述第一目标音乐文件;When the first target music file does not exist locally, acquiring the first target music file through a third-party music application;
通过所述第三方音乐应用播放获取到的所述第一目标音乐文件。Playing the acquired first target music file through the third-party music application.
在一实施例中,所述第三方音乐应用包括第三方网页音乐应用和第三方本地音乐应用,所述通过第三方音乐应用获取所述第一目标音乐文件,包括:In an embodiment, the third-party music application includes a third-party web music application and a third-party local music application, and the obtaining the first target music file through the third-party music application includes:
判断当前是否安装有所述第三方本地音乐应用;Determine whether the third-party local music application is currently installed;
在当前未安装所述第三方本地音乐应用时,通过所述第三方网页音乐应用获取所述第一目标音乐文件。When the third-party local music application is not currently installed, the first target music file is obtained through the third-party web music application.
在一实施例中,在当前未安装所述第三方本地音乐应用时,还执行:In an embodiment, when the third-party local music application is not currently installed, the following is also performed:
获取所述第三方本地音乐应用的应用安装包;Obtaining an application installation package of the third-party local music application;
根据所述应用安装包安装所述第三方本地音乐应用。Install the third-party local music application according to the application installation package.
在一实施例中,所述根据所述应用安装包安装所述第三方本地音乐应用之后,还包括:In an embodiment, after installing the third-party local music application according to the application installation package, the method further includes:
在通过所述第三方网页音乐应用播放所述第一目标音乐文件期间,接收新的音乐播放指令;Receiving a new music playback instruction while playing the first target music file through the third-party webpage music application;
确定对应所述新的音乐播放指令的第二目标音乐文件,并通过所述第三方本地音乐应用播放所述第二目标音乐文件。A second target music file corresponding to the new music playback instruction is determined, and the second target music file is played through the third-party local music application.
在一实施例中,所述判断所述语音信息是否为音乐播放指令之前,还包括:In an embodiment, before determining whether the voice information is a music playback instruction, the method further includes:
获取所述语音信息的声纹特征;Acquiring voiceprint characteristics of the voice information;
判断所述声纹特征是否与预设声纹特征匹配;Determining whether the voiceprint feature matches a preset voiceprint feature;
在所述声纹特征与预设声纹特征匹配时,判断所述语音信息是否为音乐播放指令。When the voiceprint feature matches a preset voiceprint feature, it is determined whether the voice information is a music playback instruction.
在一实施例中,所述判断所述声纹特征是否与预设声纹特征匹配,包括:In an embodiment, determining whether the voiceprint feature matches a preset voiceprint feature includes:
获取所述声纹特征和所述预设声纹特征的相似度;Obtaining a similarity between the voiceprint feature and the preset voiceprint feature;
判断所述相似度是否大于或等于第一预设相似度;Determining whether the similarity is greater than or equal to a first preset similarity;
在所述相似度大于或等于所述第一预设相似度时,确定所述声纹特征与所述预设声纹特征匹配。When the similarity is greater than or equal to the first preset similarity, it is determined that the voiceprint feature matches the preset voiceprint feature.
在一实施例中,所述判断所述相似度是否大于或等于第一预设相似度之后,还包括:In an embodiment, after determining whether the similarity is greater than or equal to the first preset similarity, the method further includes:
在所述相似度小于所述第一预设相似度且大于或等于第二预设相似度时,获取当前的位置信息;When the similarity is less than the first preset similarity and greater than or equal to the second preset similarity, obtaining current location information;
根据所述位置信息判断当前是否位于预设位置范围内;Judging whether it is currently within a preset position range according to the position information;
在当前位于预设位置范围内时,确定所述声纹特征与所述预设声纹特征匹配。When it is currently within the preset position range, it is determined that the voiceprint feature matches the preset voiceprint feature.
在一实施例中,所述判断所述声纹特征是否与预设声纹特征匹配之后,还包括:In an embodiment, after determining whether the voiceprint feature matches a preset voiceprint feature, the method further includes:
若所述声纹特征与所述预设声纹特征不匹配,则丢弃所述语音信息。If the voiceprint feature does not match the preset voiceprint feature, the voice information is discarded.
在一实施例中,所述判断本地是否存在对应音乐播放指令的第一目标音乐文件之后,还包括:In an embodiment, after determining whether a first target music file corresponding to a music playback instruction exists locally, the method further includes:
在本地存在第一目标音乐文件时,判断当前是否安装有第三方本地音乐应用;When the first target music file exists locally, determine whether a third-party local music application is currently installed;
在当前未安装第三方本地音乐应用时,通过系统音乐应用播放本地的第一目标音乐文件;When a third-party local music application is not currently installed, the local first target music file is played through the system music application;
在当前安装有第三方本地音乐应用时,通过第三方本地音乐应用播放本地的第一目标 音乐文件。When a third-party local music application is currently installed, the local first target music file is played through the third-party local music application.
请参照图1,图1为本申请实施例提供的音乐播放方法的流程示意图。如图1所示,本申请实施例提供的音乐播放方法的流程可以如下:Please refer to FIG. 1. FIG. 1 is a schematic flowchart of a music playback method according to an embodiment of the present application. As shown in FIG. 1, the flow of the music playing method provided by the embodiment of the present application may be as follows:
在步骤101中,接收输入的语音信息,并判断接收到的语音信息是否为音乐播放指令。In step 101, the input voice information is received, and it is determined whether the received voice information is a music playback instruction.
本申请实施例中,电子设备可以通过音频采集设备来接收输入的语音信息。其中,音频采集设备可以是电子设备内置的麦克风,也可以是电子设备外部接入的麦克风,本申请对此不做具体限制,可由本领域技术人员根据实际需要进行选取。比如,本申请实施例中,电子设备通过内置的麦克风来接收输入的语音信息。In the embodiment of the present application, the electronic device may receive the input voice information through the audio collection device. The audio collection device may be a microphone built in the electronic device or a microphone externally connected to the electronic device. This application does not specifically limit this, and can be selected by those skilled in the art according to actual needs. For example, in the embodiment of the present application, the electronic device receives input voice information through a built-in microphone.
在接收到输入的语音信息之后,电子设备对接收到的语音信息进行语音解析,得到对应该语音信息的语音解析结果,从而根据该语音解析结果判断接收到的语音信息是否为音乐播放指令。其中,对语音信息进行语音解析,也即是将语音信息由“声音”向“文字”的转换过程。After receiving the input voice information, the electronic device performs a voice analysis on the received voice information to obtain a voice analysis result corresponding to the voice information, so as to determine whether the received voice information is a music playback instruction according to the voice analysis result. Among them, the speech information is parsed, that is, the conversion process of the speech information from "sound" to "text".
比如,电子设备内置有语音解析引擎,请参照图2,用户说出“我要听XXX歌曲”的语音信息,电子设备在接收到的该语音信息之后,将该语音信息输入到语音解析引擎进行解析,得到对应该语音信息的解析结果“我要听XXX歌曲”,并确定“我要听XXX歌曲”为音乐播放指令。For example, the electronic device has a built-in speech parsing engine. Please refer to FIG. 2. The user speaks the voice information of “I want to listen to XXX songs”. After receiving the speech information, the electronic device inputs the speech information to the speech parsing engine. Parse to get the analysis result "I want to listen to XXX songs" corresponding to the voice information, and determine "I want to listen to XXX songs" as a music playback instruction.
又比如,电子设备未内置有语音解析引擎,用户说出“我要听XXX歌曲”的语音信息,电子设备在接收到该语音信息之后,将该语音信息发送至语音解析服务器(语音解析服务器为提供语音解析服务的服务器),指示语音解析服务器对语音信息进行语音解析,并返回对音乐信息的语音解析结果;之后,接收语音解析服务器返回的对语音信息的语音解析结果“我要听XXX歌曲”,并确定“我要听XXX歌曲”为音乐播放指令。For another example, the electronic device does not have a built-in speech analysis engine, and the user speaks the voice information of "I want to listen to XXX songs". After receiving the voice information, the electronic device sends the voice information to the voice analysis server (the voice analysis server is A server that provides a voice analysis service), instructs the voice analysis server to perform voice analysis on the voice information, and returns the voice analysis result of the music information; after that, receives the voice analysis result of the voice information returned by the voice analysis server, "I want to listen to XXX songs ", And determine" I want to listen to XXX songs "as a music playback instruction.
在步骤102中,在接收到的语音信息为音乐播放指令时,判断本地是否存在对应该音乐播放指令的第一目标音乐文件。In step 102, when the received voice information is a music playback instruction, it is determined whether a first target music file corresponding to the music playback instruction exists locally.
本申请实施例中,在接收到的语音信息为音乐播放指令时,从音乐播放指令提取出音乐标识信息,根据该语音标识信息在本地查找是否存在对应该音乐播放指令的第一目标音乐文件,其中,在本地未查找到第一目标音乐文件时,确定本地不存在第一目标音乐文件;或者,在本地查找第一目标音乐文件的查找时长达到预设时长,且未查找到第一目标音乐文件时,确定本地不存在第一目标音乐文件,该预设时长可根据实际需要取合适值,比如,可以将该预设时长配置为500毫秒、1秒等。In the embodiment of the present application, when the received voice information is a music playback instruction, music identification information is extracted from the music playback instruction, and according to the voice identification information, whether a first target music file corresponding to the music playback instruction exists locally is found, Wherein, when the first target music file is not found locally, it is determined that the first target music file does not exist locally; or, the search duration of the first target music file locally reaches a preset duration, and the first target music is not found When the file is determined, it is determined that the first target music file does not exist locally, and the preset duration may be set to a suitable value according to actual needs. For example, the preset duration may be configured to 500 milliseconds, 1 second, and the like.
在步骤103中,在本地不存在第一目标音乐文件时,通过第三方音乐应用获取第一目标音乐文件。In step 103, when the first target music file does not exist locally, the first target music file is obtained through a third-party music application.
在步骤104中,通过第三方音乐应用播放获取到的第一目标音乐文件。In step 104, the acquired first target music file is played through a third-party music application.
本申请实施例中,在完成对本地是否存在第一目标音乐文件的判断,且本地不存在第一目标音乐文件时,电子设备通过第三方音乐应用获取到第一目标音乐文件。其中,第三方音乐应用为电子设备厂家之外的其它厂家所提供的音乐应用(比如QQ音乐,电子设备厂家所提供的音乐应用,通常在电子设备出厂时集成在电子设备的操作系统中,称作系统音乐应用。In the embodiment of the present application, when determining whether a first target music file exists locally and the first target music file does not exist locally, the electronic device obtains the first target music file through a third-party music application. Among them, third-party music applications are music applications provided by other manufacturers other than electronic device manufacturers (such as QQ music, music applications provided by electronic device manufacturers, which are usually integrated into the operating system of the electronic device when the electronic device leaves the factory. For system music applications.
在通过第三方音乐应用获取第一目标音乐文件时,一方面,电子设备首先按照预定报文格式,通过运行的第三方音乐应用构建音乐获取请求,该音乐获取请求至少包括第一目标音乐文件的音乐标识信息(也即是从音乐播放指令中提取出的音乐标识信息);之后,通过第三方音乐应用将构建的音乐获取请求发送至音乐服务器(该音乐服务器为向第三方音乐应用提供服务的服务器),指示音乐服务器查找到第一目标音乐文件并返回,相应接收音乐服务器返回的第一目标音乐文件;另一方面,音乐服务器在接收到电子设备通过第三方音乐应用发送的音乐获取请求之后,按照音乐获取请求的指示,根据其维护的音乐标 识信息和音乐文件的关联关系,查找到与音乐获取请求中的音乐标识信息所对应的音乐文件,将该音乐文件作为第一目标音乐文件返回至电子设备。When acquiring the first target music file through a third-party music application, on the one hand, the electronic device first constructs a music acquisition request through a running third-party music application in accordance with a predetermined message format, and the music acquisition request includes at least the first target music file. Music identification information (that is, music identification information extracted from music playback instructions); then, a third-party music application sends a constructed music acquisition request to a music server (the music server provides services to third-party music applications Server), instructs the music server to find and return the first target music file, and correspondingly receives the first target music file returned by the music server; on the other hand, after receiving the music acquisition request sent by the electronic device through the third-party music application, , According to the instruction of the music acquisition request, according to the association between the music identification information and the music file maintained by it, find the music file corresponding to the music identification information in the music acquisition request, and return the music file as the first target music file To electronic equipment
电子设备在接收到音乐服务器返回的第一目标音乐文件之后,即可通过第三方音乐应用播放获取到的第一目标音乐文件。After receiving the first target music file returned by the music server, the electronic device can play the obtained first target music file through a third-party music application.
由上可知,本申请实施例中,电子设备可以接收输入的语音信息,并判断接收到的语音信息是否为音乐播放指令。在接收到的语音信息为音乐播放指令时,判断本地是否存在对应音乐播放指令的第一目标音乐文件。在本地不存在第一目标音乐文件时,通过第三方音乐应用获取第一目标音乐文件。通过第三方音乐应用播放获取到的所述第一目标音乐文件。本方案中,能够在本地不存在需要播放的目标音乐文件,也即是无法通过系统音乐应用进行音乐播放时,通过第三方音乐应用实现目标音乐文件的播放,可以提高电子设备进行音乐播放的成功率。It can be known from the above that in the embodiment of the present application, the electronic device can receive the input voice information, and determine whether the received voice information is a music playback instruction. When the received voice information is a music playback instruction, it is determined whether a first target music file corresponding to the music playback instruction exists locally. When the first target music file does not exist locally, the first target music file is obtained through a third-party music application. Playing the acquired first target music file through a third-party music application. In this solution, when the target music file that needs to be played does not exist locally, that is, when the music playback cannot be performed through the system music application, the target music file can be played through the third-party music application, which can improve the success of music playback on the electronic device. rate.
在一实施例中,第三方音乐应用包括第三方网页音乐应用和第三方本地音乐应用,通过第三方音乐应用获取第一目标音乐文件,包括:In an embodiment, the third-party music application includes a third-party web music application and a third-party local music application, and obtaining the first target music file through the third-party music application includes:
判断当前是否安装有第三方本地音乐应用;Determine whether a third-party local music application is currently installed;
在当前未安装第三方本地音乐应用时,通过第三方网页音乐应用获取第一目标音乐文件。When the third-party local music application is not currently installed, the first target music file is obtained through a third-party web music application.
需要说明的是,本地应用是一种将安装包安装在电子设备本地才能使用的应用软件,需要占据电子设备一定的存储资源。而网页应用是一种使用网页浏览器在互联网或企业内部网上操作的应用软件,是一种以网页语言(例如HTML、JavaScript、Java等编程语言)撰写的应用程式,需要通过浏览器来执行,比如可以统一通过某个开放平台进行访问。需要解释的是,现有网页应用的安装包、以及运行时产生的缓存数据均存储在该开放平台的服务器中,其不需要在电子设备中安装运行,从而尽可能节省电子设备的存储资源,而电子设备可以通过该开放平台中的应用接口与该网页应用的厂家服务器进行数据通信,实现对该网页应用的访问,此时,该开放平台的服务器充当代理服务器的角色,每一网页应用对应一个应用接口。It should be noted that the local application is an application software that can be used by installing the installation package locally on the electronic device, and needs to occupy a certain storage resource of the electronic device. A web application is an application software that uses a web browser to operate on the Internet or an intranet. It is an application written in a web language (such as a programming language such as HTML, JavaScript, Java, etc.) and needs to be executed by a browser. For example, it can be accessed uniformly through an open platform. It needs to be explained that the installation package of the existing web application and the cache data generated during runtime are stored in the server of the open platform, which does not need to be installed and run in the electronic device, thereby saving the storage resources of the electronic device as much as possible. The electronic device can perform data communication with the web server of the manufacturer of the web application through the application interface in the open platform to achieve access to the web application. At this time, the server of the open platform acts as a proxy server, and each web application corresponds to An application interface.
本申请实施例中,电子设备在通过第三方音乐应用获取第一目标音乐文件时,首先判断当前是否安装有第三方本地音乐应用,若判断当前未安装有第三方本地音乐应用,则基于网页浏览器运行第三方网页音乐应用,通过该第三方网页音乐应用获取第一目标音乐文件。In the embodiment of the present application, when the electronic device obtains the first target music file through a third-party music application, it first determines whether a third-party local music application is currently installed. If it is determined that the third-party local music application is not currently installed, the web browsing is performed. The browser runs a third-party webpage music application, and obtains the first target music file through the third-party webpage music application.
其中,在通过第三方网页音乐应用获取第一目标音乐文件时,一方面,电子设备首先按照预定报文格式,通过运行的第三方网页音乐应用构建音乐获取请求,该音乐获取请求至少包括第一目标音乐文件的音乐标识信息(也即是从音乐播放指令中提取出的音乐标识信息);之后,通过第三方网页音乐应用将构建的音乐获取请求发送至音乐服务器(该音乐服务器为向第三方网页音乐应用提供服务的服务器),指示音乐服务器查找到第一目标音乐文件并返回,相应接收音乐服务器返回的第一目标音乐文件;另一方面,音乐服务器在接收到电子设备通过第三方网页音乐应用发送的音乐获取请求之后,按照音乐获取请求的指示,根据其维护的音乐标识信息和音乐文件的关联关系,查找到与音乐获取请求中的音乐标识信息所对应的音乐文件,将该音乐文件作为第一目标音乐文件返回至电子设备。When the first target music file is obtained through a third-party web music application, on the one hand, the electronic device first constructs a music acquisition request through a running third-party web music application in accordance with a predetermined message format. The music acquisition request includes at least the first The music identification information of the target music file (that is, the music identification information extracted from the music playback instruction); after that, the constructed music acquisition request is sent to the music server through a third-party web music application (the music server is to a third party A web music application server), instructs the music server to find and return the first target music file, and receives the first target music file returned by the music server accordingly; on the other hand, the music server receives the electronic device's music through a third-party web page. After the music acquisition request sent by the application, according to the instruction of the music acquisition request, according to the association between the music identification information and the music file maintained by the application, find the music file corresponding to the music identification information in the music acquisition request, and the music file As the first item The standard music file is returned to the electronic device.
电子设备在接收到音乐服务器返回的第一目标音乐文件之后,即可通过第三方网页音乐应用播放获取到的第一目标音乐文件。After receiving the first target music file returned by the music server, the electronic device can play the obtained first target music file through a third-party webpage music application.
在一实施例中,在当前未安装第三方本地音乐应用时,还执行以下步骤:In an embodiment, when a third-party local music application is not currently installed, the following steps are also performed:
获取第三方本地音乐应用的应用安装包;Obtain application installation packages of third-party local music applications;
根据获取到的应用安装包安装第三方本地音乐应用。Install a third-party local music application according to the obtained application installation package.
其中,电子设备可以从前述音乐服务器获取到第三方本地音乐应用的应用安装包,也 可以从应用平台(比如应用商店)获取到第三方本地音乐应用的音乐安装包。The electronic device may obtain an application installation package of a third-party local music application from the foregoing music server, or may obtain an music installation package of a third-party local music application from an application platform (such as an application store).
比如,请参照图3,电子设备通过XX浏览器运行第三方网页音乐应用,并通过该第三方网页音乐应用播放第一目标音乐文件“XX歌曲”,在播放期间,电子设备显示确认界面,该确认界面包括提示用户是否安装名称为“XX音乐”的第三方本地音乐应用的提示信息“是否安装XX音乐”,该确认界面包括用于输入确认信息的“是”控件,以及用于输入否认信息的“否”控件。在接收到基于“是”控件输入的确认信息时,电子设备从第三方网页音乐应用对应的音乐服务器处,获取到第三方本地音乐应用“XX音乐”的应用安装包。在获取到第三方本地音乐应用“XX音乐”的应用安装包之后,根据该应用安装包安装第三方本地音乐应用“XX音乐”。For example, referring to FIG. 3, the electronic device runs a third-party web music application through the XX browser, and plays the first target music file "XX song" through the third-party web music application. During the playback, the electronic device displays a confirmation interface. The confirmation interface includes a prompt message “Whether to install XX music” prompting the user whether to install a third-party local music application named “XX Music”. The confirmation interface includes a “Yes” control for inputting confirmation information, and input of denial information "No" control. When receiving the confirmation information input based on the “Yes” control, the electronic device obtains an application installation package of the third-party local music application “XX Music” from the music server corresponding to the third-party web music application. After obtaining the application installation package of the third-party local music application "XX Music", install the third-party local music application "XX Music" according to the application installation package.
在一实施例中,根据获取到的应用安装包安装第三方本地音乐应用之后,还包括:In an embodiment, after installing the third-party local music application according to the obtained application installation package, the method further includes:
在通过第三方网页音乐应用播放第一目标音乐文件期间,接收新的音乐播放指令;Receiving a new music playback instruction while playing a first target music file through a third-party web music application;
确定对应新的音乐播放指令的第二目标音乐文件,并通过第三方本地音乐应用播放第二目标音乐文件。A second target music file corresponding to the new music playback instruction is determined, and the second target music file is played through a third-party local music application.
本申请实施例中,在安装有第三方本地音乐应用之后,即可通过安装的第三方本地音乐应用来对新接收到的音乐播放指令进行响应。In the embodiment of the present application, after the third-party local music application is installed, the third-party local music application can be installed to respond to the newly received music playback instruction.
其中,在通过第三方网页音乐应用播放第一目标音乐文件期间,接收以语音方式输入的新的音乐播放指令。并在接收到新的语音播放指令时,确定对应新的音乐播放指令的第二目标音乐文件。在确定第二目标音乐文件之后,若本地存在第二目标音乐文件,则将控制第三方网页音乐应用停止播放第一目标音乐文件,并将运行第三方网页音乐应用的网页浏览器切换至后台,同时启动第三方本地音乐应用,通过第三方本地音乐播放本地的第二目标音乐文件;若本地不存在第二目标音乐文件,则以之前相同的方式启动第三方本地音乐应用之后,通过第三方本地音乐应用获取到第二目标音乐文件,并进行播放。During the playing of the first target music file through a third-party web music application, a new music playback instruction input in a voice manner is received. When a new voice playback instruction is received, a second target music file corresponding to the new music playback instruction is determined. After determining the second target music file, if the second target music file exists locally, the third-party web music application will be controlled to stop playing the first target music file, and the web browser running the third-party web music application will be switched to the background. At the same time, start the third-party local music application to play the local second target music file through the third-party local music. If the second target music file does not exist locally, start the third-party local music application in the same way as before, and then use the third-party local The music application obtains the second target music file and plays it.
比如,请参照图4,电子设备通过XX浏览器运行的“网页版”XX音乐播放XX歌曲,并在播放过程中安装了“本地版”XX音乐,当接收到新的音乐播放指令“播放YY歌曲”时,电子设备启动“本地版”XX音乐,并播放对应新的音乐播放指令的YY歌曲。For example, please refer to FIG. 4. The electronic device plays XX songs through the “web version” XX music running on the XX browser, and installs the “local version” XX music during playback. When a new music playback instruction “play YY” is received, "Song", the electronic device starts the "local version" of XX music and plays the YY song corresponding to the new music playback instruction.
在一实施例中,判断本地是否存在对应音乐播放指令的第一目标音乐文件之后,还包括:In an embodiment, after determining whether a first target music file corresponding to a music playback instruction exists locally, the method further includes:
在本地存在第一目标音乐文件时,判断当前是否安装有第三方本地音乐应用;When the first target music file exists locally, determine whether a third-party local music application is currently installed;
在当前未安装第三方本地音乐应用时,通过系统音乐应用播放本地的第一目标音乐文件;When a third-party local music application is not currently installed, the local first target music file is played through the system music application;
在当前安装有第三方本地音乐应用时,通过第三方本地音乐应用播放本地的第一目标音乐文件。When a third-party local music application is currently installed, the first target music file locally is played through the third-party local music application.
在一实施例中,判断接收到的语音信息是否为音乐播放指令之前,还包括:In an embodiment, before determining whether the received voice information is a music playback instruction, the method further includes:
获取接收到的语音信息的声纹特征;Obtain the voiceprint characteristics of the received voice information;
判断获取到的声纹特征是否与预设声纹特征匹配;Judging whether the acquired voiceprint features match the preset voiceprint features;
在获取到的声纹特征与预设声纹特征匹配时,判断接收到的语音信息是否为音乐播放指令。When the acquired voiceprint feature matches the preset voiceprint feature, it is determined whether the received voice information is a music playback instruction.
在实际生活中,每个人说话时的声音都有自己的特点,熟悉的人之间,可以只听声音而相互辨别出来。In actual life, everyone's voice when speaking has its own characteristics. Familiar people can distinguish each other only by listening to the voice.
这种声音的特点就是声纹特征,声纹特征主要由两个因素决定,第一个是声腔的尺寸,具体包括咽喉、鼻腔和口腔等,这些器官的形状、尺寸和位置决定了声带张力的大小和声音频率的范围。因此不同的人虽然说同样的话,但是声音的频率分布是不同的,听起来有的低沉有的洪亮。The characteristic of this sound is the voiceprint feature. The voiceprint feature is mainly determined by two factors. The first is the size of the acoustic cavity, which specifically includes the throat, nasal cavity, and oral cavity. The shape, size, and position of these organs determine the vocal cord tension Size and range of sound frequencies. Therefore, although different people say the same thing, the frequency distribution of the sound is different, and some sound low and loud.
第二个决定声纹特征的因素是发声器官被操纵的方式,发声器官包括唇、齿、舌、软 腭及腭肌肉等,他们之间相互作用就会产生清晰的语音。而他们之间的协作方式是人通过后天与周围人的交流中随机学习到的。人在学习说话的过程中,通过模拟周围不同人的说话方式,就会逐渐形成自己的声纹特征。The second factor that determines the characteristics of the voiceprint is the manner in which the vocal organs are manipulated. The vocal organs include lips, teeth, tongue, soft palate, and diaphragm muscles, and their interaction produces clear speech. And the way they collaborate is learned randomly by people in their interactions with the people around them. In the process of learning to speak, by simulating the speech of different people around them, they will gradually form their own voiceprint characteristics.
本申请实施例中,在接收到输入的语音信息时,电子设备首先获取到该语音信息的声纹特征。In the embodiment of the present application, when receiving the input voice information, the electronic device first obtains the voiceprint feature of the voice information.
在获取到语音信息的声纹特征之后,电子设备进一步将获取到的该声纹特征与预设声纹特征进行进行比对,以判断该声纹特征是否与预设声纹特征匹配。其中,预设声纹特征可以为机主预先录入的声纹特征,判断输入的语音信息的声纹特征是否与预设声纹特征匹配,也即是判断当前输入语音信息的用户是否为机主。After acquiring the voiceprint feature of the voice information, the electronic device further compares the acquired voiceprint feature with a preset voiceprint feature to determine whether the voiceprint feature matches the preset voiceprint feature. The preset voiceprint feature may be a voiceprint feature entered in advance by the owner, to determine whether the voiceprint feature of the input voice information matches the preset voiceprint feature, that is, to determine whether the user who currently inputs voice information is the owner .
在获取到的声纹特征与预设声纹特征匹配时,电子设备确定当前输入语音信息的用户为机主,此时判断接收到的语音信息是否为音乐播放指令,并在该语音信息为音乐播放指令时,对该音乐播放指令进行响应,具体可参照以上实施例的相关描述,此处不再赘述。When the acquired voiceprint characteristics match the preset voiceprint characteristics, the electronic device determines that the user currently inputting the voice information is the owner, and at this time determines whether the received voice information is a music playback instruction, and the voice information is music. When the instruction is played, the music playback instruction is responded. For details, refer to the related descriptions of the foregoing embodiments, and details are not described herein again.
其中,电子设备在判断获取到的声纹特征是否与预设声纹特征匹配时,可以获取该声纹特征(从接收到的语音信息所获取到的声纹特征)与预设声纹特征的相似度,并判断获取到的相似度是否大于或等于第一预设相似度(根据实际需要进行设置,比如,可以设置为95%)。其中,在获取到的相似度大于或等于第一预设相似度时,确定获取到的声纹特征与预设声纹特征匹配;在获取到的相似度小于低于相似度时,确定获取到的声纹特征与预设声纹特征不匹配。When the electronic device determines whether the obtained voiceprint feature matches the preset voiceprint feature, the electronic device may obtain the voiceprint feature (the voiceprint feature obtained from the received voice information) and the preset voiceprint feature. Similarity, and determine whether the obtained similarity is greater than or equal to the first preset similarity (set according to actual needs, for example, it can be set to 95%). Wherein, when the acquired similarity is greater than or equal to the first preset similarity, it is determined that the acquired voiceprint feature matches the preset voiceprint feature; when the acquired similarity is less than or lower than the similarity, it is determined that the acquired The voiceprint feature does not match the preset voiceprint feature.
此外,在获取到的声纹特征与预设声纹特征不匹配时,电子设备确定当前输入语音信息的用户不为机主,丢弃接收到的语音信息,并继续接收输入到的语音信息,直至接收到机主的语音信息时,判断接收到的该语音信息是否为音乐播放指令,并在该语音信息为音乐播放指令时,对该音乐播放指令进行响应,具体可参照以上实施例的相关描述,此处不再赘述。In addition, when the acquired voiceprint characteristics do not match the preset voiceprint characteristics, the electronic device determines that the user currently inputting the voice information is not the owner, discards the received voice information, and continues to receive the input voice information until When receiving the owner's voice information, determine whether the received voice information is a music playback instruction, and when the voice information is a music playback instruction, respond to the music playback instruction. For details, please refer to the related description of the foregoing embodiment. , Will not repeat them here.
本申请实施例通过在对输入的语音信息进行响应之前,首先根据该语音信息的声纹特征进行用户的身份识别,在且仅在输入语音信息的用户为机主时,才对输入语音信息进行响应。由此,能够避免电子设备执行非机主意愿的操作,提升机主的使用体验。In the embodiment of the present application, before responding to the input voice information, the user's identity is first identified according to the voiceprint characteristics of the voice information, and the input voice information is performed only when the user who inputs the voice information is the owner. response. Therefore, the electronic device can be prevented from performing operations that are not intended by the owner, and the use experience of the owner can be improved.
在一实施例中,判断获取到的相似度是否大于或等于第一预设相似度之后,还包括:In an embodiment, after determining whether the obtained similarity is greater than or equal to the first preset similarity, the method further includes:
在获取到的相似度小于第一预设相似度且大于或等于第二预设相似度时,获取当前的位置信息;When the obtained similarity is less than the first preset similarity and greater than or equal to the second preset similarity, obtaining current location information;
根据该位置信息判断当前是否位于预设位置范围内;Judging whether it is currently within a preset position range according to the position information;
在当前位于预设位置范围内时,确定获取的声纹特征与预设声纹特征匹配。When it is currently within the preset position range, it is determined that the acquired voiceprint feature matches the preset voiceprint feature.
需要说明的是,由于声纹特征和人体的生理特征密切相关,在日常生活中,如果用户感冒发炎的话,其声音将变得沙哑,声纹特征也将随之发生变化。在这种情况下,即使电子设备接收到的语音信息由机主说出,电子设备也无法识别出。此外,还存在多种导致电子设备无法识别出机主的情况,此处不再赘述。It should be noted that, because the characteristics of the voiceprint are closely related to the physiological characteristics of the human body, in daily life, if the user catches a cold, his voice will become hoarse, and the characteristics of the voiceprint will also change accordingly. In this case, even if the voice information received by the electronic device is spoken by the owner, the electronic device cannot recognize it. In addition, there are many situations that cause the electronic device to fail to identify the owner, which will not be repeated here.
为解决可能出现的、无法识别出机主的情况,在本申请实施例中,电子设备在完成对声纹特征相似度的判断之后,若接收到的语音信息的声纹特征与预设声纹特征的相似度小于第一预设相似度,进一步判断该声纹特征是否大于获等于第二预设相似度(该第二预设相似度配置为小于第一预设相似度,具体可由本领域技术人员根据实际需要取合适值,比如,在第一预设相似度被设置为95%时,可以将第二预设相似度设置为75%)。In order to solve the possible situation that the owner cannot be identified, in the embodiment of the present application, after the electronic device completes the judgment of the similarity of the voiceprint feature, if the voiceprint feature of the received voice information and the preset voiceprint are The similarity of the features is less than the first preset similarity, and it is further judged whether the voiceprint feature is greater than or equal to the second preset similarity (the second preset similarity is configured to be less than the first preset similarity, which can be specifically determined by the art The technician takes an appropriate value according to actual needs, for example, when the first preset similarity is set to 95%, the second preset similarity may be set to 75%).
在判断结果为是,也即是获取到的语音信息的声纹特征、与预设声纹特征的相似度小于第一预设相似度且大于或等于第二预设相似度时,电子设备进一步获取到当前的位置信息。其中,电子设备可以采用卫星定位技术或者基站定位技术等不同的定位技术来获取到当前的位置信息。When the judgment result is yes, that is, the voiceprint feature of the acquired voice information and the similarity with the preset voiceprint feature is less than the first preset similarity and greater than or equal to the second preset similarity, the electronic device further Get the current location information. The electronic device may use different positioning technologies such as satellite positioning technology or base station positioning technology to obtain the current position information.
在获取到当前的位置信息之后,电子设备根据该位置信息判断当前是否位于预设位置范围内。其中,预设位置范围可以配置为机主的常用位置范围,比如家里和公司等。After acquiring the current position information, the electronic device determines whether it is currently within a preset position range according to the position information. Among them, the preset position range can be configured as a common position range of the owner, such as home and company.
在当前位于预设位置范围内时,电子设备确定前述声纹特征与预设声纹特征匹配,将输入语音信息的当前用户识别为机主。When it is currently within the preset position range, the electronic device determines that the aforementioned voiceprint feature matches the preset voiceprint feature, and recognizes the current user who inputs the voice information as the owner.
下面将在上述实施例描述的方法基础上,对本申请的音乐播放方法做进一步介绍。请参照图5,该音乐播放方法可以包括:Based on the methods described in the above embodiments, the music playing method of the present application will be further described below. Referring to FIG. 5, the music playing method may include:
在步骤201中,接收输入的语音信息,并获取接收到的语音信息的声纹特征。In step 201, input voice information is received, and voiceprint characteristics of the received voice information are acquired.
在实际生活中,每个人说话时的声音都有自己的特点,熟悉的人之间,可以只听声音而相互辨别出来。In actual life, everyone's voice when speaking has its own characteristics. Familiar people can distinguish each other only by listening to the voice.
这种声音的特点就是声纹特征,声纹特征主要由两个因素决定,第一个是声腔的尺寸,具体包括咽喉、鼻腔和口腔等,这些器官的形状、尺寸和位置决定了声带张力的大小和声音频率的范围。因此不同的人虽然说同样的话,但是声音的频率分布是不同的,听起来有的低沉有的洪亮。The characteristic of this sound is the voiceprint feature. The voiceprint feature is mainly determined by two factors. The first is the size of the acoustic cavity, which specifically includes the throat, nasal cavity, and oral cavity. The shape, size, and position of these organs determine the vocal cord tension Size and range of sound frequencies. Therefore, although different people say the same thing, the frequency distribution of the sound is different, and some sound low and loud.
第二个决定声纹特征的因素是发声器官被操纵的方式,发声器官包括唇、齿、舌、软腭及腭肌肉等,他们之间相互作用就会产生清晰的语音。而他们之间的协作方式是人通过后天与周围人的交流中随机学习到的。人在学习说话的过程中,通过模拟周围不同人的说话方式,就会逐渐形成自己的声纹特征。The second factor that determines the characteristics of the voiceprint is the manner in which the vocal organs are manipulated. The vocal organs include lips, teeth, tongue, soft palate, and diaphragm muscles, and their interaction produces clear speech. And the way they collaborate is learned randomly by people in their interactions with the people around them. In the process of learning to speak, by simulating the speech of different people around them, they will gradually form their own voiceprint characteristics.
本申请实施例中,电子设备可以通过音频采集设备来接收输入的语音信息。其中,音频采集设备可以是电子设备内置的麦克风,也可以是电子设备外部接入的麦克风,本申请对此不做具体限制,可由本领域技术人员根据实际需要进行选取。比如,本申请实施例中,电子设备通过内置的麦克风来接收输入的语音信息。In the embodiment of the present application, the electronic device may receive the input voice information through the audio collection device. The audio collection device may be a microphone built in the electronic device or a microphone externally connected to the electronic device. This application does not specifically limit this, and can be selected by those skilled in the art according to actual needs. For example, in the embodiment of the present application, the electronic device receives input voice information through a built-in microphone.
在接收到输入的语音信息之后,电子设备首先获取到该语音信息的声纹特征。After receiving the input voice information, the electronic device first obtains the voiceprint characteristics of the voice information.
在步骤202中,判断获取到的声纹特征是否与预设声纹特征匹配。In step 202, it is determined whether the acquired voiceprint feature matches a preset voiceprint feature.
在获取到语音信息的声纹特征之后,电子设备进一步将获取到的该声纹特征与预设声纹特征进行进行比对,以判断该声纹特征是否与预设声纹特征匹配。其中,预设声纹特征可以为机主预先录入的声纹特征,判断输入的语音信息的声纹特征是否与预设声纹特征匹配,也即是判断当前输入语音信息的用户是否为机主。After acquiring the voiceprint feature of the voice information, the electronic device further compares the acquired voiceprint feature with a preset voiceprint feature to determine whether the voiceprint feature matches the preset voiceprint feature. The preset voiceprint feature may be a voiceprint feature entered in advance by the owner, to determine whether the voiceprint feature of the input voice information matches the preset voiceprint feature, that is, to determine whether the user who currently inputs voice information is the owner .
在步骤203中,在获取到的声纹特征与预设声纹特征匹配时,判断接收到的语音信息是否为音乐播放指令。In step 203, when the acquired voiceprint feature matches a preset voiceprint feature, it is determined whether the received voice information is a music playback instruction.
在获取到的声纹特征与预设声纹特征匹配时,电子设备确定当前输入语音信息的用户为机主,此时判断接收到的语音信息是否为音乐播放指令。When the acquired voiceprint characteristics match the preset voiceprint characteristics, the electronic device determines that the user currently inputting the voice information is the owner, and at this time determines whether the received voice information is a music playback instruction.
在判断接收到的语音信息是否为音乐播放指令时,电子设备对接收到的语音信息进行语音解析,得到对应该语音信息的语音解析结果,根据该语音解析结果判断接收到的语音信息是否为音乐播放指令。其中,对语音信息进行语音解析,也即是将语音信息由“声音”向“文字”的转换过程。When determining whether the received voice information is a music playback instruction, the electronic device performs a voice analysis on the received voice information to obtain a voice analysis result corresponding to the voice information, and determines whether the received voice information is music based on the voice analysis result. Play instruction. Among them, the speech information is parsed, that is, the conversion process of the speech information from "sound" to "text".
比如,电子设备内置有语音解析引擎,请参照图2,用户说出“我要听XXX歌曲”的语音信息,电子设备在接收到的该语音信息之后,将该语音信息输入到语音解析引擎进行解析,得到对应该语音信息的解析结果“我要听XXX歌曲”,并确定“我要听XXX歌曲”为音乐播放指令。For example, the electronic device has a built-in speech parsing engine. Please refer to FIG. 2. The user speaks the voice information of “I want to listen to XXX songs”. After receiving the speech information, the electronic device inputs the speech information to the speech parsing engine. Parse to get the analysis result "I want to listen to XXX songs" corresponding to the voice information, and determine "I want to listen to XXX songs" as a music playback instruction.
又比如,电子设备未内置有语音解析引擎,用户说出“我要听XXX歌曲”的语音信息,电子设备在接收到该语音信息之后,将该语音信息发送至语音解析服务器(语音解析服务器为提供语音解析服务的服务器),指示语音解析服务器对语音信息进行语音解析,并返回对音乐信息的语音解析结果;之后,接收语音解析服务器返回的对语音信息的语音解析 结果“我要听XXX歌曲”,并确定“我要听XXX歌曲”为音乐播放指令。For another example, the electronic device does not have a built-in speech analysis engine, and the user speaks the voice information of "I want to listen to XXX songs". After receiving the voice information, the electronic device sends the voice information to the voice analysis server (the voice analysis server is A server that provides a voice analysis service), instructs the voice analysis server to perform voice analysis on the voice information, and returns a voice analysis result of the music information; and then receives the voice analysis result of the voice information returned by the voice analysis server, "I want to listen to XXX songs ", And determine" I want to listen to XXX songs "as a music playback instruction.
在步骤204中,在接收到的语音信息为音乐播放指令时,判断本地是否存在对应该音乐播放指令的第一目标音乐文件。In step 204, when the received voice information is a music playback instruction, it is determined whether a first target music file corresponding to the music playback instruction exists locally.
本申请实施例中,在接收到的语音信息为音乐播放指令时,从音乐播放指令提取出音乐标识信息,根据该语音标识信息在本地查找是否存在对应该音乐播放指令的第一目标音乐文件,其中,在本地未查找到第一目标音乐文件时,确定本地不存在第一目标音乐文件;或者,在本地查找第一目标音乐文件的查找时长达到预设时长,且未查找到第一目标音乐文件时,确定本地不存在第一目标音乐文件,该预设时长可根据实际需要取合适值,比如,可以将该预设时长配置为500毫秒、1秒等。In the embodiment of the present application, when the received voice information is a music playback instruction, music identification information is extracted from the music playback instruction, and according to the voice identification information, whether a first target music file corresponding to the music playback instruction exists locally is found, Wherein, when the first target music file is not found locally, it is determined that the first target music file does not exist locally; or, the search duration of the first target music file locally reaches a preset duration, and the first target music is not found When the file is determined, it is determined that the first target music file does not exist locally, and the preset duration may be set to a suitable value according to actual needs. For example, the preset duration may be configured to 500 milliseconds, 1 second, and the like.
在步骤205中,在本地不存在第一目标音乐文件时,通过第三方音乐应用获取第一目标音乐文件。In step 205, when the first target music file does not exist locally, the first target music file is obtained through a third-party music application.
在步骤206中,通过第三方音乐应用播放获取到的第一目标音乐文件。In step 206, the acquired first target music file is played through a third-party music application.
本申请实施例中,在完成对本地是否存在第一目标音乐文件的判断,且本地不存在第一目标音乐文件时,电子设备通过第三方音乐应用获取到第一目标音乐文件。其中,第三方音乐应用为电子设备厂家之外的其它厂家所提供的音乐应用(比如QQ音乐,电子设备厂家所提供的音乐应用,通常在电子设备出厂时集成在电子设备的操作系统中,称作系统音乐应用。In the embodiment of the present application, when determining whether a first target music file exists locally and the first target music file does not exist locally, the electronic device obtains the first target music file through a third-party music application. Among them, third-party music applications are music applications provided by other manufacturers other than electronic device manufacturers (such as QQ music, music applications provided by electronic device manufacturers, which are usually integrated into the operating system of the electronic device when the electronic device leaves the factory. For system music applications.
在通过第三方音乐应用获取第一目标音乐文件时,一方面,电子设备首先按照预定报文格式,通过运行的第三方音乐应用构建音乐获取请求,该音乐获取请求至少包括第一目标音乐文件的音乐标识信息(也即是从音乐播放指令中提取出的音乐标识信息);之后,通过第三方音乐应用将构建的音乐获取请求发送至音乐服务器(该音乐服务器为向第三方音乐应用提供服务的服务器),指示音乐服务器查找到第一目标音乐文件并返回,相应接收音乐服务器返回的第一目标音乐文件;另一方面,音乐服务器在接收到电子设备通过第三方音乐应用发送的音乐获取请求之后,按照音乐获取请求的指示,根据其维护的音乐标识信息和音乐文件的关联关系,查找到与音乐获取请求中的音乐标识信息所对应的音乐文件,将该音乐文件作为第一目标音乐文件返回至电子设备。When acquiring the first target music file through a third-party music application, on the one hand, the electronic device first constructs a music acquisition request through a running third-party music application in accordance with a predetermined message format, and the music acquisition request includes at least the first target music file. Music identification information (that is, music identification information extracted from music playback instructions); then, a third-party music application sends a constructed music acquisition request to a music server (the music server provides services to third-party music applications Server), instructs the music server to find and return the first target music file, and correspondingly receives the first target music file returned by the music server; on the other hand, after receiving the music acquisition request sent by the electronic device through the third-party music application, , According to the instruction of the music acquisition request, according to the association between the music identification information and the music file maintained by it, find the music file corresponding to the music identification information in the music acquisition request, and return the music file as the first target music file To electronic equipment.
电子设备在接收到音乐服务器返回的第一目标音乐文件之后,即可通过第三方音乐应用播放获取到的第一目标音乐文件。After receiving the first target music file returned by the music server, the electronic device can play the obtained first target music file through a third-party music application.
在一实施例中,还提供了一种音乐播放装置。请参照图6,图6为本申请实施例提供的音乐播放装置400的结构示意图。其中该音乐播放装置应用于电子设备,该音乐播放装置包括指令识别模块401、文件判断模块402、文件获取模块403和文件播放模块404,如下:In one embodiment, a music playback device is also provided. Please refer to FIG. 6, which is a schematic structural diagram of a music playback device 400 according to an embodiment of the present application. The music playback device is applied to an electronic device. The music playback device includes an instruction recognition module 401, a file judgment module 402, a file acquisition module 403, and a file playback module 404, as follows:
指令识别模块401,用于接收输入的语音信息,并判断接收到的语音信息是否为音乐播放指令。The instruction recognition module 401 is configured to receive input voice information and determine whether the received voice information is a music playback instruction.
文件判断模块402,用于在接收到的语音信息为音乐播放指令时,判断本地是否存在对应该音乐播放指令的第一目标音乐文件。The file determining module 402 is configured to determine whether a first target music file corresponding to the music playback instruction exists locally when the received voice information is a music playback instruction.
文件获取模块403,用于在本地不存在第一目标音乐文件时,通过第三方音乐应用获取第一目标音乐文件。The file obtaining module 403 is configured to obtain the first target music file through a third-party music application when the first target music file does not exist locally.
文件播放模块404,用于通过第三方音乐应用播放获取到的第一目标音乐文件。The file playback module 404 is configured to play the acquired first target music file through a third-party music application.
在一实施例中,第三方音乐应用包括第三方网页音乐应用和第三方本地音乐应用,文件获取模块403,还可以用于:In an embodiment, the third-party music application includes a third-party web music application and a third-party local music application. The file acquisition module 403 may also be used to:
判断当前是否安装有第三方本地音乐应用;Determine whether a third-party local music application is currently installed;
在当前未安装第三方本地音乐应用时,通过第三方网页音乐应用获取第一目标音乐文 件。When a third-party local music application is not currently installed, the first target music file is obtained through a third-party web music application.
在一实施例中,音乐播放装置还包括应用安装模块,可以用于:In an embodiment, the music playback device further includes an application installation module, which can be used to:
在当前未安装第三方本地音乐应用时,获取第三方本地音乐应用的应用安装包;When a third-party local music application is not currently installed, obtain an application installation package of the third-party local music application;
根据获取到的应用安装包安装第三方本地音乐应用。Install a third-party local music application according to the obtained application installation package.
在一实施例中,指令识别模块401,还可以用于:In an embodiment, the instruction recognition module 401 may be further configured to:
在通过第三方网页音乐应用播放第一目标音乐文件期间,接收新的音乐播放指令;Receiving a new music playback instruction while playing a first target music file through a third-party web music application;
文件播放模块404,可以用于:The file playback module 404 can be used for:
确定对应新的音乐播放指令的第二目标音乐文件,并通过第三方本地音乐应用播放第二目标音乐文件。A second target music file corresponding to the new music playback instruction is determined, and the second target music file is played through a third-party local music application.
在一实施例中,文件播放模块404,还可以用于:In one embodiment, the file playback module 404 may be further configured to:
在本地存在第一目标音乐文件时,判断当前是否安装有第三方本地音乐应用;When the first target music file exists locally, determine whether a third-party local music application is currently installed;
在当前未安装第三方本地音乐应用时,通过系统音乐应用播放本地的第一目标音乐文件;When a third-party local music application is not currently installed, the local first target music file is played through the system music application;
在当前安装有第三方本地音乐应用时,通过第三方本地音乐应用播放本地的第一目标音乐文件。When a third-party local music application is currently installed, the first target music file locally is played through the third-party local music application.
在一实施例中,指令识别模块401,还可以用于:In an embodiment, the instruction recognition module 401 may be further configured to:
获取接收到的语音信息的声纹特征;Obtain the voiceprint characteristics of the received voice information;
判断获取到的声纹特征是否与预设声纹特征匹配;Judging whether the acquired voiceprint features match the preset voiceprint features;
在获取到的声纹特征与预设声纹特征匹配时,判断接收到的语音信息是否为音乐播放指令。When the acquired voiceprint feature matches the preset voiceprint feature, it is determined whether the received voice information is a music playback instruction.
在一实施例中,指令识别模块401,还可以用于:In an embodiment, the instruction recognition module 401 may be further configured to:
获取前述声纹特征和预设声纹特征的相似度;Obtaining the similarity between the aforementioned voiceprint feature and a preset voiceprint feature;
判断获取到的相似度是否大于或等于第一预设相似度;Determine whether the obtained similarity is greater than or equal to the first preset similarity;
在获取到的相似度大于或等于第一预设相似度时,确定前述声纹特征与预设声纹特征匹配。When the obtained similarity is greater than or equal to the first preset similarity, it is determined that the aforementioned voiceprint feature matches the preset voiceprint feature.
在一实施例中,指令识别模块401,还可以用于:In an embodiment, the instruction recognition module 401 may be further configured to:
在获取到的相似度小于第一预设相似度且大于或等于第二预设相似度时,获取当前的位置信息;When the obtained similarity is less than the first preset similarity and greater than or equal to the second preset similarity, obtaining current location information;
根据该位置信息判断当前是否位于预设位置范围内;Judging whether it is currently within a preset position range according to the position information;
在当前位于预设位置范围内时,确定获取的声纹特征与预设声纹特征匹配。When it is currently within the preset position range, it is determined that the acquired voiceprint feature matches the preset voiceprint feature.
其中,音乐播放装置400中各模块执行的步骤可以参考上述方法实施例描述的方法步骤。该音乐播放装置400可以集成在电子设备中,如手机、平板电脑等。For steps performed by each module in the music playback apparatus 400, reference may be made to the method steps described in the foregoing method embodiments. The music playback device 400 may be integrated in an electronic device, such as a mobile phone or a tablet computer.
在一实施例中,判断声纹特征是否与预设声纹特征匹配之后,指令识别模块401还可以用于:In an embodiment, after determining whether the voiceprint feature matches a preset voiceprint feature, the instruction recognition module 401 may be further configured to:
若声纹特征与预设声纹特征不匹配,则丢弃语音信息。If the voiceprint feature does not match the preset voiceprint feature, the voice information is discarded.
在一实施例中,判断本地是否存在对应音乐播放指令的第一目标音乐文件之后,文件播放模块404还可以用于:In an embodiment, after determining whether a first target music file corresponding to a music playback instruction exists locally, the file playback module 404 may be further configured to:
在本地存在第一目标音乐文件时,判断当前是否安装有第三方本地音乐应用;When the first target music file exists locally, determine whether a third-party local music application is currently installed;
在当前未安装第三方本地音乐应用时,通过系统音乐应用播放本地的第一目标音乐文件;When a third-party local music application is not currently installed, the local first target music file is played through the system music application;
在当前安装有第三方本地音乐应用时,通过第三方本地音乐应用播放本地的第一目标音乐文件。When a third-party local music application is currently installed, the first target music file locally is played through the third-party local music application.
具体实施时,以上各个模块可以作为独立的实体实现,也可以进行任意组合,作为同一或若干个实体来实现,以上各个单位的具体实施可参见前面的实施例,在此不再赘述。In specific implementation, the above modules can be implemented as independent entities, or can be arbitrarily combined, and implemented as the same or several entities. The specific implementation of the above units can refer to the previous embodiments, and will not be repeated here.
由上可知,本实施例音乐播放装置可以由指令识别模块401接收输入的语音信息,并判断接收到的语音信息是否为音乐播放指令。由文件判断模块402在接收到的语音信息为音乐播放指令时,判断本地是否存在对应音乐播放指令的第一目标音乐文件。由文件获取模块403在本地不存在第一目标音乐文件时,通过第三方音乐应用获取第一目标音乐文件。由文件播放模块404通过第三方音乐应用播放获取到的所述第一目标音乐文件。本方案中,能够在本地不存在需要播放的目标音乐文件,也即是无法通过系统音乐应用进行音乐播放时,通过第三方音乐应用实现目标音乐文件的播放,可以提高电子设备进行音乐播放的成功率。It can be known from the above that the music playback device in this embodiment may receive the input voice information by the instruction recognition module 401 and determine whether the received voice information is a music playback instruction. When the received voice information is a music playback instruction, the file determination module 402 determines whether a first target music file corresponding to the music playback instruction exists locally. When the first target music file does not exist locally by the file obtaining module 403, the first target music file is obtained through a third-party music application. The first target music file obtained by the file playback module 404 is played by a third-party music application. In this solution, when the target music file that needs to be played does not exist locally, that is, when the music playback cannot be performed through the system music application, the target music file can be played through the third-party music application, which can improve the success of music playback on the electronic device. rate.
在一实施例中,还提供一种电子设备。请参照图7,电子设备500包括处理器501以及存储器502。其中,处理器501与存储器502电性连接。In one embodiment, an electronic device is also provided. Referring to FIG. 7, the electronic device 500 includes a processor 501 and a memory 502. The processor 501 is electrically connected to the memory 502.
处理器500是电子设备500的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或加载存储在存储器502内的计算机程序,以及调用存储在存储器502内的数据,执行电子设备500的各种功能并处理数据。The processor 500 is a control center of the electronic device 500. It connects various parts of the entire electronic device by using various interfaces and lines. Various functions of the device 500 and process data.
存储器502可用于存储软件程序以及模块,处理器501通过运行存储在存储器502的计算机程序以及模块,从而执行各种功能应用以及数据处理。存储器502可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的计算机程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据电子设备的使用所创建的数据等。此外,存储器502可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。相应地,存储器502还可以包括存储器控制器,以提供处理器501对存储器502的访问。The memory 502 may be configured to store software programs and modules. The processor 501 executes various functional applications and data processing by running computer programs and modules stored in the memory 502. The memory 502 may mainly include a storage program area and a storage data area, where the storage program area may store an operating system, a computer program (such as a sound playback function, an image playback function, etc.) required for at least one function, and the like; Data created by the use of electronic devices, etc. In addition, the memory 502 may include a high-speed random access memory, and may further include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 502 may further include a memory controller to provide the processor 501 with access to the memory 502.
在本申请实施例中,电子设备500中的处理器501会按照如下的步骤,将一个或一个以上的计算机程序的进程对应的指令加载到存储器502中,并由处理器501运行存储在存储器502中的计算机程序,从而实现各种功能,如下:In the embodiment of the present application, the processor 501 in the electronic device 500 loads the instructions corresponding to the process of one or more computer programs into the memory 502 according to the following steps, and the processor 501 runs and stores the memory 502 A computer program in the computer to achieve various functions, as follows:
接收输入的语音信息,并判断接收到的语音信息是否为音乐播放指令;Receiving the input voice information, and determining whether the received voice information is a music playback instruction;
在接收到的语音信息为音乐播放指令时,判断本地是否存在对应该音乐播放指令的第一目标音乐文件;When the received voice information is a music playback instruction, determine whether a first target music file corresponding to the music playback instruction exists locally;
在本地不存在第一目标音乐文件时,通过第三方音乐应用获取第一目标音乐文件;When the first target music file does not exist locally, obtain the first target music file through a third-party music application;
通过第三方音乐应用播放获取到的第一目标音乐文件。Play the acquired first target music file through a third-party music application.
请一并参阅图8,在某些实施方式中,电子设备500还可以包括:显示器503、射频电路504、音频电路505以及电源506。其中,其中,显示器503、射频电路504、音频电路505以及电源506分别与处理器501电性连接。Please refer to FIG. 8 together. In some embodiments, the electronic device 500 may further include a display 503, a radio frequency circuit 504, an audio circuit 505, and a power source 506. Among them, the display 503, the radio frequency circuit 504, the audio circuit 505, and the power supply 506 are electrically connected to the processor 501, respectively.
显示器503可以用于显示由用户输入的信息或提供给用户的信息以及各种图形用户接口,这些图形用户接口可以由图形、文本、图标、视频和其任意组合来构成。显示器503可以包括显示面板,在某些实施方式中,可以采用液晶显示器(Liquid Crystal Display,LCD)、或者有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板。The display 503 may be used to display information input by the user or information provided to the user and various graphical user interfaces. These graphical user interfaces may be composed of graphics, text, icons, videos, and any combination thereof. The display 503 may include a display panel. In some embodiments, the display panel may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), or an organic light emitting diode (Organic Light-Emitting Diode, OLED).
射频电路504可以用于收发射频信号,以通过无线通信与网络设备或其他电子设备建立无线通讯,与网络设备或其他电子设备之间收发信号。The radio frequency circuit 504 may be used to transmit and receive radio frequency signals to establish wireless communication with a network device or other electronic device through wireless communication, and transmit and receive signals to and from the network device or other electronic device.
音频电路505可以用于通过扬声器、传声器提供用户与电子设备之间的音频接口。The audio circuit 505 may be used to provide an audio interface between the user and the electronic device through a speaker or a microphone.
电源506可以用于给电子设备500的各个部件供电。在一些实施例中,电源506可以通过电源管理系统与处理器501逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。The power source 506 may be used to power various components of the electronic device 500. In some embodiments, the power supply 506 may be logically connected to the processor 501 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption management through the power management system.
尽管图8中未示出,电子设备500还可以包括摄像头、蓝牙模块等,在此不再赘述。Although not shown in FIG. 8, the electronic device 500 may further include a camera, a Bluetooth module, and the like, and details are not described herein again.
在某些实施方式中,第三方音乐应用包括第三方网页音乐应用和第三方本地音乐应用,在通过第三方音乐应用获取第一目标音乐文件时,处理器501可以执行以下步骤:In some implementation manners, the third-party music application includes a third-party web music application and a third-party local music application. When the first target music file is obtained through the third-party music application, the processor 501 may perform the following steps:
判断当前是否安装有第三方本地音乐应用;Determine whether a third-party local music application is currently installed;
在当前未安装第三方本地音乐应用时,通过第三方网页音乐应用获取第一目标音乐文件。When the third-party local music application is not currently installed, the first target music file is obtained through a third-party web music application.
在某些实施方式中,在当前未安装第三方本地音乐应用时,处理器501可以执行以下步骤:In some implementations, when a third-party local music application is not currently installed, the processor 501 may perform the following steps:
获取第三方本地音乐应用的应用安装包;Obtain application installation packages of third-party local music applications;
根据获取到的应用安装包安装第三方本地音乐应用。Install a third-party local music application according to the obtained application installation package.
在某些实施方式中,在根据获取到的应用安装包安装第三方本地音乐应用之后,处理器501可以执行以下步骤:In some embodiments, after installing a third-party local music application according to the obtained application installation package, the processor 501 may perform the following steps:
在通过第三方网页音乐应用播放第一目标音乐文件期间,接收新的音乐播放指令;Receiving a new music playback instruction while playing a first target music file through a third-party web music application;
确定对应新的音乐播放指令的第二目标音乐文件,并通过第三方本地音乐应用播放第二目标音乐文件。A second target music file corresponding to the new music playback instruction is determined, and the second target music file is played through a third-party local music application.
在某些实施方式中,在判断本地是否存在对应该音乐播放指令的第一目标音乐文件之后,处理器501可以执行以下步骤:In some embodiments, after determining whether a first target music file corresponding to the music playback instruction exists locally, the processor 501 may perform the following steps:
在本地存在第一目标音乐文件时,判断当前是否安装有第三方本地音乐应用;When the first target music file exists locally, determine whether a third-party local music application is currently installed;
在当前未安装第三方本地音乐应用时,通过系统音乐应用播放本地的第一目标音乐文件;When a third-party local music application is not currently installed, the local first target music file is played through the system music application;
在当前安装有第三方本地音乐应用时,通过第三方本地音乐应用播放本地的第一目标音乐文件。When a third-party local music application is currently installed, the first target music file locally is played through the third-party local music application.
在某些实施方式中,在判断接收到的语音信息是否为音乐播放指令之前,处理器501还可以执行以下步骤:In some implementations, before determining whether the received voice information is a music playback instruction, the processor 501 may further perform the following steps:
获取接收到的语音信息的声纹特征;Obtain the voiceprint characteristics of the received voice information;
判断获取到的声纹特征是否与预设声纹特征匹配;Judging whether the acquired voiceprint features match the preset voiceprint features;
在获取到的声纹特征与预设声纹特征匹配时,判断接收到的语音信息是否为音乐播放指令。When the acquired voiceprint feature matches the preset voiceprint feature, it is determined whether the received voice information is a music playback instruction.
在某些实施方式中,在判断获取到的声纹特征是否与预设声纹特征匹配时,处理器501还可以执行以下步骤:In some implementations, when determining whether the acquired voiceprint feature matches a preset voiceprint feature, the processor 501 may further perform the following steps:
获取前述声纹特征和预设声纹特征的相似度;Obtaining the similarity between the aforementioned voiceprint feature and a preset voiceprint feature;
判断获取到的相似度是否大于或等于第一预设相似度;Determine whether the obtained similarity is greater than or equal to the first preset similarity;
在获取到的相似度大于或等于第一预设相似度时,确定前述声纹特征与预设声纹特征匹配。When the obtained similarity is greater than or equal to the first preset similarity, it is determined that the aforementioned voiceprint feature matches the preset voiceprint feature.
在某些实施方式中,在判断获取到的相似度是否大于或等于第一预设相似度之后,处理器501还可以执行以下步骤:In some embodiments, after determining whether the obtained similarity is greater than or equal to the first preset similarity, the processor 501 may further perform the following steps:
在获取到的相似度小于第一预设相似度且大于或等于第二预设相似度时,获取当前的位置信息;When the obtained similarity is less than the first preset similarity and greater than or equal to the second preset similarity, obtaining current location information;
根据该位置信息判断当前是否位于预设位置范围内;Judging whether it is currently within a preset position range according to the position information;
在当前位于预设位置范围内时,确定获取的声纹特征与预设声纹特征匹配。When it is currently within the preset position range, it is determined that the acquired voiceprint feature matches the preset voiceprint feature.
在一实施例中,在判断声纹特征是否与预设声纹特征匹配之后,处理器501还可以执行:In an embodiment, after determining whether the voiceprint feature matches a preset voiceprint feature, the processor 501 may further execute:
若声纹特征与预设声纹特征不匹配,则丢弃语音信息。If the voiceprint feature does not match the preset voiceprint feature, the voice information is discarded.
在一实施例中,在判断本地是否存在对应音乐播放指令的第一目标音乐文件之后,处理器501还可以执行:In an embodiment, after determining whether a first target music file corresponding to a music playback instruction exists locally, the processor 501 may further execute:
在本地存在第一目标音乐文件时,判断当前是否安装有第三方本地音乐应用;When the first target music file exists locally, determine whether a third-party local music application is currently installed;
在当前未安装第三方本地音乐应用时,通过系统音乐应用播放本地的第一目标音乐文件;When a third-party local music application is not currently installed, the local first target music file is played through the system music application;
在当前安装有第三方本地音乐应用时,通过第三方本地音乐应用播放本地的第一目标音乐文件。When a third-party local music application is currently installed, the first target music file locally is played through the third-party local music application.
本申请实施例还提供一种存储介质,所述存储介质存储有计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行上述任一实施例中的音乐播放方法,比如:接收输入的语音信息,并判断接收到的语音信息是否为音乐播放指令;在接收到的语音信息为音乐播放指令时,判断本地是否存在对应该音乐播放指令的第一目标音乐文件;在本地不存在第一目标音乐文件时,通过第三方音乐应用获取第一目标音乐文件;通过第三方音乐应用播放获取到的第一目标音乐文件。An embodiment of the present application further provides a storage medium. The storage medium stores a computer program, and when the computer program runs on a computer, the computer causes the computer to execute the music playing method in any of the foregoing embodiments, such as: receiving Enter the voice information and determine whether the received voice information is a music playback instruction. When the received voice information is a music playback instruction, determine whether a first target music file corresponding to the music playback instruction exists locally; it does not exist locally When the first target music file is obtained, the first target music file is obtained through a third-party music application; and the obtained first target music file is played through a third-party music application.
本申请实施例中,存储介质可以是磁碟、光盘、只读存储器(Read Only Memory,ROM,)或者随机存取器(Random Access Memory,RAM)等。In the embodiment of the present application, the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM, ROM), or a random access device (Random Access Memory, RAM).
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above embodiments, the description of each embodiment has its own emphasis. For a part that is not described in detail in one embodiment, reference may be made to related descriptions in other embodiments.
需要说明的是,对本申请实施例的音乐播放方法而言,本领域普通测试人员可以理解实现本申请实施例的音乐播放方法的全部或部分流程,是可以通过计算机程序来控制相关的硬件来完成,所述计算机程序可存储于一计算机可读取存储介质中,如存储在电子设备的存储器中,并被该电子设备内的至少一个处理器执行,在执行过程中可包括如音乐播放方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储器、随机存取记忆体等。It should be noted that, for the music playing method of the embodiment of the present application, ordinary testers in the art can understand that all or part of the process of implementing the music playing method of the embodiment of the present application can be completed by controlling related hardware through a computer program. The computer program may be stored in a computer-readable storage medium, such as stored in a memory of an electronic device, and executed by at least one processor in the electronic device, and may include a method such as a music playback method during execution. The process of the embodiment. The storage medium may be a magnetic disk, an optical disk, a read-only memory, a random access memory, or the like.
对本申请实施例的音乐播放装置而言,其各功能模块可以集成在一个处理芯片中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中,所述存储介质譬如为只读存储器,磁盘或光盘等。For the music playback device of the embodiment of the present application, its functional modules may be integrated in one processing chip, or each module may exist separately physically, or two or more modules may be integrated in one module. The above integrated modules can be implemented in the form of hardware or software functional modules. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium, such as a read-only memory, a magnetic disk, or an optical disk. .
以上对本申请实施例所提供的一种音乐播放方法、装置、存储介质及电子设备进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。The music playback method, device, storage medium, and electronic equipment provided by the embodiments of the present application have been described in detail above. The specific examples are used in this document to explain the principles and implementation of the present application. The description of the above embodiments is only It is used to help understand the method of the application and its core ideas; at the same time, for those skilled in the art, according to the ideas of the application, there will be changes in the specific implementation and application scope. In summary, this specification The content should not be construed as a limitation on this application.

Claims (20)

  1. 一种音乐播放方法,其中,包括:A music playback method, including:
    接收输入的语音信息,并判断所述语音信息是否为音乐播放指令;Receiving the input voice information, and determining whether the voice information is a music playback instruction;
    在所述语音信息为音乐播放指令时,判断本地是否存在对应所述音乐播放指令的第一目标音乐文件;When the voice information is a music playback instruction, determining whether a first target music file corresponding to the music playback instruction exists locally;
    在本地不存在所述第一目标音乐文件时,通过第三方音乐应用获取所述第一目标音乐文件;When the first target music file does not exist locally, acquiring the first target music file through a third-party music application;
    通过所述第三方音乐应用播放获取到的所述第一目标音乐文件。Playing the acquired first target music file through the third-party music application.
  2. 如权利要求1所述的音乐播放方法,其中,所述第三方音乐应用包括第三方网页音乐应用和第三方本地音乐应用,所述通过第三方音乐应用获取所述第一目标音乐文件,包括:The music playing method according to claim 1, wherein the third-party music application comprises a third-party web music application and a third-party local music application, and the obtaining the first target music file through the third-party music application comprises:
    判断当前是否安装有所述第三方本地音乐应用;Determine whether the third-party local music application is currently installed;
    在当前未安装所述第三方本地音乐应用时,通过所述第三方网页音乐应用获取所述第一目标音乐文件。When the third-party local music application is not currently installed, the first target music file is obtained through the third-party web music application.
  3. 如权利要求2所述的音乐播放方法,其中,在当前未安装所述第三方本地音乐应用时,还执行:The music playing method according to claim 2, wherein, when the third-party local music application is not currently installed, further executing:
    获取所述第三方本地音乐应用的应用安装包;Obtaining an application installation package of the third-party local music application;
    根据所述应用安装包安装所述第三方本地音乐应用。Install the third-party local music application according to the application installation package.
  4. 如权利要求3所述的音乐播放方法,其中,所述根据所述应用安装包安装所述第三方本地音乐应用之后,还包括:The music playback method according to claim 3, wherein after installing the third-party local music application according to the application installation package, further comprising:
    在通过所述第三方网页音乐应用播放所述第一目标音乐文件期间,接收新的音乐播放指令;Receiving a new music playback instruction while playing the first target music file through the third-party webpage music application;
    确定对应所述新的音乐播放指令的第二目标音乐文件,并通过所述第三方本地音乐应用播放所述第二目标音乐文件。A second target music file corresponding to the new music playback instruction is determined, and the second target music file is played through the third-party local music application.
  5. 如权利要求1所述的音乐播放方法,其中,所述判断所述语音信息是否为音乐播放指令之前,还包括:The music playback method according to claim 1, wherein before determining whether the voice information is a music playback instruction, further comprising:
    获取所述语音信息的声纹特征;Acquiring voiceprint characteristics of the voice information;
    判断所述声纹特征是否与预设声纹特征匹配;Determining whether the voiceprint feature matches a preset voiceprint feature;
    在所述声纹特征与预设声纹特征匹配时,判断所述语音信息是否为音乐播放指令。When the voiceprint feature matches a preset voiceprint feature, it is determined whether the voice information is a music playback instruction.
  6. 如权利要求5所述的音乐播放方法,其中,所述判断所述声纹特征是否与预设声纹特征匹配,包括:The music playing method according to claim 5, wherein the determining whether the voiceprint feature matches a preset voiceprint feature comprises:
    获取所述声纹特征和所述预设声纹特征的相似度;Obtaining a similarity between the voiceprint feature and the preset voiceprint feature;
    判断所述相似度是否大于或等于第一预设相似度;Determining whether the similarity is greater than or equal to a first preset similarity;
    在所述相似度大于或等于所述第一预设相似度时,确定所述声纹特征与所述预设声纹特征匹配。When the similarity is greater than or equal to the first preset similarity, it is determined that the voiceprint feature matches the preset voiceprint feature.
  7. 如权利要求6所述的音乐播放方法,其中,所述判断所述相似度是否大于或等于第一预设相似度之后,还包括:The music playing method according to claim 6, wherein after determining whether the similarity is greater than or equal to a first preset similarity, further comprising:
    在所述相似度小于所述第一预设相似度且大于或等于第二预设相似度时,获取当前的位置信息;When the similarity is less than the first preset similarity and greater than or equal to the second preset similarity, obtaining current location information;
    根据所述位置信息判断当前是否位于预设位置范围内;Judging whether it is currently within a preset position range according to the position information;
    在当前位于预设位置范围内时,确定所述声纹特征与所述预设声纹特征匹配。When it is currently within the preset position range, it is determined that the voiceprint feature matches the preset voiceprint feature.
  8. 如权利要求5所述的音乐播放方法,其中,所述判断所述声纹特征是否与预设声纹特征匹配之后,还包括:The music playing method according to claim 5, wherein after determining whether the voiceprint feature matches a preset voiceprint feature, further comprising:
    若所述声纹特征与所述预设声纹特征不匹配,则丢弃所述语音信息。If the voiceprint feature does not match the preset voiceprint feature, the voice information is discarded.
  9. 如权利要求1所述的音乐播放方法,其中,所述判断本地是否存在对应音乐播放指令的第一目标音乐文件之后,还包括:The music playback method according to claim 1, wherein after determining whether a first target music file corresponding to a music playback instruction exists locally, further comprising:
    在本地存在第一目标音乐文件时,判断当前是否安装有第三方本地音乐应用;When the first target music file exists locally, determine whether a third-party local music application is currently installed;
    在当前未安装第三方本地音乐应用时,通过系统音乐应用播放本地的第一目标音乐文件;When a third-party local music application is not currently installed, the local first target music file is played through the system music application;
    在当前安装有第三方本地音乐应用时,通过第三方本地音乐应用播放本地的第一目标音乐文件。When a third-party local music application is currently installed, the first target music file locally is played through the third-party local music application.
  10. 一种音乐播放装置,其中,包括:A music playback device, including:
    指令识别模块,用于接收输入的语音信息,并判断所述语音信息是否为音乐播放指令;An instruction recognition module, configured to receive input voice information and determine whether the voice information is a music playback instruction;
    文件判断模块,用于在所述语音信息为音乐播放指令时,判断本地是否存在对应所述音乐播放指令的第一目标音乐文件;A file determining module, configured to determine whether a first target music file corresponding to the music playback instruction exists locally when the voice information is a music playback instruction;
    文件获取模块,用于在本地不存在所述第一目标音乐文件时,通过第三方音乐应用获取所述第一目标音乐文件;A file obtaining module, configured to obtain the first target music file through a third-party music application when the first target music file does not exist locally;
    文件播放模块,用于通过所述第三方音乐应用播放获取到的所述第一目标音乐文件。A file playback module, configured to play the acquired first target music file through the third-party music application.
  11. 一种存储介质,其上存储有计算机程序,其中,当所述计算机程序在计算机上运行时,使得所述计算机执行:A storage medium stores a computer program thereon, and when the computer program is run on a computer, the computer is caused to execute:
    接收输入的语音信息,并判断所述语音信息是否为音乐播放指令;Receiving the input voice information, and determining whether the voice information is a music playback instruction;
    在所述语音信息为音乐播放指令时,判断本地是否存在对应所述音乐播放指令的第一目标音乐文件;When the voice information is a music playback instruction, determining whether a first target music file corresponding to the music playback instruction exists locally;
    在本地不存在所述第一目标音乐文件时,通过第三方音乐应用获取所述第一目标音乐文件;When the first target music file does not exist locally, acquiring the first target music file through a third-party music application;
    通过所述第三方音乐应用播放获取到的所述第一目标音乐文件。Playing the acquired first target music file through the third-party music application.
  12. 一种电子设备,包括处理器和存储器,所述存储器储存有计算机程序,其中,所述处理器通过调用所述计算机程序,用于执行:An electronic device includes a processor and a memory. The memory stores a computer program. The processor calls the computer program to execute:
    接收输入的语音信息,并判断所述语音信息是否为音乐播放指令;Receiving the input voice information, and determining whether the voice information is a music playback instruction;
    在所述语音信息为音乐播放指令时,判断本地是否存在对应所述音乐播放指令的第一目标音乐文件;When the voice information is a music playback instruction, determining whether a first target music file corresponding to the music playback instruction exists locally;
    在本地不存在所述第一目标音乐文件时,通过第三方音乐应用获取所述第一目标音乐文件;When the first target music file does not exist locally, acquiring the first target music file through a third-party music application;
    通过所述第三方音乐应用播放获取到的所述第一目标音乐文件。Playing the acquired first target music file through the third-party music application.
  13. 如权利要求12所述的电子设备,其中,所述第三方音乐应用包括第三方网页音乐应用和第三方本地音乐应用,在通过第三方音乐应用获取所述第一目标音乐文件时,所述处理器用于执行:The electronic device according to claim 12, wherein the third-party music application includes a third-party web music application and a third-party local music application, and the processing is performed when the first target music file is obtained through the third-party music application. Is used to perform:
    判断当前是否安装有所述第三方本地音乐应用;Determine whether the third-party local music application is currently installed;
    在当前未安装所述第三方本地音乐应用时,通过所述第三方网页音乐应用获取所述第一目标音乐文件。When the third-party local music application is not currently installed, the first target music file is obtained through the third-party web music application.
  14. 如权利要求13所述的电子设备,所述判断当前是否安装有所述第三方本地音乐应用之后,所述处理器还用于执行:The electronic device according to claim 13, after the determining whether the third-party local music application is currently installed, the processor is further configured to execute:
    若当前未安装所述第三方本地音乐应用,则获取所述第三方本地音乐应用的应用安装包;If the third-party local music application is not currently installed, obtaining an application installation package of the third-party local music application;
    根据所述应用安装包安装所述第三方本地音乐应用。Install the third-party local music application according to the application installation package.
  15. 如权利要求14所述的电子设备,其中,在根据所述应用安装包安装所述第三方本地音乐应用之后,所述处理器还用于执行:The electronic device of claim 14, wherein after installing the third-party local music application according to the application installation package, the processor is further configured to execute:
    在通过所述第三方网页音乐应用播放所述第一目标音乐文件期间,接收新的音乐播放 指令;Receiving a new music playback instruction while playing the first target music file through the third-party web music application;
    确定对应所述新的音乐播放指令的第二目标音乐文件,并通过所述第三方本地音乐应用播放所述第二目标音乐文件。A second target music file corresponding to the new music playback instruction is determined, and the second target music file is played through the third-party local music application.
  16. 如权利要求12所述的电子设备,其中,在判断所述语音信息是否为音乐播放指令之前,所述处理器还用于执行:The electronic device according to claim 12, wherein before determining whether the voice information is a music playback instruction, the processor is further configured to execute:
    获取所述语音信息的声纹特征;Acquiring voiceprint characteristics of the voice information;
    判断所述声纹特征是否与预设声纹特征匹配;Determining whether the voiceprint feature matches a preset voiceprint feature;
    在所述声纹特征与预设声纹特征匹配时,判断所述语音信息是否为音乐播放指令。When the voiceprint feature matches a preset voiceprint feature, it is determined whether the voice information is a music playback instruction.
  17. 如权利要求16所述的电子设备,其中,在判断所述声纹特征是否与预设声纹特征匹配时,所述处理器用于执行:The electronic device of claim 16, wherein when determining whether the voiceprint feature matches a preset voiceprint feature, the processor is configured to perform:
    获取所述声纹特征和所述预设声纹特征的相似度;Obtaining a similarity between the voiceprint feature and the preset voiceprint feature;
    判断所述相似度是否大于或等于第一预设相似度;Determining whether the similarity is greater than or equal to a first preset similarity;
    在所述相似度大于或等于所述第一预设相似度时,确定所述声纹特征与所述预设声纹特征匹配。When the similarity is greater than or equal to the first preset similarity, it is determined that the voiceprint feature matches the preset voiceprint feature.
  18. 如权利要求17所述的电子设备,其中,在判断所述相似度是否大于或等于第一预设相似度之后,所述处理器还用于执行:The electronic device according to claim 17, wherein after determining whether the similarity is greater than or equal to a first preset similarity, the processor is further configured to execute:
    在所述相似度小于所述第一预设相似度且大于或等于第二预设相似度时,获取当前的位置信息;When the similarity is less than the first preset similarity and greater than or equal to the second preset similarity, obtaining current location information;
    根据所述位置信息判断当前是否位于预设位置范围内;Judging whether it is currently within a preset position range according to the position information;
    在当前位于预设位置范围内时,确定所述声纹特征与所述预设声纹特征匹配。When it is currently within the preset position range, it is determined that the voiceprint feature matches the preset voiceprint feature.
  19. 如权利要求16所述的电子设备,其中,在判断所述声纹特征是否与预设声纹特征匹配之后,所述处理器还用于执行:The electronic device according to claim 16, wherein after determining whether the voiceprint feature matches a preset voiceprint feature, the processor is further configured to execute:
    若所述声纹特征与所述预设声纹特征不匹配,则丢弃所述语音信息。If the voiceprint feature does not match the preset voiceprint feature, the voice information is discarded.
  20. 如权利要求12所述的电子设备,其中,在判断本地是否存在对应音乐播放指令的第一目标音乐文件之后,所述处理器还用于执行:The electronic device according to claim 12, wherein after determining whether a first target music file corresponding to a music playback instruction exists locally, the processor is further configured to execute:
    在本地存在第一目标音乐文件时,判断当前是否安装有第三方本地音乐应用;When the first target music file exists locally, determine whether a third-party local music application is currently installed;
    在当前未安装第三方本地音乐应用时,通过系统音乐应用播放本地的第一目标音乐文件;When a third-party local music application is not currently installed, the local first target music file is played through the system music application;
    在当前安装有第三方本地音乐应用时,通过第三方本地音乐应用播放本地的第一目标音乐文件。When a third-party local music application is currently installed, the first target music file locally is played through the third-party local music application.
PCT/CN2019/085549 2018-05-30 2019-05-05 Music playback method and apparatus, storage medium, and electronic device WO2019228138A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810541500.4A CN108804070B (en) 2018-05-30 2018-05-30 Music playing method and device, storage medium and electronic equipment
CN201810541500.4 2018-05-30

Publications (1)

Publication Number Publication Date
WO2019228138A1 true WO2019228138A1 (en) 2019-12-05

Family

ID=64089428

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/085549 WO2019228138A1 (en) 2018-05-30 2019-05-05 Music playback method and apparatus, storage medium, and electronic device

Country Status (2)

Country Link
CN (1) CN108804070B (en)
WO (1) WO2019228138A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108804070B (en) * 2018-05-30 2021-01-26 Oppo广东移动通信有限公司 Music playing method and device, storage medium and electronic equipment
CN110347865A (en) * 2019-07-11 2019-10-18 Oppo广东移动通信有限公司 Lyrics reminding method, device, storage medium and augmented reality equipment
CN110362204A (en) * 2019-07-11 2019-10-22 Oppo广东移动通信有限公司 Information cuing method, device, storage medium and augmented reality equipment
CN113517010A (en) * 2021-08-03 2021-10-19 广州酷狗计算机科技有限公司 Calling method and device of music playing function, electronic equipment and storage medium
CN113590079B (en) * 2021-08-05 2024-03-22 广州飞傲电子科技有限公司 Music playing control method, device and computer readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102394921A (en) * 2011-10-26 2012-03-28 深圳市赛格导航科技股份有限公司 Method and system used for providing music service
CN104144097A (en) * 2013-05-07 2014-11-12 百度在线网络技术(北京)有限公司 Voice message transmission system, sending end, receiving end and voice message transmission method
CN104601202A (en) * 2014-12-23 2015-05-06 惠州Tcl移动通信有限公司 Method and terminal for realizing file search based on Bluetooth technology as well as Bluetooth device
CN107134286A (en) * 2017-05-15 2017-09-05 深圳米唐科技有限公司 ANTENNAUDIO player method, music player and storage medium based on interactive voice
CN108804070A (en) * 2018-05-30 2018-11-13 Oppo广东移动通信有限公司 Method for playing music, device, storage medium and electronic equipment

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020002039A1 (en) * 1998-06-12 2002-01-03 Safi Qureshey Network-enabled audio device
CN103187076B (en) * 2011-12-28 2017-07-18 上海博泰悦臻电子设备制造有限公司 voice music control device
CN104133849B (en) * 2014-07-01 2018-02-02 北京奇虎科技有限公司 A kind of method and apparatus that sound control is carried out in browser
CN105516289A (en) * 2015-12-02 2016-04-20 广东小天才科技有限公司 Method and system for assisting voice interaction based on position and action
CN106205613B (en) * 2016-07-22 2019-09-06 广州市迈图信息科技有限公司 A kind of navigation audio recognition method and system
CN107609034A (en) * 2017-08-09 2018-01-19 深圳市汉普电子技术开发有限公司 A kind of audio frequency playing method of intelligent sound box, audio playing apparatus and storage medium
CN108062464A (en) * 2017-11-27 2018-05-22 北京传嘉科技有限公司 Terminal control method and system based on Application on Voiceprint Recognition

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102394921A (en) * 2011-10-26 2012-03-28 深圳市赛格导航科技股份有限公司 Method and system used for providing music service
CN104144097A (en) * 2013-05-07 2014-11-12 百度在线网络技术(北京)有限公司 Voice message transmission system, sending end, receiving end and voice message transmission method
CN104601202A (en) * 2014-12-23 2015-05-06 惠州Tcl移动通信有限公司 Method and terminal for realizing file search based on Bluetooth technology as well as Bluetooth device
CN107134286A (en) * 2017-05-15 2017-09-05 深圳米唐科技有限公司 ANTENNAUDIO player method, music player and storage medium based on interactive voice
CN108804070A (en) * 2018-05-30 2018-11-13 Oppo广东移动通信有限公司 Method for playing music, device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN108804070B (en) 2021-01-26
CN108804070A (en) 2018-11-13

Similar Documents

Publication Publication Date Title
WO2019228138A1 (en) Music playback method and apparatus, storage medium, and electronic device
US11600265B2 (en) Systems and methods for determining whether to trigger a voice capable device based on speaking cadence
US11887604B1 (en) Speech interface device with caching component
RU2710984C2 (en) Performing task without monitor in digital personal assistant
US10811005B2 (en) Adapting voice input processing based on voice input characteristics
TWI511125B (en) Voice control method, mobile terminal apparatus and voice controlsystem
WO2021004481A1 (en) Media files recommending method and device
WO2019157880A1 (en) Method and device for generating link for application page, storage medium, and electronic apparatus
WO2021135604A1 (en) Voice control method and apparatus, server, terminal device, and storage medium
CN107004411A (en) Voice Applications framework
CN108694947B (en) Voice control method, device, storage medium and electronic equipment
WO2018133307A1 (en) Method and terminal for implementing voice control
KR20200015267A (en) Electronic device for determining an electronic device to perform speech recognition and method for the same
WO2019242414A1 (en) Voice processing method and apparatus, storage medium, and electronic device
US10540973B2 (en) Electronic device for performing operation corresponding to voice input
US20180367669A1 (en) Input during conversational session
KR102464120B1 (en) Electronic apparatus for processing user utterance
JP2020038709A (en) Continuous conversation function with artificial intelligence device
US20240203416A1 (en) Combining Device or Assistant-Specific Hotwords in a Single Utterance
WO2020135773A1 (en) Data processing method, device, and computer-readable storage medium
CN109686372B (en) Resource playing control method and device
US10693944B1 (en) Media-player initialization optimization
WO2019228140A1 (en) Instruction execution method and apparatus, storage medium, and electronic device
WO2019242415A1 (en) Position prompt method, device, storage medium and electronic device
KR102584324B1 (en) Method for providing of voice recognition service and apparatus thereof

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: 19810124

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: 19810124

Country of ref document: EP

Kind code of ref document: A1