CN110413253A - Audio device control method and device, audio frequency apparatus and storage medium - Google Patents

Audio device control method and device, audio frequency apparatus and storage medium Download PDF

Info

Publication number
CN110413253A
CN110413253A CN201910709567.9A CN201910709567A CN110413253A CN 110413253 A CN110413253 A CN 110413253A CN 201910709567 A CN201910709567 A CN 201910709567A CN 110413253 A CN110413253 A CN 110413253A
Authority
CN
China
Prior art keywords
interface
audio
frequency apparatus
descriptor
audio frequency
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.)
Pending
Application number
CN201910709567.9A
Other languages
Chinese (zh)
Inventor
李毅
要文涛
许建林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qingliu Dingdian Technology Co Ltd
Original Assignee
Beijing Qingliu Dingdian Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Qingliu Dingdian Technology Co Ltd filed Critical Beijing Qingliu Dingdian Technology Co Ltd
Priority to CN201910709567.9A priority Critical patent/CN110413253A/en
Publication of CN110413253A publication Critical patent/CN110413253A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (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)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

The invention discloses a kind of audio device control methods and device, audio frequency apparatus and storage medium, and wherein method includes: that audio frequency apparatus includes at least audio mode interface and data mode interface;Audio frequency apparatus includes at least audio mode interface descriptor and data mode interface descriptor, and audio frequency apparatus chooses a kind of interface descriptor in audio mode interface descriptor and data mode interface descriptor, to run audio mode interface or data pattern interface;Or audio frequency apparatus modifies interface descriptor, to run audio mode interface or data pattern interface.Compared with the prior art, the present invention realizes the purpose in the delay of different application field flexible modulation usb audio equipment, the application power of usb audio equipment is extended, under the premise of not influencing compatibility, field can be interacted in hard real time and reduce delay, promote user experience.

Description

