Summary of the invention
Embodiments provide a kind of method and system by usb audio channel transmission data, be intended to solve prior art when having multiple USB to need to transmit data in a large number simultaneously, operating system execution efficiency is then on the low side, and application software cannot read data in time, the problem that execution efficiency is low.
On the one hand, provide a kind of method by usb audio channel transmission data, described method comprises:
Non-speech data is sent to speech control interface and described non-speech data is converted into interaction data, described interaction data comprises packet, VoP;
Alternately described interaction data is transferred to the voice flow interface of data receiver by usb audio passage, wherein said VoP transmits in ISO mode;
By interaction data described in described voice flow interface, report described interaction data to related application;
Describe according to preset standard and resolve described VoP, obtain complete non-speech data in conjunction with described packet.
On the other hand, provide a kind of system by usb audio channel transmission data, described system comprises:
Data transmitting terminal and data receiver, described data transmitting terminal comprises:
Data transformations unit, for non-speech data being sent to speech control interface and described non-speech data being converted into interaction data, described interaction data comprises packet, VoP;
Data transmission unit, for alternately described interaction data to be transferred to the voice flow interface of data receiver by usb audio passage, wherein said VoP transmits in ISO mode;
Described data receiver comprises:
Data receipt unit, for by interaction data described in described voice flow interface, reports described interaction data to related application;
Data Analysis unit, resolving described VoP for describing according to preset standard, obtaining complete non-speech data in conjunction with described packet.
In the embodiment of the present invention, non-speech data is sent to speech control interface and described non-speech data is converted into interaction data, described interaction data comprises packet, VoP; Alternately described interaction data is transferred to the voice flow interface of data receiver by usb audio passage, wherein said VoP transmits in ISO mode; By interaction data described in described voice flow interface, report described interaction data to related application; Describe according to preset standard and resolve described VoP, complete non-speech data is obtained in conjunction with described packet, the present invention, adopt USB Mic interface asynchronous transmission mode, data are directly reported upper application software, application software directly obtains data from USB Mic interface, participates in coordinating without the need to operating system.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearly understand, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
In embodiments of the present invention, non-speech data is sent to speech control interface and described non-speech data is converted into interaction data, described interaction data comprises packet, VoP; Alternately described interaction data is transferred to the voice flow interface of data receiver by usb audio passage, wherein said VoP transmits in ISO mode; By interaction data described in described voice flow interface, report described interaction data to related application; Describe according to preset standard and resolve described VoP, obtain complete non-speech data in conjunction with described packet.
Below in conjunction with specific embodiment, realization of the present invention is described in detail:
Embodiment one
Fig. 1 shows the realization flow of the method by usb audio channel transmission data that the embodiment of the present invention one provides, and details are as follows:
It should be noted that, the present invention is applicable to Android, Windows system and has the intelligent terminal of USBMicrophone interface.
In step S101, non-speech data is sent to speech control interface and described non-speech data is converted into interaction data, described interaction data comprises packet, VoP.
In the present embodiment, described non-speech data is the non-audio data that data transmitting terminal stores.Described packet is USB form non-audio data, and the size of one is 16K sampling, and 16, described VoP is the non-audio data of the microphone data form being converted into usb audio channel transfer, and the size of one is 16K sampling, 16.
In step s 102, alternately described interaction data is transferred to the voice flow interface of data receiver by usb audio passage, wherein said VoP transmits in ISO mode.
In the present embodiment, described usb audio passage and USB Microphone interface, also claim USB Mic interface.Described interaction data is alternately transferred to the voice flow interface of data receiver by data transmitting terminal by usb audio passage, wherein said VoP transmits in ISO mode, is equivalent to every millisecond like this and passes 32 bytes, its form table specific as follows:
In step s 103, by interaction data described in described voice flow interface, report described interaction data to related application.
In the present embodiment, data receiver, by interaction data described in described voice flow interface, reports described interaction data to related application, participates in without the need to system.
In step S104, describe according to preset standard and resolve described VoP, obtain complete non-speech data in conjunction with described packet.
In the present embodiment, data receiver describes according to preset standard and resolves described VoP, and obtain complete non-speech data in conjunction with described packet, upper application software directly reads data, and efficiency is high, across hardware platform, is widely used.
The present embodiment, can reach and adopt USB Mic interface asynchronous transmission mode, data are directly reported upper application software, and application software directly obtains data from USB Mic interface, participates in coordinating without the need to operating system.
Embodiment two
Fig. 3 shows the concrete structure block diagram of the system by usb audio channel transmission data that the embodiment of the present invention two provides, and for convenience of explanation, illustrate only the part relevant to the embodiment of the present invention.In the present embodiment, should be comprised by the system of usb audio channel transmission data: data transmitting terminal 1 and data receiver 2, described data transmitting terminal 1 comprises:
Data transformations unit 11, for non-speech data being sent to speech control interface and described non-speech data being converted into interaction data, described interaction data comprises packet, VoP;
Data transmission unit 12, for alternately described interaction data to be transferred to the voice flow interface of data receiver by usb audio passage, wherein said VoP transmits in ISO mode;
Described data receiver 2 comprises:
Data receipt unit 21, for by interaction data described in described voice flow interface, reports described interaction data to related application;
Data Analysis unit 22, resolving described VoP for describing according to preset standard, obtaining complete non-speech data in conjunction with described packet.
The present embodiment, can reach and adopt USB Mic interface asynchronous transmission mode, data are directly reported upper application software, and application software directly obtains data from USB Mic interface, participates in coordinating without the need to operating system.
Further, described interaction data is specially 32bit position.
The system by usb audio channel transmission data that the embodiment of the present invention provides can be applied in the embodiment of the method one of aforementioned correspondence, and details, see the description of above-described embodiment one, do not repeat them here.
It should be noted that in said system embodiment, included unit is carry out dividing according to function logic, but is not limited to above-mentioned division, as long as can realize corresponding function; In addition, the concrete title of each functional unit, also just for the ease of mutual differentiation, is not limited to protection scope of the present invention.
In addition, one of ordinary skill in the art will appreciate that all or part of step realized in the various embodiments described above method is that the hardware that can carry out instruction relevant by program has come, corresponding program can be stored in a computer read/write memory medium, described storage medium, as ROM/RAM, disk or CD etc.The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, all any amendments done within the spirit and principles in the present invention, equivalent replacement and improvement etc., all should be included within protection scope of the present invention.