CN108804070B - Music playing method and device, storage medium and electronic equipment - Google Patents

Music playing method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN108804070B
CN108804070B CN201810541500.4A CN201810541500A CN108804070B CN 108804070 B CN108804070 B CN 108804070B CN 201810541500 A CN201810541500 A CN 201810541500A CN 108804070 B CN108804070 B CN 108804070B
Authority
CN
China
Prior art keywords
music
application
target
file
playing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201810541500.4A
Other languages
Chinese (zh)
Other versions
CN108804070A (en
Inventor
李冠
达剑
熊万江
李海泉
周伍润
董治
朱忠磊
高亮
刘嘉飞
文昭彦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201810541500.4A priority Critical patent/CN108804070B/en
Publication of CN108804070A publication Critical patent/CN108804070A/en
Priority to PCT/CN2019/085549 priority patent/WO2019228138A1/en
Application granted granted Critical
Publication of CN108804070B publication Critical patent/CN108804070B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

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

Abstract

The embodiment of the application discloses a music playing method, a music playing device, a storage medium and electronic equipment, wherein in the embodiment of the application, the electronic equipment can receive input voice information and judge whether the received voice information is a music playing instruction. And when the received voice information is a music playing instruction, judging whether a first target music file corresponding to the music playing instruction exists locally. And when the first target music file does not exist locally, acquiring the first target music file through the third-party music application. And playing the acquired first target music file through a third party music application. According to the scheme, the target music file needing to be played does not exist locally, namely when music playing cannot be performed through the system music application, the target music file can be played through the third-party music application, and the success rate of music playing of the electronic equipment can be improved.

Description

Music playing method and device, storage medium and electronic equipment
Technical Field
The present application relates to the field of electronic device technologies, and in particular, to a music playing method and apparatus, a storage medium, and an electronic device.
Background
Currently, electronic devices may perform certain operations by way of voice instructions. For example, when the user says "play music", the electronic device recognizes "play music" as a music playing instruction, and executes the music playing instruction to realize music playing. However, in the related art, when a user needs to play a certain specific music and says "play the specific music", the electronic device may search the specific music locally, and if the specific music is not found, the specific music cannot be played through the system music application, so that the play success rate is low.
Disclosure of Invention
The embodiment of the application provides a music playing method and device, a storage medium and electronic equipment, which can reduce the success rate of music playing of the electronic equipment.
In a first aspect, an embodiment of the present application provides a music playing method, including:
receiving input voice information and judging whether the voice information is a music playing instruction or not;
when the voice information is a music playing instruction, judging whether a first target music file corresponding to the music playing 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;
and 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 playing apparatus, including:
the instruction identification module is used for receiving input voice information and judging whether the voice information is a music playing instruction or not;
the file judgment module is used for judging whether a first target music file corresponding to the music playing instruction exists locally or not when the voice information is the music playing instruction;
the file acquisition module is used for acquiring the first target music file through a third-party music application when the first target music file does not exist locally;
and the file playing module is used for playing the acquired first target music file through the third-party music application.
In a third aspect, a storage medium is provided in this application, and a computer program is stored thereon, and when the computer program runs on a computer, the computer is caused to execute the music playing method provided in any embodiment of this application.
In a fourth aspect, an electronic device provided in an embodiment of the present application includes a processor and a memory, where the memory has a computer program, and the processor is configured to execute the music playing method provided in any embodiment of the present application by calling the computer program.
In the embodiment of the application, the electronic device can receive the input voice information and judge whether the received voice information is a music playing instruction. And when the received voice information is a music playing instruction, judging whether a first target music file corresponding to the music playing instruction exists locally. And when the first target music file does not exist locally, acquiring the first target music file through the third-party music application. And playing the acquired first target music file through a third party music application. According to the scheme, the target music file needing to be played does not exist locally, namely when music playing cannot be performed through the system music application, the target music file can be played through the third-party music application, and the success rate of music playing of the electronic equipment can be improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flow chart illustrating a music playing method according to an embodiment of the present application.
Fig. 2 is an operation diagram illustrating an operation of the electronic device determining whether the voice message is a music playing instruction in the embodiment of the present application.
Fig. 3 is an operation diagram of triggering installation of a third party local music application "XX music" in the embodiment of the application.
Fig. 4 is a schematic diagram of switching from the third-party webpage music application to the third-party local music application "XX music" for music playing 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 playing 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.
Detailed Description
Referring to the drawings, wherein like reference numbers refer to like elements, the principles of the present application are illustrated as being implemented in a suitable computing environment. The following description is based on illustrated embodiments of the application and should not be taken as limiting the application with respect to other embodiments that are not detailed herein.
In the description that follows, specific embodiments of the present application will be described with reference to steps and symbols executed by one or more computers, unless otherwise indicated. Accordingly, these steps and operations will be referred to, several times, as being performed by a computer, the computer performing operations involving a processing unit of the computer in electronic signals representing data in a structured form. This operation transforms the data or maintains it at locations in the computer's memory system, which may be reconfigured or otherwise altered in a manner well known to those skilled in the art. The data maintains a data structure that is a physical location of the memory that has particular characteristics defined by the data format. However, while the principles of the application have been described in language specific to above, it is not intended to be limited to the specific form set forth herein, and it will be recognized by those of ordinary skill in the art that various of the steps and operations described below may be implemented in hardware.
The term module, as used herein, may be considered a software object executing on the computing system. The various components, modules, engines, and services described herein may be viewed as objects implemented on the computing system. The apparatus and method described herein may be implemented in software, but may also be implemented in hardware, and are within the scope of the present application.
The terms "first", "second", and "third", etc. in this application are used to distinguish between different objects and not to describe a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or modules is not limited to only those steps or modules listed, but rather, some embodiments may include other steps or modules not listed or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
An execution main body of the music playing method may be the music playing device provided in the embodiment of the present application, or an electronic device integrated with the music playing device, where the music playing device may be implemented in a hardware or software manner. The electronic device may be a smart phone, a tablet computer, a palm computer, a notebook computer, or a desktop computer.
Referring to fig. 1, fig. 1 is a schematic flowchart illustrating a music playing method according to an embodiment of the present application. As shown in fig. 1, a flow of a music playing method provided in an embodiment of the present application may be as follows:
in step 101, the input voice message is received, and whether the received voice message is a music playing instruction is determined.
In the embodiment of the application, the electronic device can receive the input voice information through the audio acquisition device. The audio acquisition device may be a microphone built in the electronic device, or may be a microphone accessed from the outside of the electronic device, which is not specifically limited in the present application and can be selected by a person 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 equipment performs voice analysis on the received voice information to obtain a voice analysis result corresponding to the voice information, so as to judge whether the received voice information is a music playing instruction or not according to the voice analysis result. The voice information is analyzed, that is, the voice information is converted from "voice" to "text".
For example, a speech analysis engine is built in the electronic device, please refer to fig. 2, the user speaks the speech information of "i want to listen to XXX song", after receiving the speech information, the electronic device inputs the speech information into the speech analysis engine for analysis, obtains an analysis result "i want to listen to XXX song" corresponding to the speech information, and determines that "i want to listen to XXX song" is a music playing instruction.
For another example, a voice parsing engine is not built in the electronic device, the user speaks voice information of "i want to listen to XXX songs", the electronic device sends the voice information to a voice parsing server (the voice parsing server is a server providing a voice parsing service) after receiving the voice information, instructs the voice parsing server to perform voice parsing on the voice information, and returns a voice parsing result of the music information; and then, receiving a voice analysis result 'I want to listen to XXX songs' of the voice information returned by the voice analysis server, and determining that 'I want to listen to XXX songs' is a music playing instruction.
In step 102, when the received voice message is a music playing instruction, it is determined whether a first target music file corresponding to the music playing instruction exists locally.
In the embodiment of the application, when the received voice information is a music playing instruction, music identification information is extracted from the music playing instruction, whether a first target music file corresponding to the music playing instruction exists is searched locally according to the voice identification information, and when the first target music file is not searched locally, it is determined that the first target music file does not exist locally; or when the search time for locally searching the first target music file reaches a preset time and the first target music file is not searched, determining that the first target music file does not exist locally, where the preset time may be a proper value according to actual needs, for example, the preset time may be configured to be 500 milliseconds, 1 second, and the like.
In step 103, when the first target music file does not exist locally, the first target music file is acquired through the third party music application.
In step 104, the acquired first target music file is played through the third-party music application.
In the embodiment of the application, when the judgment on whether the first target music file exists locally is completed and the first target music file does not exist locally, the electronic device acquires the first target music file through a third party music application. The third-party music application is a music application provided by a manufacturer other than the manufacturer of the electronic device (for example, QQ music, a music application provided by the manufacturer of the electronic device, and is usually integrated in an operating system of the electronic device when the electronic device is shipped, and is called a system music application.
When a first target music file is acquired through a third-party music application, on one hand, the electronic equipment firstly constructs a music acquisition request through the running third-party music application according to a preset message format, wherein the music acquisition request at least comprises music identification information of the first target music file (namely music identification information extracted from a music playing instruction); then, sending the constructed music acquisition request to a music server (the music server is a server providing services for the third-party music application) through the third-party music application, indicating the music server to find and return the first target music file, and correspondingly receiving the first target music file returned by the music server; on the other hand, after receiving a music acquisition request sent by the electronic device through a third-party music application, the music server searches for a music file corresponding to the music identification information in the music acquisition request according to the association relationship between the music identification information and the music file maintained by the electronic device according to the indication of the music acquisition request, and returns the music file serving as the first target music file to the electronic device.
After receiving the first target music file returned by the music server, the electronic device can play the acquired first target music file through the third-party music application.
As can be seen from the above, in the embodiment of the application, the electronic device may receive the input voice information and determine whether the received voice information is a music playing instruction. And when the received voice information is a music playing instruction, judging whether a first target music file corresponding to the music playing instruction exists locally. And when the first target music file does not exist locally, acquiring the first target music file through the third-party music application. And playing the acquired first target music file through a third party music application. According to the scheme, the target music file needing to be played does not exist locally, namely when music playing cannot be performed through the system music application, the target music file can be played through the third-party music application, and the success rate of music playing of the electronic equipment can be improved.
In an embodiment, the third-party music application includes a third-party webpage music application and a third-party local music application, and the obtaining of the first target music file by the third-party music application includes:
judging whether a third-party local music application is installed at present;
and when the third-party local music application is not installed at present, acquiring a first target music file through the third-party webpage music application.
It should be noted that the local application is application software that can be used only by installing the installation package locally on the electronic device, and needs to occupy a certain storage resource of the electronic device. The web application is application software that operates on the internet or an intranet using a web browser, and is an application program written in a web language (e.g., programming languages such as HTML, JavaScript, Java, etc.), and needs to be executed through the browser, for example, can be accessed uniformly through an open platform. It should be explained that the installation package of the existing web application and the cache data generated during the operation are both stored in the server of the open platform, and it is not required to install and operate in the electronic device, so as to save the storage resource of the electronic device as much as possible, and the electronic device can perform data communication with the factory server of the web application through the application interface in the open platform, so as to realize the 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 one application interface.
In the embodiment of the application, when the electronic device obtains the first target music file through the third-party music application, it is first determined whether the third-party local music application is currently installed, and if it is determined that the third-party local music application is not currently installed, the third-party webpage music application is run based on the webpage browser, and the first target music file is obtained through the third-party webpage music application.
When the first target music file is acquired through the third-party webpage music application, on one hand, the electronic equipment firstly constructs a music acquisition request through the running third-party webpage music application according to a preset message format, wherein the music acquisition request at least comprises music identification information of the first target music file (namely music identification information extracted from a music playing instruction); then, sending the constructed music acquisition request to a music server (the music server is a server providing services for the third-party webpage music application) through the third-party webpage music application, indicating the music server to find and return the first target music file, and correspondingly receiving the first target music file returned by the music server; on the other hand, after receiving a music acquisition request sent by the electronic device through a third-party webpage music application, the music server searches a music file corresponding to the music identification information in the music acquisition request according to the association relationship between the music identification information and the music file maintained by the electronic device according to the indication of the music acquisition request, and returns the music file serving as the first target music file to the electronic device.
After receiving the first target music file returned by the music server, the electronic device can play the acquired first target music file through the third-party webpage music application.
In an embodiment, when the third-party local music application is not installed currently, the following steps are further performed:
acquiring an application installation package of a third-party local music application;
and installing the third-party local music application according to the obtained application installation package.
The electronic device may obtain the application installation package of the third-party local music application from the music server, or may obtain the music installation package of the third-party local music application from an application platform (such as an application store).
For example, referring to fig. 3, the electronic device runs a third-party webpage music application through an XX browser and plays a first target music file "XX song" through the third-party webpage music application, and during the playing, the electronic device displays a confirmation interface including prompt information "whether XX music is installed" prompting a user whether a third-party local music application named "XX music" is installed, the confirmation interface including a "yes" control for inputting confirmation information and a "no" control for inputting denial information. When the confirmation information input based on the 'yes' control is received, the electronic equipment acquires the application installation package of the 'XX music' local music application of the third party from the music server corresponding to the music application of the third party webpage. After the application installation package of the third-party local music application "XX music" is acquired, the third-party local music application "XX music" is installed 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 playing instruction during the playing of the first target music file through the third-party webpage music application;
and determining a second target music file corresponding to the new music playing instruction, and playing the second target music file through a third-party local music application.
In the embodiment of the application, after the third-party local music application is installed, the newly received music playing instruction can be responded through the installed third-party local music application.
And receiving a new music playing instruction input in a voice mode during the playing of the first target music file through the third-party webpage music application. And when a new voice playing instruction is received, determining a second target music file corresponding to the new music playing instruction. After the second target music file is determined, if the second target music file exists locally, the third-party webpage music application is controlled to stop playing the first target music file, a webpage browser running the third-party webpage music application is switched to a background, meanwhile, the third-party local music application is started, and the local second target music file is played through the third-party local music; and if the second target music file does not exist locally, after the third-party local music application is started in the same manner, the second target music file is acquired through the third-party local music application and is played.
For example, referring to fig. 4, the electronic device plays the XX song through the "web version" XX music run by the XX browser, installs the "local version" XX music during the playing process, and when receiving a new music playing instruction "play YY song", the electronic device starts the "local version" XX music and plays the YY song corresponding to the new music playing instruction.
In an embodiment, after determining whether the first target music file corresponding to the music playing instruction exists locally, the method further includes:
when a first target music file exists locally, judging whether a third-party local music application is installed currently;
when the third-party local music application is not installed at present, playing a local first target music file through the system music application;
and when the third-party local music application is installed at present, playing a local first target music file through the third-party local music application.
In an embodiment, before determining whether the received voice message is a music playing instruction, the method further includes:
acquiring voiceprint characteristics of the received voice information;
judging whether the acquired voiceprint features are matched with preset voiceprint features or not;
and when the acquired voiceprint characteristics are matched with the preset voiceprint characteristics, judging whether the received voice information is a music playing instruction.
In actual life, each person speaking has own characteristics, and familiar persons can only listen to the voice and distinguish the voice from each other.
The characteristics of the sound are the vocal print characteristics, which are mainly determined by two factors, the first is the size of the vocal cavity, specifically including throat, nasal cavity, oral cavity, etc., and the shape, size and position of these organs determine the magnitude of vocal cord tension and the range of vocal frequency. Therefore, different people speak the same, but the frequency distribution of the sound is different, and the sound sounds with heavy and loud sound.
The second factor that determines the characteristics of the voiceprint is the manner in which the vocal organs, including lip, tooth, tongue, soft palate and palatal muscles, are manipulated, and their interaction produces clear speech. And the cooperation mode among the people is randomly learned by the communication between the acquired people and the surrounding people. In the process of learning speaking, a person can gradually form the vocal print characteristics of the person by simulating the speaking modes of different people around the person.
In the embodiment of the application, when receiving the input voice information, the electronic device first obtains the voiceprint feature of the voice information.
After obtaining the voiceprint feature of the voice information, the electronic device further compares the obtained voiceprint feature with a preset voiceprint feature to judge whether the voiceprint feature is matched with the preset voiceprint feature. The preset voiceprint feature can be a voiceprint feature which is pre-recorded by the owner, and whether the voiceprint feature of the input voice information is matched with the preset voiceprint feature or not is judged, namely whether the user currently inputting the voice information is the owner or not is judged.
When the obtained voiceprint feature matches the preset voiceprint feature, the electronic device determines that the user currently inputting the voice information is the owner, determines whether the received voice information is a music playing instruction at this time, and responds to the music playing instruction when the voice information is the music playing instruction.
When determining whether the obtained voiceprint feature matches the preset voiceprint feature, the electronic device may obtain a similarity between the voiceprint feature (obtained from the received voice information) and the preset voiceprint feature, and determine whether the obtained similarity is greater than or equal to a first preset similarity (set according to actual needs, for example, may be set to 95%). When the acquired similarity is greater than or equal to a first preset similarity, determining that the acquired voiceprint features are matched with preset voiceprint features; and when the acquired similarity is smaller than or equal to the similarity, determining that the acquired voiceprint features are not matched with the preset voiceprint features.
In addition, when the obtained voiceprint feature is not matched with 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 the voice information of the owner is received, determines whether the received voice information is a music playing instruction, and responds to the music playing instruction when the voice information is the music playing instruction.
According to the method and the device, before responding to the input voice information, the identity of the user is firstly identified according to the voiceprint characteristics of the voice information, and the user who inputs the voice information responds to the input voice information only when the user is the owner of the user. Therefore, the electronic equipment can be prevented from executing operations which are not intended by the owner, and the use experience of the owner is improved.
In an embodiment, after determining whether the obtained similarity is greater than or equal to a first preset similarity, the method further includes:
when the obtained similarity is smaller than a first preset similarity and larger than or equal to a second preset similarity, obtaining current position information;
judging whether the current position is within a preset position range or not according to the position information;
and when the current position is within the preset position range, determining that the acquired voiceprint features are matched with the preset voiceprint features.
It should be noted that, because the voiceprint characteristics and the physiological characteristics of the human body are closely related, in daily life, if a user catches a cold and is inflamed, the voice of the user becomes dull, and the voiceprint characteristics are changed 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 various situations that cause the electronic device to be unable to identify the owner, and the details are not described here.
In order to solve the possible situation that the owner cannot be identified, in this embodiment of the application, after the electronic device completes the judgment of the voiceprint feature similarity, if the similarity between the voiceprint feature of the received voice message and the preset voiceprint feature is smaller than the first preset similarity, it is further judged whether the voiceprint feature is greater than or equal to a second preset similarity (the second preset similarity is configured to be smaller than the first preset similarity, specifically, a suitable value may be obtained by a person skilled in the art according to actual needs, for example, when the first preset similarity is set to 95%, the second preset similarity may be set to 75%).
And when the judgment result is yes, namely the similarity between the voiceprint feature of the acquired voice information and the preset voiceprint feature is smaller than the first preset similarity and larger than or equal to the second preset similarity, the electronic equipment further acquires the current position information. The electronic device may acquire the current location information by using different positioning technologies such as a satellite positioning technology or a base station positioning technology.
After the current position information is acquired, the electronic equipment judges whether the current position is within a preset position range according to the position information. The preset location range may be configured as a common location range of the owner, such as home and company.
When the current user is located within the preset position range, the electronic equipment determines that the voiceprint features are matched with the preset voiceprint features, and identifies the current user who inputs the voice information as the owner.
The music playing method of the present application will be further described below on the basis of the methods described in the above embodiments. Referring to fig. 5, the music playing method may include:
in step 201, the input voice information is received, and the voiceprint feature of the received voice information is obtained.
In actual life, each person speaking has own characteristics, and familiar persons can only listen to the voice and distinguish the voice from each other.
The characteristics of the sound are the vocal print characteristics, which are mainly determined by two factors, the first is the size of the vocal cavity, specifically including throat, nasal cavity, oral cavity, etc., and the shape, size and position of these organs determine the magnitude of vocal cord tension and the range of vocal frequency. Therefore, different people speak the same, but the frequency distribution of the sound is different, and the sound sounds with heavy and loud sound.
The second factor that determines the characteristics of the voiceprint is the manner in which the vocal organs, including lip, tooth, tongue, soft palate and palatal muscles, are manipulated, and their interaction produces clear speech. And the cooperation mode among the people is randomly learned by the communication between the acquired people and the surrounding people. In the process of learning speaking, a person can gradually form the vocal print characteristics of the person by simulating the speaking modes of different people around the person.
In the embodiment of the application, the electronic device can receive the input voice information through the audio acquisition device. The audio acquisition device may be a microphone built in the electronic device, or may be a microphone accessed from the outside of the electronic device, which is not specifically limited in the present application and can be selected by a person 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 equipment first acquires the voiceprint characteristics of the voice information.
In step 202, it is determined whether the obtained voiceprint feature matches a preset voiceprint feature.
After obtaining the voiceprint feature of the voice information, the electronic device further compares the obtained voiceprint feature with a preset voiceprint feature to judge whether the voiceprint feature is matched with the preset voiceprint feature. The preset voiceprint feature can be a voiceprint feature which is pre-recorded by the owner, and whether the voiceprint feature of the input voice information is matched with the preset voiceprint feature or not is judged, namely whether the user currently inputting the voice information is the owner or not is judged.
In step 203, when the obtained voiceprint feature matches the preset voiceprint feature, it is determined whether the received voice message is a music playing instruction.
When the obtained voiceprint feature is matched with the preset voiceprint feature, the electronic equipment determines that the user inputting the voice information at present is the owner, and at the moment, whether the received voice information is a music playing instruction is judged.
When judging whether the received voice information is a music playing instruction or not, the electronic equipment carries out voice analysis on the received voice information to obtain a voice analysis result corresponding to the voice information, and judges whether the received voice information is the music playing instruction or not according to the voice analysis result. The voice information is analyzed, that is, the voice information is converted from "voice" to "text".
For example, a speech analysis engine is built in the electronic device, please refer to fig. 2, the user speaks the speech information of "i want to listen to XXX song", after receiving the speech information, the electronic device inputs the speech information into the speech analysis engine for analysis, obtains an analysis result "i want to listen to XXX song" corresponding to the speech information, and determines that "i want to listen to XXX song" is a music playing instruction.
For another example, a voice parsing engine is not built in the electronic device, the user speaks voice information of "i want to listen to XXX songs", the electronic device sends the voice information to a voice parsing server (the voice parsing server is a server providing a voice parsing service) after receiving the voice information, instructs the voice parsing server to perform voice parsing on the voice information, and returns a voice parsing result of the music information; and then, receiving a voice analysis result 'I want to listen to XXX songs' of the voice information returned by the voice analysis server, and determining that 'I want to listen to XXX songs' is a music playing instruction.
In step 204, when the received voice message is a music playing instruction, it is determined whether a first target music file corresponding to the music playing instruction exists locally.
In the embodiment of the application, when the received voice information is a music playing instruction, music identification information is extracted from the music playing instruction, whether a first target music file corresponding to the music playing instruction exists is searched locally according to the voice identification information, and when the first target music file is not searched locally, it is determined that the first target music file does not exist locally; or when the search time for locally searching the first target music file reaches a preset time and the first target music file is not searched, determining that the first target music file does not exist locally, where the preset time may be a proper value according to actual needs, for example, the preset time may be configured to be 500 milliseconds, 1 second, and the like.
In step 205, when the first target music file does not exist locally, the first target music file is acquired by the third party music application.
In step 206, the acquired first target music file is played through the third-party music application.
In the embodiment of the application, when the judgment on whether the first target music file exists locally is completed and the first target music file does not exist locally, the electronic device acquires the first target music file through a third party music application. The third-party music application is a music application provided by a manufacturer other than the manufacturer of the electronic device (for example, QQ music, a music application provided by the manufacturer of the electronic device, and is usually integrated in an operating system of the electronic device when the electronic device is shipped, and is called a system music application.
When a first target music file is acquired through a third-party music application, on one hand, the electronic equipment firstly constructs a music acquisition request through the running third-party music application according to a preset message format, wherein the music acquisition request at least comprises music identification information of the first target music file (namely music identification information extracted from a music playing instruction); then, sending the constructed music acquisition request to a music server (the music server is a server providing services for the third-party music application) through the third-party music application, indicating the music server to find and return the first target music file, and correspondingly receiving the first target music file returned by the music server; on the other hand, after receiving a music acquisition request sent by the electronic device through a third-party music application, the music server searches for a music file corresponding to the music identification information in the music acquisition request according to the association relationship between the music identification information and the music file maintained by the electronic device according to the indication of the music acquisition request, and returns the music file serving as the first target music file to the electronic device.
After receiving the first target music file returned by the music server, the electronic device can play the acquired first target music file through the third-party music application.
In one embodiment, a music playing device is also provided. Referring to fig. 6, fig. 6 is a schematic structural diagram of a music playing device 400 according to an embodiment of the present application. The music playing device is applied to an electronic device, and includes an instruction identifying module 401, a file determining module 402, a file obtaining module 403, and a file playing module 404, as follows:
the instruction recognition module 401 is configured to receive the input voice information and determine whether the received voice information is a music playing instruction.
The file determining module 402 is configured to determine whether a first target music file corresponding to the music playing instruction exists locally when the received voice information is the music playing instruction.
The file obtaining module 403 is configured to obtain the first target music file through the third party music application when the first target music file does not exist locally.
And a file playing module 404, configured to play the acquired first target music file through a third-party music application.
In an embodiment, the third-party music application includes a third-party webpage music application and a third-party local music application, and the file obtaining module 403 is further configured to:
judging whether a third-party local music application is installed at present;
and when the third-party local music application is not installed at present, acquiring a first target music file through the third-party webpage music application.
In an embodiment, the music playing apparatus further includes an application installation module, which is operable to:
when the third-party local music application is not installed at present, acquiring an application installation package of the third-party local music application;
and installing the third-party local music application according to the obtained application installation package.
In an embodiment, the instruction identifying module 401 may further be configured to:
receiving a new music playing instruction during the playing of the first target music file through the third-party webpage music application;
a file play module 404, which may be configured to:
and determining a second target music file corresponding to the new music playing instruction, and playing the second target music file through a third-party local music application.
In an embodiment, the file playing module 404 may further be configured to:
when a first target music file exists locally, judging whether a third-party local music application is installed currently;
when the third-party local music application is not installed at present, playing a local first target music file through the system music application;
and when the third-party local music application is installed at present, playing a local first target music file through the third-party local music application.
In an embodiment, the instruction identifying module 401 may further be configured to:
acquiring voiceprint characteristics of the received voice information;
judging whether the acquired voiceprint features are matched with preset voiceprint features or not;
and when the acquired voiceprint characteristics are matched with the preset voiceprint characteristics, judging whether the received voice information is a music playing instruction.
In an embodiment, the instruction identifying module 401 may further be configured to:
acquiring the similarity of the voiceprint characteristics and preset voiceprint characteristics;
judging whether the acquired similarity is greater than or equal to a first preset similarity or not;
and when the acquired similarity is greater than or equal to a first preset similarity, determining that the voiceprint features are matched with the preset voiceprint features.
In an embodiment, the instruction identifying module 401 may further be configured to:
when the obtained similarity is smaller than a first preset similarity and larger than or equal to a second preset similarity, obtaining current position information;
judging whether the current position is within a preset position range or not according to the position information;
and when the current position is within the preset position range, determining that the acquired voiceprint features are matched with the preset voiceprint features.
The steps performed by the modules in the music playing apparatus 400 may refer to the method steps described in the above method embodiments. The music playing apparatus 400 may be integrated into an electronic device, such as a mobile phone, a tablet computer, etc.
In specific implementation, the modules may be implemented as independent entities, or may be combined arbitrarily to be implemented as the same or several entities, and specific implementation of the units may refer to the foregoing embodiments, which are not described herein again.
As can be seen from the above, the music playing apparatus of this embodiment can receive the input voice information by the instruction recognition module 401, and determine whether the received voice information is a music playing instruction. When the received voice message is a music playing instruction, the file determining module 402 determines whether a first target music file corresponding to the music playing instruction exists locally. When the first target music file does not exist locally, the file obtaining module 403 obtains the first target music file through the third-party music application. The file playing module 404 plays the acquired first target music file through a third-party music application. According to the scheme, the target music file needing to be played does not exist locally, namely when music playing cannot be performed through the system music application, the target music file can be played through the third-party music application, and the success rate of music playing of the electronic equipment can be improved.
In an embodiment, an electronic device is also provided. Referring to fig. 7, an 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, connects various parts of the entire electronic device using various interfaces and lines, performs various functions of the electronic device 500 and processes data by running or loading a computer program stored in the memory 502 and calling data stored in the memory 502.
The memory 502 may be used to store software programs and modules, and the processor 501 executes various functional applications and data processing by running the computer programs and modules stored in the memory 502. The memory 502 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, a computer program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to use of the electronic device, and the like. Further, the memory 502 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 502 may also include a memory controller to provide the processor 501 with access to the memory 502.
In this embodiment, the processor 501 in the electronic device 500 loads instructions corresponding to one or more processes of the computer program into the memory 502, and the processor 501 runs the computer program stored in the memory 502, so as to implement various functions as follows:
receiving input voice information and judging whether the received voice information is a music playing instruction or not;
when the received voice information is a music playing instruction, judging whether a first target music file corresponding to the music playing 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;
and playing the acquired first target music file through a third party music application.
Referring to fig. 8, in some embodiments, the electronic device 500 may further include: a display 503, radio frequency circuitry 504, audio circuitry 505, and a power supply 506. The display 503, the rf circuit 504, the audio circuit 505, and the power source 506 are electrically connected to the processor 501.
The display 503 may be used to display information entered by or provided to the user as well as various graphical user interfaces, which may be made up of graphics, text, icons, video, and any combination thereof. The Display 503 may include a Display panel, and in some embodiments, the Display panel may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The rf circuit 504 may be used for transceiving rf signals to establish wireless communication with a network device or other electronic devices through wireless communication, and for transceiving signals with the network device or other electronic devices.
The audio circuit 505 may be used to provide an audio interface between the user and the electronic device through a speaker, microphone.
The power supply 506 may be used to power various components of the electronic device 500. In some embodiments, power supply 506 may be logically coupled to processor 501 through a power management system, such that functions of managing charging, discharging, and power consumption are performed through the power management system.
Although not shown in fig. 8, the electronic device 500 may further include a camera, a bluetooth module, and the like, which are not described in detail herein.
In some embodiments, the third-party music application includes a third-party webpage music application and a third-party local music application, and when the first target music file is obtained by the third-party music application, the processor 501 may perform the following steps:
judging whether a third-party local music application is installed at present;
and when the third-party local music application is not installed at present, acquiring a first target music file through the third-party webpage music application.
In some embodiments, when the third party local music application is not currently installed, the processor 501 may perform the following steps:
acquiring an application installation package of a third-party local music application;
and installing the third-party local music application according to the obtained application installation package.
In some embodiments, after installing the third-party local music application according to the obtained application installation package, the processor 501 may perform the following steps:
receiving a new music playing instruction during the playing of the first target music file through the third-party webpage music application;
and determining a second target music file corresponding to the new music playing instruction, and playing the second target music file through a third-party local music application.
In some embodiments, after determining whether the first target music file corresponding to the music playing instruction exists locally, the processor 501 may perform the following steps:
when a first target music file exists locally, judging whether a third-party local music application is installed currently;
when the third-party local music application is not installed at present, playing a local first target music file through the system music application;
and when the third-party local music application is installed at present, playing a local first target music file through the third-party local music application.
In some embodiments, before determining whether the received voice message is a music playing instruction, the processor 501 may further perform the following steps:
acquiring voiceprint characteristics of the received voice information;
judging whether the acquired voiceprint features are matched with preset voiceprint features or not;
and when the acquired voiceprint characteristics are matched with the preset voiceprint characteristics, judging whether the received voice information is a music playing instruction.
In some embodiments, when determining whether the obtained voiceprint feature matches a preset voiceprint feature, the processor 501 may further perform the following steps:
acquiring the similarity of the voiceprint characteristics and preset voiceprint characteristics;
judging whether the acquired similarity is greater than or equal to a first preset similarity or not;
and when the acquired similarity is greater than or equal to a first preset similarity, determining that the voiceprint features are matched with the preset voiceprint features.
In some embodiments, after determining whether the obtained similarity is greater than or equal to a first preset similarity, the processor 501 may further perform the following steps:
when the obtained similarity is smaller than a first preset similarity and larger than or equal to a second preset similarity, obtaining current position information;
judging whether the current position is within a preset position range or not according to the position information;
and when the current position is within the preset position range, determining that the acquired voiceprint features are matched with the preset voiceprint features.
An embodiment of the present application further provides a storage medium, where the storage medium stores a computer program, and when the computer program runs on a computer, the computer is caused to execute the music playing method in any one of the above embodiments, such as: receiving input voice information and judging whether the received voice information is a music playing instruction or not; when the received voice information is a music playing instruction, judging whether a first target music file corresponding to the music playing 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; and playing the acquired first target music file through a third party music application.
In the embodiment of the present application, the storage medium may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
It should be noted that, for the music playing method in the embodiment of the present application, it can be understood by a person skilled in the art that all or part of the process of implementing the music playing method in the embodiment of the present application can be completed by controlling the relevant hardware through a computer program, where the computer program can be stored in a computer readable storage medium, such as a memory of an electronic device, and executed by at least one processor in the electronic device, and during the execution process, the process of the embodiment of the music playing method can be included. The storage medium may be a magnetic disk, an optical disk, a read-only memory, a random access memory, etc.
In the music playing device according to the embodiment of the present application, each functional module may be integrated into one processing chip, or each module may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium, such as a read-only memory, a magnetic or optical disk, or the like.
The above detailed description is provided for a music playing method, device, storage medium and electronic device provided in the embodiments of the present application, and a specific example is applied in the present application to explain the principle and the implementation of the present application, and the description of the above embodiments is only used to help understanding the method and the core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (4)

1. A music playing method, comprising:
receiving input voice information and acquiring voiceprint characteristics of the voice information;
acquiring the similarity of the voiceprint features and preset voiceprint features;
judging whether the similarity is greater than or equal to a first preset similarity or not;
when the similarity is greater than or equal to the first preset similarity, determining that the voiceprint features are matched with the preset voiceprint features; or when the similarity is smaller than the first preset similarity and larger than or equal to a second preset similarity, acquiring current position information, judging whether the current position information is within a preset position range or not according to the position information, and when the current position information is within the preset position range, determining that the voiceprint features are matched with the preset voiceprint features;
when the voiceprint features are matched with preset voiceprint features, judging whether the voice information is a music playing instruction or not;
when the voice information is a music playing instruction, judging whether a first target music file corresponding to the music playing instruction exists locally;
when the first target music file exists locally, judging whether a third-party local music application is installed currently, and if not, playing the first target music file through a system music application;
when the first target music file does not exist locally, judging whether the third-party local music application is installed currently or not, if not, constructing a music acquisition request through the running third-party webpage music application according to a preset message format, wherein the music acquisition request is used for indicating a music server to search a music file corresponding to the music identification information in the music acquisition request, and returning the corresponding music file as the first target music file;
receiving the first target music file returned by the music server, and playing the acquired first target music file through the third-party webpage music application;
installing the third-party local music application and receiving a new music playing instruction during the playing of the first target music file through the third-party webpage music application;
determining a second target music file corresponding to the new music playing instruction;
judging whether the second target music file exists locally or not;
if the second target music file exists locally, controlling the third-party webpage music application to stop playing the first target music file, starting the third-party local music application, and playing the second target music file through the third-party local music application;
and if the second target music file does not exist locally, controlling the third-party webpage music application to stop playing the first target music file, starting the third-party local music application, and acquiring and playing the second target music file through the third-party local music application.
2. A music playing apparatus, comprising:
the command recognition module is used for receiving input voice information, acquiring voiceprint characteristics of the voice information, acquiring the similarity between the voiceprint characteristics and preset voiceprint characteristics, judging whether the similarity is greater than or equal to first preset similarity or not, determining that the voiceprint feature matches the preset voiceprint feature when the similarity is greater than or equal to the first preset similarity, or when the similarity is less than the first preset similarity and greater than or equal to a second preset similarity, acquiring current position information, judging whether the current position is within a preset position range according to the position information, determining that the voiceprint feature matches the preset voiceprint feature when the current location is within a preset location range, when the voiceprint features are matched with preset voiceprint features, judging whether the voice information is a music playing instruction or not;
the file judgment module is used for judging whether a first target music file corresponding to the music playing instruction exists locally or not when the voice information is the music playing instruction;
the file acquisition module is used for judging whether a third-party local music application is installed currently or not when the first target music file does not exist locally, if not, constructing a music acquisition request through the running third-party webpage music application according to a preset message format, wherein the music acquisition request is used for indicating a music server to search a music file corresponding to the music identification information in the music acquisition request, returning the corresponding music file as the first target music file, and receiving the first target music file returned by the music server;
a file playing module, configured to determine whether the third-party local music application is currently installed when the first target music file exists locally, if not, play the first target music file through a system music application, if the first target music file does not exist locally, play the acquired first target music file through the third-party web music application, during playing the first target music file through the third-party web music application, install the third-party local music application and receive a new music playing instruction, determine a second target music file corresponding to the new music playing instruction, determine whether the second target music file exists locally, and if the second target music file exists locally, control the third-party web music application to stop playing the first target music file, and starting the third-party local music application, playing the second target music file through the third-party local music application, controlling the third-party webpage music application to stop playing the first target music file if the second target music file does not exist locally, starting the third-party local music application, and acquiring and playing the second target music file through the third-party local music application.
3. A storage medium having stored thereon a computer program, characterized in that, when the computer program runs on a computer, it causes the computer to execute the music playing method according to claim 1.
4. An electronic device comprising a processor and a memory, the memory storing a computer program, wherein the processor is configured to execute the music playing method of claim 1 by calling the computer program.
CN201810541500.4A 2018-05-30 2018-05-30 Music playing method and device, storage medium and electronic equipment Expired - Fee Related CN108804070B (en)

Priority Applications (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
PCT/CN2019/085549 WO2019228138A1 (en) 2018-05-30 2019-05-05 Music playback method and apparatus, storage medium, and electronic device

Applications Claiming Priority (1)

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

Publications (2)

Publication Number Publication Date
CN108804070A CN108804070A (en) 2018-11-13
CN108804070B true CN108804070B (en) 2021-01-26

Family

ID=64089428

Family Applications (1)

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

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
CN110362204A (en) * 2019-07-11 2019-10-22 Oppo广东移动通信有限公司 Information cuing method, device, storage medium and augmented reality equipment
CN110347865A (en) * 2019-07-11 2019-10-18 Oppo广东移动通信有限公司 Lyrics reminding 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

Family Cites Families (12)

* 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
CN102394921A (en) * 2011-10-26 2012-03-28 深圳市赛格导航科技股份有限公司 Method and system used for providing music service
CN103187076B (en) * 2011-12-28 2017-07-18 上海博泰悦臻电子设备制造有限公司 voice music control device
CN104144097B (en) * 2013-05-07 2018-09-07 北京音之邦文化科技有限公司 Voice message transmission system, sending end, receiving end and voice message transmission method
CN104133849B (en) * 2014-07-01 2018-02-02 北京奇虎科技有限公司 A kind of method and apparatus that sound control is carried out in browser
CN104601202B (en) * 2014-12-23 2019-04-23 惠州Tcl移动通信有限公司 Method, terminal and the bluetooth equipment of file search are realized based on Bluetooth technology
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
CN107134286A (en) * 2017-05-15 2017-09-05 深圳米唐科技有限公司 ANTENNAUDIO player method, music player and storage medium based on interactive voice
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
CN108804070B (en) * 2018-05-30 2021-01-26 Oppo广东移动通信有限公司 Music playing method and device, storage medium and electronic equipment

Also Published As

Publication number Publication date
WO2019228138A1 (en) 2019-12-05
CN108804070A (en) 2018-11-13

Similar Documents

Publication Publication Date Title
CN108804070B (en) Music playing method and device, storage medium and electronic equipment
US11670302B2 (en) Voice processing method and electronic device supporting the same
CN108829235B (en) Voice data processing method and electronic device supporting the same
JP2023115067A (en) Voice user interface shortcuts for assistant application
CN106297802B (en) Method and apparatus for executing voice command in electronic device
CN108694947B (en) Voice control method, device, storage medium and electronic equipment
CN101366075B (en) The control center of voice controlled wireless communication device system
KR20190042918A (en) Electronic device and operating method thereof
US10811005B2 (en) Adapting voice input processing based on voice input characteristics
KR20190042903A (en) Electronic device and method for controlling voice signal
WO2021004481A1 (en) Media files recommending method and device
CN108962241B (en) Position prompting method and device, storage medium and electronic equipment
JP2008096541A (en) Speech processing device and control method therefor
KR20200015267A (en) Electronic device for determining an electronic device to perform speech recognition and method for the same
CN112735418B (en) Voice interaction processing method, device, terminal and storage medium
CN111640434A (en) Method and apparatus for controlling voice device
KR20190122457A (en) Electronic device for performing speech recognition and the method for the same
KR20190068133A (en) Electronic device and method for speech recognition
KR20190001435A (en) Electronic device for performing operation corresponding to voice input
JP2020038709A (en) Continuous conversation function with artificial intelligence device
KR20220143683A (en) Electronic Personal Assistant Coordination
KR20210116897A (en) Method for contolling external device based on voice and electronic device thereof
KR20210001082A (en) Electornic device for processing user utterance and method for operating thereof
KR20210044509A (en) An electronic device supporting improved speech recognition
CN108711428B (en) Instruction execution method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20210126