Audio device control method and device, audio frequency apparatus and storage medium
Technical field
The present invention relates to audio equipment applications fields.More particularly, to a kind of audio device control method and device, sound Frequency equipment and storage medium.
Background technique
Compared to traditional built-in sound card, USB (Universal Serial Bus, universal serial bus) audio frequency apparatus is got over It is paid close attention to get over by the majority of consumers.One side usb audio equipment has the advantages such as portable, fashionable appearance.Importantly, The conversion chip of digital signal to audio analog signals has been transferred to the outside of host or terminal, part USB by usb audio equipment Audio frequency apparatus has external autonomous power supply system.External electronic system layout is less subject to host or terminal inner device Electromagnetic interference, so that the sound quality of usb audio equipment is more excellent than built-in sound card.In product practice, usb audio equipment is answered extensively It is on the mobile terminal of representative for Android.Each device manufacturer usually all determines Android operation system System, while the characteristic for being also limited by Android operation system itself, usb audio equipment postpone on partial movement terminal compared with Greatly, user experience is influenced, especially in interaction occasion by force.On the other hand, according to the technical solution of traditional usb audio equipment, sound Frequency equipment operating mode solidification and it is single, demand of the end different USB HOST under different scenes can not be flexibly met, need thus It is proposed a kind of control method of usb audio equipment to solve the above problems.
Summary of the invention
In consideration of it, may be implemented to lead in different application the purpose of the present invention is to provide a kind of audio device control method The delay of domain flexible modulation usb audio equipment, extends the purpose of the application power of usb audio equipment, before not influencing compatibility It puts, field can be interacted in hard real time and reduce delay, promote user experience.
According to the one side of the disclosure, this application provides a kind of audio device control methods, and the audio frequency apparatus is at least Include audio mode interface and data mode interface;The audio frequency apparatus includes at least two class interface descriptors;
Wherein, the interface descriptor includes audio mode interface descriptor and data mode interface descriptor;
When running the audio frequency apparatus, comprising:
The audio frequency apparatus chooses a kind of interface descriptor in the interface descriptor as described at least two classes, to run the sound Frequency mode interface or the data pattern interface;Or
The audio frequency apparatus modifies interface descriptor, to run the audio mode interface or the data pattern interface.
In one possible implementation, the audio frequency apparatus modifies interface descriptor, comprising:
The data pattern interface descriptor is revised as from the audio mode interface descriptor, or from the data pattern Interface descriptor is revised as the audio mode interface descriptor.
In one possible implementation, the audio frequency apparatus runs the audio mode interface, so that the end HOST Operating system reads the audio mode interface descriptor, and the application software or operating system at the end HOST pass through AudioRecord interface, AudioTrack interface, OpenSL ES interface or AAudio interface are counted with the audio frequency apparatus According to read-write;
The audio frequency apparatus runs the data pattern interface, so that the application software at the end HOST reads the data Mode interface descriptor, the filec descriptor or USB that the application software at the end HOST passes through the operating system at the end HOST Interrupt mechanism and the audio frequency apparatus carry out reading and writing data.
In one possible implementation, further includes: the audio frequency apparatus runs the data pattern interface, described The application software at the end HOST and the audio frequency apparatus carry out reading and writing data;The application software or operating system at the end HOST pass through AudioRecord interface, AudioTrack interface, OpenSL ES interface or AAudio interface in addition to the audio frequency apparatus Audio frequency apparatus carry out reading and writing data.
In one possible implementation, it is chosen in audio frequency apparatus interface descriptor as described at least two classes a kind of At least one of interface descriptor or the audio frequency apparatus modification interface descriptor, including following manner:
Control element is provided in the audio frequency apparatus, the audio frequency apparatus carries out the interface according to the control element The selection or modification of descriptor;
The audio frequency apparatus carries out the selection or modification of the interface descriptor according to the instruction received;
The audio frequency apparatus obtains the connection relationship between the end HOST, when the connection relationship is to disconnect reconnection, into The selection or modification of the row interface descriptor.
In one possible implementation, the audio frequency apparatus runs the audio mode interface or data pattern interface When carrying out reading and writing data, comprising:
At least one packets of audio data is read and write in a transmission transaction;
Wherein, the size of each packets of audio data with the audio frequency apparatus frame mechanical periodicity.
According to another aspect of the present disclosure, a kind of audio device control device is additionally provided, for controlling audio frequency apparatus;
Wherein, the audio frequency apparatus includes at least audio mode interface and data mode interface;And the audio frequency apparatus packet Containing at least two class interface descriptors, the interface descriptor includes audio mode interface descriptor and the description of data mode interface Symbol;
The audio device control device includes choosing modified module and interface operation module;
The selection modified module is configured as choosing a kind of interface description in the interface descriptor as described at least two classes Symbol, so that interface operation module runs the audio mode interface or the data pattern interface;Or
The selection modified module is configured as modification interface descriptor, so that described in interface operation module operation Audio mode interface or the data pattern interface.
In one possible implementation, it when the selection modified module modification interface descriptor, is configured as from institute It states audio mode interface descriptor and is revised as the data pattern interface descriptor, or repaired from the data pattern interface descriptor It is changed to the audio mode interface descriptor.
In one possible implementation, the interface runs module, is configured as running the audio mode interface, So that the operating system at the end HOST reads the audio mode interface descriptor, the application software or operating system at the end HOST By AudioRecord interface, AudioTrack interface, OpenSL ES interface or AAudio interface and the audio frequency apparatus into Row reading and writing data;
The interface runs module, is additionally configured to run the data pattern interface, so that the application at the end HOST Software reads the data pattern interface descriptor, and the application software at the end HOST passes through the operating system at the end HOST Filec descriptor or USB interrupt mechanism and the audio frequency apparatus carry out reading and writing data.
In one possible implementation, the selection modified module includes the first selection modification submodule, the second choosing Modification submodule and third is taken to choose modification submodule;
Described first chooses modification submodule, is configured as according to the control element in the audio frequency apparatus, described in progress The selection or modification of interface descriptor;
Described second chooses modification submodule, is configured as carrying out the interface descriptor according to the instruction received It chooses or modifies;
The third chooses modification submodule, is configured as obtaining the connection between the audio frequency apparatus and the end HOST and closes System carries out the selection or modification of the interface descriptor when the connection relationship is to disconnect reconnection.
In one possible implementation, the interface operation module includes reading and writing data submodule;
The reading and writing data submodule, be configured as run the audio mode interface or the data pattern interface into When row reading and writing data, at least one packets of audio data is read and write in a transmission transaction;
Wherein, the size of each packets of audio data with the audio frequency apparatus frame mechanical periodicity.
According to the one side of the disclosure, a kind of audio frequency apparatus is additionally provided, the audio frequency apparatus includes at least audio mode Interface and data mode interface;And
The audio frequency apparatus includes at least two class interface descriptors, and the interface descriptor includes the description of audio mode interface Symbol and data mode interface descriptor;
The audio frequency apparatus further include:
Processor;
For storing the memory of the processor-executable instruction;
Wherein, the processor realizes any method in front when being configured as executing the executable instruction.
According to another aspect of the present disclosure, a kind of non-volatile computer readable storage medium storing program for executing is additionally provided, is stored thereon There are computer program instructions, any method in front is realized when the computer program instructions are executed by processor.
Detailed description of the invention
It, below will be to specific in order to illustrate more clearly of the specific embodiment of the invention or technical solution in the prior art Embodiment or attached drawing needed to be used in the description of the prior art be briefly described, it should be apparent that, it is described below Attached drawing is one embodiment of the present invention, for those of ordinary skill in the art, before not making the creative labor It puts, is also possible to obtain other drawings based on these drawings.
Fig. 1 is the performed flow chart operated of host side in the audio device control method of the embodiment of the present disclosure;
Fig. 2 is the block diagram of the audio device control device of the embodiment of the present disclosure;
Fig. 3 is the block diagram of the audio frequency apparatus of the embodiment of the present disclosure.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with attached drawing to the present invention Technical solution be clearly and completely described, described embodiment is section Example of the present invention, rather than whole realities Apply example.
Firstly, it is necessary to illustrate, in the audio device control method of the embodiment of the present disclosure, audio frequency apparatus can be USB Audio frequency apparatus.In order to realize the multimode operation of usb audio equipment, to adapt to different application fields, the sound for running or controlling Frequency equipment includes at least audio mode interface and data mode interface.Corresponding, audio frequency apparatus also includes that at least two class interfaces are retouched State symbol.Two class interface descriptors may include audio mode interface descriptor and data mode interface descriptor.Wherein, audio mould Formula interface descriptor is applied to audio mode interface, and data pattern interface descriptor is applied to data pattern interface.
It may include: audio frequency apparatus by least two as a result, when controlling audio frequency apparatus by above-mentioned configuration progress multimode operation The step of a kind of interface descriptor is to run audio mode interface or data pattern interface is chosen in class interface descriptor;Or It is that audio frequency apparatus is by modifying the step of interface descriptor is to run audio mode interface or data pattern interface.
That is, by audio device configuration audio mode interface and data mode interface, and correspond to audio mode Audio mode interface descriptor and the description of two class interface of data mode interface descriptor is respectively set in interface and data mode interface Symbol, so that usb audio equipment can both be sent to the end USB HOST (that is, host side, below referred to as the end HOST) simultaneously Multiclass interface descriptor information uses different interfaces by selection interface descriptor;It can also only provide at any one time A kind of interface descriptor, by modification interface descriptor come using different interfaces, to realize flexible in different application field Audio frequency apparatus delay is adjusted, the purpose of the application power of usb audio equipment is extended, it, can be under the premise of not influencing compatibility Hard real time interacts field, reduces the delay of audio frequency apparatus, effectively promotion user experience.
Wherein, it needs to be illustrated, same class interface descriptor refers to the identical interface descriptor of type.
Meanwhile it will be appreciated by persons skilled in the art that usb audio equipment at runtime, after connecting with the end HOST, is led to It crosses and is interacted with the end HOST progress data command, the operation of Lai Shixian usb audio equipment.
In order to be illustrated more clearly that the embodiment of the present disclosure audio device control method technical solution, below in conjunction with In audio device control method, operation performed by the end HOST is illustrated.
Fig. 1 is in a kind of audio device control method of first embodiment of the invention, and the end HOST (that is, host side) is performed Operation flow chart, as shown in Figure 1, in the audio device control method of the embodiment of the present disclosure, behaviour performed by host side Work may include following three step.
Step S101: the descriptor of audio frequency apparatus is obtained.Optionally, it is illustrated by taking usb audio equipment as an example.Specifically Ground, after usb audio equipment is connect with the end HOST, the end HOST is sent to usb audio equipment obtains device descriptor and configuration description The request of symbol, usb audio equipment is according to request-reply device descriptor, configures descriptor and interface descriptor.
Wherein, audio frequency apparatus includes at least the implementation of audio mode interface descriptor and data mode interface descriptor May include following at least one mode:
Optionally, realize that audio frequency apparatus includes at least audio mode interface descriptor and data in the form of USB unit equipment Mode interface descriptor, USB unit equipment have been internally integrated USB HUB, and the usb audio of at least two class distinct interface descriptors is set Standby access USB HUB.Herein, it will be appreciated by persons skilled in the art that USB HUB, refers to that one kind can be by a USB Interface Expanding is devices that are multiple, and can making these interfaces while use.Also referred to as usb hub.
Optionally, realize that audio frequency apparatus includes at least audio mode interface descriptor and data in the form of USB equipment complex Mode interface descriptor, according to usb protocol, a USB device can have multiclass interface descriptor, and multiclass interface descriptor is simultaneously In the presence of.
Optionally, usb audio equipment provides different interfaces by way of modifying descriptor.It is optionally real at one It applies in example, usb audio equipment includes MCU (Microcontroller Unit, micro-control unit), and MCU is to usb audio equipment USB interface chip carries out the dynamic modification of interface descriptor, to realize that distinct interface descriptor is loaded.
Herein, it should be noted that usb audio equipment by way of modifying descriptor to provide different interfaces when, It may include that data pattern interface descriptor is revised as from audio mode interface descriptor to provide the mode of data pattern interface, It can also include that audio mode interface descriptor is revised as from data pattern interface descriptor to provide the side of audio mode interface Formula.
In an alternative embodiment, usb audio equipment runs audio mode interface, so that the end HOST operating system is read Audio mode interface descriptor is taken, the end HOST application software or operating system are connect by AudioRecord interface, AudioTrack Mouth, OpenSL ES interface or AAudio interface and usb audio equipment carry out reading and writing data.Usb audio equipment operating data mode Interface, so that the application software at the end HOST can read data pattern interface descriptor, the application software at the end HOST passes through operation system The filec descriptor or USB interrupt mechanism and usb audio equipment of system carry out reading and writing data.
It needs to be illustrated, under audio mode interface descriptor, the operating system or application software at the end HOST are logical Cross general AudioRecord interface, AudioTrack interface, OpenSL ES interface or AAudio interface and audio frequency apparatus into The read-write of row audio data, it is advantageous that ease for use height and adaptable.Under data pattern interface descriptor, the end HOST The filec descriptor of accessible with application software operating system realizes that the data between audio frequency apparatus are read using USB interrupt mechanism When writing, the delay of read-write is smaller.
In an alternative embodiment, the type identification of audio mode interface descriptor this kind interface descriptor can be with Value is 1, and the type identification value of data pattern interface descriptor this kind interface descriptor can be 255.Thus it realizes Differentiation to inhomogeneous interface descriptor.Differentiation mode is simple, it is easy to accomplish.
Step S102: choosing or modification audio frequency apparatus interface descriptor.Wherein, choose or modify the description of audio frequency apparatus interface Symbol may include: that audio frequency apparatus chooses a kind of interface description in audio mode interface descriptor and data mode interface descriptor Symbol, to run audio mode interface or data pattern interface;It can also include: audio frequency apparatus modification interface descriptor, with operation Audio mode interface or data pattern interface.
It needs to be illustrated, the every a kind of interface descriptor of usb audio equipment corresponds to different hardware capability or operation Mode, therefore under different application fields and scene, it needs to select or be modified as different interface descriptors.According to front institute It states, audio frequency apparatus modification interface descriptor may include following at least one mode:
Data pattern interface descriptor is revised as from audio mode interface descriptor.Either, it is retouched from data pattern interface It states symbol and is revised as audio mode interface descriptor.
It wherein, in one possible implementation, can be by following when carrying out the selection or modification of interface descriptor At least one mode is realized:
In an alternative embodiment, be provided with control element in audio frequency apparatus, audio frequency apparatus according to control element into The selection or modification of line interface descriptor.Here, it should be pointed out that carrying out interface description according to control element in audio frequency apparatus When the selection or modification of symbol, it can specifically be carried out according to the current state of control element.Such as: control element can set for audio The current state of hardware electronic switch in standby, control element can switch the gear currently set by hardware electronic.That is, in audio Hardware electronic is arranged in equipment to switch, audio frequency apparatus switchs the gear currently set according to hardware electronic, carries out interface descriptor It chooses or modifies.
For example, when the gear that the hardware electronic switch of audio frequency apparatus is currently set is first grade, can will work as at this time Preceding interface descriptor selection is revised as audio mode interface descriptor.It is the in the gear currently set of hardware electronic switch At two grades, current interface descriptor is then selected or is revised as data pattern interface descriptor at this time.Carrying out interface as a result, When the selection or modification of descriptor, it need to only be can be realized by switching the hardware electronic switch of audio frequency apparatus, it is easy to operate, it is easy to It realizes.
Wherein, it should be pointed out that realizing interface descriptor by switching according to the hardware electronic of audio frequency apparatus When choosing or modifying, the numbers of gear steps of hardware electronic switch can be according to the species number for the interface descriptor that audio frequency apparatus is configured The actual conditions such as amount are configured, herein without specifically limiting.
Further, in an alternative embodiment, audio frequency apparatus carries out interface descriptor according to the instruction received Selection or modification.That is, usb audio device support facilities switch, instruction is sent with switching interface descriptor.Such as: in usb audio MCU is set in equipment, and the software in MCU carries out the selection of USB interface chip interface descriptor according to the instruction that the end HOST is sent Or modification.
For example, when the instruction that the end HOST is sent is to choose data pattern interface descriptor, at this time in audio frequency apparatus After the MCU configured receives the instruction, the instruction received is parsed, the information in acquisition instruction, and then further according to The information got carries out the modification or selection of the interface descriptor of current setting, so that audio frequency apparatus can be loaded and be connect The interface descriptor that the instruction received matches.
It is loaded with the MCU of software by being arranged in audio frequency apparatus, is realized by the data interaction between the end MCU and HOST The selection or modification of interface descriptor do not need to be adjusted the hardware configuration of audio frequency apparatus, only need to be in the MCU of audio frequency apparatus The middle corresponding software program of programming can be realized, while realizing that different application field reduces the delay of audio frequency apparatus, also Effect saves hardware cost.
Wherein, when above-mentioned audio frequency apparatus carries out the selection or modification of interface descriptor according to the instruction received, audio Equipment can first pass through interface corresponding to the interface descriptor of its default and the end HOST carries out data communication, to receive the end HOST The instruction of transmission.And then the selection or modification of interface descriptor are carried out further according to the instruction received.
Further, in an alternative embodiment, audio frequency apparatus can also be according to its company between the end HOST Relationship is connect to carry out the selection or modification of interface descriptor.That is, audio frequency apparatus obtains the connection relationship between the end HOST, even When connecing relationship to disconnect reconnection, the selection or modification of interface descriptor are carried out.Usb audio equipment is according to the company with the end HOST in this way Connect selection and modification that relationship carries out interface descriptor.
In addition, interface descriptor is being chosen or modified to audio frequency apparatus by any of the above-described kind of mode, corresponding interface is realized After (such as: data pattern interface or audio mode interface) load, reading and writing data can be carried out with the end HOST.That is, refering to Fig. 1, after choosing or modifying interface descriptor to run corresponding interface, the i.e. executable step of host side (that is, the end HOST) S103: reading and writing data is carried out with usb audio equipment.
Specifically, after the completion of usb audio equipment interface descriptor selecting or modification, reading and writing data is carried out with the end HOST When, in order to guarantee the timing of audio system, the size of each packets of audio data with audio frequency apparatus frame mechanical periodicity.
In a preferred embodiment, at least one packets of audio data is read and write in a transmission transaction.Optionally, often The size of a packets of audio data is the corresponding audio data length of frame cycle time length of an audio frequency apparatus.
Wherein, during audio frequency apparatus and the end HOST carry out reading and writing data, in an alternative embodiment, when one When audio frequency apparatus operation data mode interface, the application software at the end HOST and this audio frequency apparatus carry out reading and writing data;The end HOST Application software or operating system pass through AudioRecord interface, AudioTrack interface, OpenSL ES interface or AAudio Interface carries out reading and writing data with the audio frequency apparatus in addition to this audio frequency apparatus, and the multiterminal of the end HOST audio data have been achieved Parallel output.
Herein, it should be noted that the audio frequency apparatus in addition to audio frequency apparatus can be identical as current audio frequency apparatus The equipment of type is also possible to different equipment, herein without specifically limiting.
For example, the audio frequency apparatus of operation data mode interface can be defined as the first audio frequency apparatus.In the first audio When equipment carries out reading and writing data by data pattern interface and the end HOST, the end HOST can also be by its loading using soft at this time Part (that is, APP) or operating system pass through AudioRecord interface, AudioTrack interface, OpenSL ES interface or AAudio Interface realizes the reading and writing data between audio frequency apparatus in addition to the first audio frequency apparatus so that the end HOST can with it is more A audio frequency apparatus carries out mutually independent data interaction simultaneously.
Wherein, when the first audio frequency apparatus carries out reading and writing data by data pattern interface and the end HOST, the end HOST is answered Data pattern interface descriptor is read with software, and passes through the filec descriptor of the operating system at the end HOST or USB interrupt mechanism Reading and writing data is carried out with the first audio frequency apparatus.
In addition, according to noted earlier, it will be appreciated by persons skilled in the art that the audio in addition to the first audio frequency apparatus The number of equipment can be one, can also be two or more.Meanwhile the audio frequency apparatus in addition to the first audio frequency apparatus can be Equipment identical with the first audio frequency apparatus, is also possible to different equipment.
The audio device control method of the embodiment of the present disclosure as a result, by including at least audio mould to audio frequency apparatus setting Formula interface and data mode interface, and it is corresponding be respectively set at least two class interface descriptors (that is, audio mode interface descriptor and Data pattern interface descriptor), thus when controlling audio frequency apparatus operation, by being chosen from least two class interface descriptors A kind of interface descriptor is to run audio mode interface or data pattern interface, or by modification interface descriptor to run Audio mode interface descriptor or data pattern interface descriptor, enable audio frequency apparatus to run under different application fields Different interfaces controls the multimode operation of audio frequency apparatus to realize the delay for reducing audio frequency apparatus.
Correspondingly, being based on mentioned-above any audio device control method, the embodiment of the present disclosure additionally provides one kind Audio device control device.Due to the working principle of the audio device control device of disclosure offer and the sound of the embodiment of the present disclosure The principle of frequency apparatus control method is same or similar, therefore overlaps will not be repeated.
Firstly the need of the audio device control device that explanation, the disclosure provide, for controlling the operation of audio frequency apparatus. Wherein, the audio frequency apparatus controlled includes at least audio mode interface and data mode interface.Also, audio frequency apparatus includes at least Two class interface descriptors, at least two class interface descriptors may include audio mode interface descriptor and the description of data mode interface Symbol.
Wherein, referring to Fig.2, the audio device control device 100 of the embodiment of the present disclosure includes choosing modified module 110 and connecing Mouth operation module 120.Wherein, modified module 110 is chosen, is configured as by choosing a kind of interface at least two class interface descriptors Descriptor, so that interface operation module 120 runs audio mode interface or data pattern interface.Either, modified module is chosen 110, it can be additionally configured to modification interface descriptor, so that interface operation module 120 runs audio mode interface or data mould Formula interface.
In one possible implementation, it when choosing the modification interface descriptor of modified module 110, is configured as from audio Mode interface descriptor is revised as data pattern interface descriptor, or is revised as audio mode from data pattern interface descriptor and connects Mouth descriptor.
In one possible implementation, interface runs module 120, is configured as operation audio mode interface, so that The operating system at the end HOST reads audio mode interface descriptor, and the application software or operating system at the end HOST pass through AudioRecord interface, AudioTrack interface, OpenSL ES interface or AAudio interface and audio frequency apparatus carry out data reading It writes;
Interface runs module 120, is additionally configured to operation data mode interface, so that the application software at the end HOST reads number According to mode interface descriptor, off line in the filec descriptor or USB that the application software at the end HOST passes through the operating system at the end HOST System carries out reading and writing data with audio frequency apparatus.In a kind of optional mode, parallel process is with this, the application software at the end HOST Or operating system by AudioRecord interface, AudioTrack interface, OpenSL ES interface or AAudio interface and removes this Audio frequency apparatus except a audio frequency apparatus carries out reading and writing data.
In one possible implementation, choosing modified module 110 includes the first selection modification submodule, the second selection It modifies submodule and third chooses modification submodule (not shown).Wherein, first modification submodule is chosen, is configured as root According to the control element in audio frequency apparatus, the selection or modification of interface descriptor are carried out.Second chooses modification submodule, is configured as According to the instruction received, the selection or modification of interface descriptor are carried out.Third chooses modification submodule, is configured as obtaining sound Connection relationship between frequency equipment and the end HOST carries out the selection of interface descriptor or repairs when connection relationship is to disconnect reconnection Change.
In one possible implementation, interface operation module 120 includes reading and writing data submodule (not shown). Reading and writing data submodule is configured as when running audio mode interface or data pattern interface carries out reading and writing data, primary At least one packets of audio data is read and write in transmission transaction.Wherein, the size of each packets of audio data with audio frequency apparatus the frame period Variation.
Further, the disclosure additionally provides a kind of audio frequency apparatus 200, and audio frequency apparatus 200 connects including at least audio mode Mouth and data mode interface.Also, audio frequency apparatus 200 includes at least two class interface descriptors, and two class interface descriptors include sound Frequency mode interface descriptor and data mode interface descriptor.Wherein, refering to Fig. 3, the audio frequency apparatus 200 of the embodiment of the present disclosure is also It include: processor 210, and for the memory 220 of 210 executable instruction of storage processor.Wherein, processor 210 are matched It is set to when executing executable instruction and realizes any audio device control method in front.
Herein, it is noted that memory 220 is used as a kind of computer readable storage medium, can be used for storing software Program, computer executable program and various modules, as: program corresponding to the audio device control method of the embodiment of the present disclosure Or module.The software program or module that processor 210 is stored in memory 220 by operation, thereby executing audio frequency apparatus 200 Various function application and data processing.
Correspondingly, based on the same inventive concept, the disclosure additionally provides a kind of non-volatile computer readable storage medium storing program for executing, Computer program instructions are stored thereon with, realize that any audio in front is set when computer program instructions are executed by processor 210 Standby control method.
Finally, it should be noted that embodiment described above, only a specific embodiment of the invention, to illustrate the present invention Technical solution, rather than its limitations, scope of protection of the present invention is not limited thereto, although with reference to the foregoing embodiments to this hair It is bright to be described in detail, those skilled in the art should understand that: anyone skilled in the art In the technical scope disclosed by the present invention, it can still modify to technical solution documented by previous embodiment or can be light It is readily conceivable that variation or equivalent replacement of some of the technical features;And these modifications, variation or replacement, do not make The essence of corresponding technical solution is detached from the spirit and scope of technical solution of the embodiment of the present invention, should all cover in protection of the invention Within the scope of.Therefore, protection scope of the present invention should be subject to the protection scope in claims.

Claims (13)

1. a kind of audio device control method, which is characterized in that the audio frequency apparatus includes at least audio mode interface and data Mode interface;The audio frequency apparatus includes at least two class interface descriptors;
Wherein, the interface descriptor includes audio mode interface descriptor and data mode interface descriptor;Described in operation When audio frequency apparatus, comprising:
The audio frequency apparatus chooses a kind of interface descriptor in the interface descriptor as described at least two classes, to run the audio mould Formula interface or the data pattern interface;Or
The audio frequency apparatus modifies interface descriptor, to run the audio mode interface or the data pattern interface.
2. the method according to claim 1, wherein the audio frequency apparatus modifies interface descriptor, comprising:
The data pattern interface descriptor is revised as from the audio mode interface descriptor, or from the data pattern interface Descriptor is revised as the audio mode interface descriptor.
3. the method according to claim 1, wherein the audio frequency apparatus runs the audio mode interface, with The operating system at the end HOST is set to read the audio mode interface descriptor, the application software or operating system at the end HOST are logical It crosses AudioRecord interface, AudioTrack interface, OpenSL ES interface or AAudio interface and the audio frequency apparatus carries out Reading and writing data;
The audio frequency apparatus runs the data pattern interface, so that the application software at the end HOST reads the data pattern Interface descriptor, the application software at the end HOST are interrupted by the filec descriptor or USB of the operating system at the end HOST Mechanism and the audio frequency apparatus carry out reading and writing data.
4. according to the method described in claim 3, it is characterized by further comprising: the audio frequency apparatus runs the data pattern Interface, the application software at the end HOST and the audio frequency apparatus carry out reading and writing data;The application software at the end HOST or behaviour Make system by AudioRecord interface, AudioTrack interface, OpenSL ES interface or AAudio interface and except the sound Audio frequency apparatus except frequency equipment carries out reading and writing data.
5. method according to any one of claims 1 to 3, which is characterized in that the audio frequency apparatus is as described at least two classes Choose a kind of interface descriptor in interface descriptor or the audio frequency apparatus modify interface descriptor, including in following manner extremely Few one kind:
Control element is provided in the audio frequency apparatus, the audio frequency apparatus carries out the interface description according to the control element The selection or modification of symbol;
The audio frequency apparatus carries out the selection or modification of the interface descriptor according to the instruction received;
The audio frequency apparatus obtains the connection relationship between the end HOST, when the connection relationship is to disconnect reconnection, carries out institute State the selection or modification of interface descriptor.
6. method according to any one of claims 1 to 4, which is characterized in that the audio frequency apparatus runs the audio mould When formula interface or data pattern interface carry out reading and writing data, comprising:
At least one packets of audio data is read and write in a transmission transaction;
Wherein, the size of each packets of audio data with the audio frequency apparatus frame mechanical periodicity.
7. a kind of audio device control device, which is characterized in that for controlling audio frequency apparatus;
Wherein, the audio frequency apparatus includes at least audio mode interface and data mode interface;And the audio frequency apparatus includes extremely Few two class interface descriptors, the interface descriptor includes audio mode interface descriptor and data mode interface descriptor;
The audio device control device includes choosing modified module and interface operation module;
The selection modified module is configured as choosing a kind of interface descriptor in the interface descriptor as described at least two classes, with The interface operation module is set to run the audio mode interface or the data pattern interface;Or
The selection modified module is configured as modification interface descriptor, so that interface operation module runs the audio Mode interface or the data pattern interface.
8. device according to claim 7, which is characterized in that when the selection modified module modification interface descriptor, quilt It is configured to be revised as the data pattern interface descriptor from the audio mode interface descriptor, or is connect from the data pattern Mouth descriptor is revised as the audio mode interface descriptor.
9. device according to claim 7, which is characterized in that the interface runs module, is configured as running the sound Frequency mode interface so that the operating system at the end HOST reads the audio mode interface descriptor, the end HOST using soft Part or operating system pass through AudioRecord interface, AudioTrack interface, OpenSL ES interface or AAudio interface and institute It states audio frequency apparatus and carries out reading and writing data;
The interface runs module, is additionally configured to run the data pattern interface, so that the application software at the end HOST Read the data pattern interface descriptor, the file that the application software at the end HOST passes through the operating system at the end HOST Descriptor or USB interrupt mechanism and the audio frequency apparatus carry out reading and writing data.
10. device according to any one of claims 7 to 9, which is characterized in that the selection modified module includes the first choosing Modification submodule, second is taken to choose modification submodule and third selection modification submodule;
Described first chooses modification submodule, is configured as carrying out the interface according to the control element in the audio frequency apparatus The selection or modification of descriptor;
Described second chooses modification submodule, is configured as carrying out the selection of the interface descriptor according to the instruction received Or modification;
The third chooses modification submodule, is configured as obtaining the connection relationship between the audio frequency apparatus and the end HOST, In The connection relationship is when disconnecting reconnection, to carry out the selection or modification of the interface descriptor.
11. device according to any one of claims 7 to 9, which is characterized in that the interface operation module includes that data are read Write submodule;
The reading and writing data submodule is configured as being counted in the operation audio mode interface or the data pattern interface When according to read-write, at least one packets of audio data is read and write in a transmission transaction;
Wherein, the size of each packets of audio data with the audio frequency apparatus frame mechanical periodicity.
12. a kind of audio frequency apparatus, which is characterized in that the audio frequency apparatus includes at least audio mode interface and data pattern connects Mouthful;And
The audio frequency apparatus include at least two class interface descriptors, the interface descriptor include audio mode interface descriptor and Data pattern interface descriptor;
The audio frequency apparatus further include:
Processor;
For storing the memory of the processor-executable instruction;
Wherein, the processor realizes any one of claim 1 to 6 institute when being configured as executing the executable instruction The method stated.
13. a kind of non-volatile computer readable storage medium storing program for executing, is stored thereon with computer program instructions, which is characterized in that institute It states and realizes method described in any one of claim 1 to 6 when computer program instructions are executed by processor.
CN201910709567.9A 2019-08-02 2019-08-02 Audio device control method and device, audio frequency apparatus and storage medium Pending CN110413253A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910709567.9A CN110413253A (en) 2019-08-02 2019-08-02 Audio device control method and device, audio frequency apparatus and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910709567.9A CN110413253A (en) 2019-08-02 2019-08-02 Audio device control method and device, audio frequency apparatus and storage medium

Publications (1)

Publication Number Publication Date
CN110413253A true CN110413253A (en) 2019-11-05

Family

ID=68365309

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910709567.9A Pending CN110413253A (en) 2019-08-02 2019-08-02 Audio device control method and device, audio frequency apparatus and storage medium

Country Status (1)

Country Link
CN (1) CN110413253A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1635438A (en) * 2003-12-31 2005-07-06 深圳市朗科科技有限公司 Data processing equipment
CN101882116A (en) * 2010-06-13 2010-11-10 中兴通讯股份有限公司 Implementation method of audio transmission and mobile terminal
CN106537929A (en) * 2014-05-28 2017-03-22 弗劳恩霍夫应用研究促进协会 Data processor and transfer of user control data to audio decoder and renderer

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1635438A (en) * 2003-12-31 2005-07-06 深圳市朗科科技有限公司 Data processing equipment
CN101882116A (en) * 2010-06-13 2010-11-10 中兴通讯股份有限公司 Implementation method of audio transmission and mobile terminal
CN106537929A (en) * 2014-05-28 2017-03-22 弗劳恩霍夫应用研究促进协会 Data processor and transfer of user control data to audio decoder and renderer

Similar Documents

Publication Publication Date Title
US20210064560A1 (en) Burning apparatus and system
CN107993206A (en) A kind of information processing method and Related product
CN109669729A (en) A kind of starting bootstrap technique of processor
CN101742113A (en) Image sensor controlling device and controlling method
US20250306953A1 (en) Port configuration method, component, and hard disk expansion apparatus
CN105653283A (en) Embedded system terminal and boot LOGO picture displaying and changing method thereof
CN105578184A (en) Key-frame animation generation apparatus and method
CN103914416A (en) Regulating direct memory access descriptor execution
CN105049781A (en) Image processing system based on Field Programmable Gate Array (FPGA)
CN115359763A (en) Ink screen display control method, device, equipment and storage medium
CN117112466A (en) A data processing method, device, equipment, storage medium and distributed cluster
CN103559910A (en) System and method applied in programming unit to realize intelligent switching of programmed chip timing
CN104834619A (en) I2C (Inter-Integrated Circuit) bus circuit, implementation method and electronic equipment
CN111061659A (en) A kind of bus switching method and related device
CN104714914A (en) Initial configuration method of mobile industry processor interface (MIPI) liquid crystal module
CN102043638A (en) Computer system and computer startup setting method
CN110795369B (en) Method and terminal for realizing MDIO slave function based on GPIO pin
CN205721745U (en) Embedded with bluetooth firmware upgrade circuit, device and digital handset
CN111752623B (en) Display configuration method, device, electronic equipment and readable storage medium
CN110413253A (en) Audio device control method and device, audio frequency apparatus and storage medium
CN101807162B (en) Method for reducing module coupling degree of embedded software system and embedded software system
CN103902298A (en) Instruction set firmware recovery state information setting method and device
CN109739610A (en) Screenshot control method, device, electronic device, and computer-readable storage medium
EP3779635B1 (en) Interactive smart tablet and data processing method and device thereof
CN113076093B (en) Power monitoring system configuration method and device and terminal

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20191105

RJ01 Rejection of invention patent application after publication