Microsoft Azure Speech Service - Can I use a USB headset instead of an a recommended microphone array in conversation transcription in real-time mode - speech-to-text

I am trying to use ConversationTranscriber.StartTranscribingAsync() API. in realtime transcription mode using my USB headset. I am not sure how to supply the microphone information. I have tried AudioConfig.FromDefaultSpeakerOutput() as well as AudioConfig.FromMicrophoneInput(). Out of trials, sometimes program exits with access violation. Other times, I have also seen error "SPXERR_RUNTIME_ERROR" with various combination of supplied microphone configuration.
Thanks,

Related

Interacting with BLE Cycle Trainer

My current is on Flutter using Dart and working with Bluetooth low energy devices. I have the basics up using this library and am able to do the following
1. Search for devices and list
2. Connect to device
3. Retrieve services and read characteristic values
4. Subscribe to changes on characteristics.
In order to interact with device correctly I need to read and write from the correct services/characteristics to read data and set things like resistance on the flywheel
I have used the below link and have started mapping out the services, however although the reading can be worked out. The writing to characteristics is a bit out of my reach.
https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.service.cycling_power.xml
The question is.
Does any have experience working BLE cycle trainers and could provide
some insight into how to read and manage services and characteristics
appropriately?

Progressive web app beacon search

Is it possible to search for beacon data (uuid, url, ...) with a progressive web application using just web technologies that is without using native mobile technologies (Android, ios, ...)?
Thanks in advance.
Unfortunately, this is not possible as of July 2020. While Google has been working on the WebBluetooth project to bring support for many bluetooth operations to the browser, at least in Google Chrome implementations on Android 6+, Mac or ChromeOS.
Scanning for beacons is not yet possible as of this writing. The API requires that the OS scan for devices matching a requested criteria, and then let the user choose a device to connect to using a user interface. This essentially rules out beacon detection.
Bluetooth scanning APIs are still in draft form here.
EDIT: The APIs mentioned by #zurfyx in the answer below allow you to scan for and connect to an advertised GATT service, but do not allow you to read the data in the advertisement. This is a critical distinction, as reading the data in the advertisement is the key capability required for actual bluetooth beacon detection. That capability is missing from that API. Without that capability, it is impossible to detect a beacon, it is only possible to connect to a BLE device that might be an Eddystone or other service advertisement-based beacon.
UPDATE July 2020: Safari will not be getting any WebBluetooth APIs at all due to privacy concerns, according to a June 2020 announcement by Apple This makes Bluetooth scanning impossible on iOS we apps for the foreseeable future.
As of July 2020, Chrome does not support scanning arbitrary advertisements. See status here: https://github.com/WebBluetoothCG/web-bluetooth/blob/master/implementation-status.md
Disclaimer: I wrote eddystone-web-bluetooth (a library which makes it easy to read and write to an Eddystone device). github#eddystone-web-bluetooth npm#eddystone-web-bluetooth
It is possible to scan for Bluetooth devices by using the Web Bluetooth API (currently supported only by Chrome).
By using Bluetooth GATT service, you can connect to Eddystone devices and send/receive data by communicating following their public specifications (which are basically a list of request codes, and the format in which to send and expect their responses).
These services include information such as:
URL
Advertising interval
Lock state
and more
By using the Bluetooth standard information you can get to know the most generic device information, such as its id and name:
navigator.bluetooth.requestDevice
#beaufortfrancois wrote the probably first Eddystone Web Bluetooth configuration code (source code / demo), so it is probably worth a read if you want to dig more into this. I learned a lot from it.

How to make A2DP and HSP work simultaneously

I have a bluetooth headset. When connecting it to Windows 10, it installs two profiles in Playback devices list:
Hands-Free. (HSP profile)
Stereo. (A2DP profile)
The Second one (Stereo) is set to be the "Default Device" and the "Default Communication Device" on the system.
When I start any program that uses the mic (recorder, chat, VoIP Calls, gaming, etc.) The sound suddenly stops working And I can only use the mic until I stop the recorder or the call.
To enable the sound again I need to make the Hands-Free (HSP) profile handle both input and output (sound and mic). Unfortunately, HSP gives really poor sound quality.
I want to know If there is a way, using code, I can change Bluetooth behavior so the two profiles work simultaneously. One handles the sound and one handles the mic so I can have high quality sound and use the mic at the same time.
You will probably never find a solution. I had the same problem (I was trying to create a walkie talkie with 2 headsets connected to the same smartphone).
On Windows (but also on Android) you can't access directly to a BT-microphone or BT-speaker because it is automatically detected as BT headset and the OS take the control of the device.
Your app can then access the OS-device and not directly the hardware device. The only OS able to do that was Symbian I think which had the most BT-protocols. On Windows you will probably never be able to do that and on Android you have to write your own A2DP-protocol if you want to access the device directly without OS interference.
So sad...
Luckily, under windows you can define different devices for communications and sound.
So, you have two choices:
Choosing Hands-free for both mic/speaker only for communication (which will switch back to A2DP after the call/teams).
Choosing another mic for communication which allow you to still use the speaker profile even in communication.
That is a bluetooth restriction : A2DP (high quality audio) cannot be use simultaneously with HFP (hands-free profile)

Bluetooth data to HID for BLED112

We have bought BLED112 to interface our target via BT.
An android app interacting with target via BT & USB (HID).
We have used some Bluetooth communication to write a program and send data to dongle.
Now can somebody here having any experince in converting that BT data to a HID signal.
Have anybody tried that?
Is there any BGScript code which we need to write to achieve that?
Please let me know if the thought is completely wrong.
Referring to a comment above which states,
We are writing an Android App which can send data to BLED112 over BLE interface or GATT. My question is how can I convert that data (basically a command) to an HID (key event), correct me if my understanding is wrong?
If I understand the use-case correctly, I think, in the initial stages of the development, you will need to use the BLE-GUI utility that BlueGiga provides.
With that utility you can see the communication between the BLED112 Dongle and the BLE112 Module. BLED112 shall be simulating what the android app would do?
First, you will need to know the GATT structure stored in BLED112 to write to or read from the BLED112.
Secondly, the way BLE112 works is an event-based implementation. Going through the API reference document for BLE112 shall help you understand the events generation conditions and codes that are generated modified when a characteristic value is updated by the android application, or read by android application. You get events for connection, disconnection, read from, write to, notification enabled for, indication enabled for, etc.
On the BLE112 side, depending upon what service and what characteristics in that service is going to be used for data transfer between Client (Android App) and Server (BLE112), you need to write suitable implementation in event callback handlers.
There is a standard service called Human Interface Device which has a reserved UUID: 0x1812.
Once you configure your BLE112 as a HID over GATT device, your android app shall see a service with UUID: 0x1812. Parse the service descriptor and get the characteristics bundled up into the service. You can read from or write to that service depending upon access parameters set in gatt.xml
As an example, say, if it is a Keyboard, you can send the scancode for (make and break) of the key depending upon what key is pressed. How to get a scancode is out of the scope of this question anyway, and sadly I had worked on PS2 keyboards, so I don't really know how to get the scancode from a USB keyboard.
So, you have the scancode for the key pressed, and you know the characteristics to write that into. Write it, the application should enable the Notifications for that characteristics, so that it is notified whenever the key is pressed and value is written into the characteristics. To let application enable notifications or indications for the characteristics, study the developer guide that talks about how to write a gatt.xml for Bluegiga-based BLE devices. I'll give you a hint: in xml, in the characteristics configuration you have to write notify="true".
About parsing of the service and characteristics in Android, Unfortunately I am not an android developer, but an embedded developer, I know how the BLE112 module part is to be implemented, while I have no insight of how android parses the data. But, there are plenty of question and discussions about it online, which you might understand better than me since you have an android background.

Play audio as microphone input

I am to test voice recognition programs. Some which I have access to the code and others where I don't.
Sadly my (beautiful) voice is not perfect, so when I am reading a text it sounds slightly different each time. Which makes the testing difficult and time consuming. Giving that I can tweak a lot of parameters.
So I was wondering if there was a way to record my own voice (already done). And then play it as normal microphone input so the voice recognition program I am testing will see it as microphone input.
This would also help greatly if it could be done programatically in C#. So I can in my own code specify when to play what.
To play it from speakers and have the voice recognition programs listen to the microphone is not an option, because it is not the same sound on different computers/speakers/microphones.
Thanks.
Edit:
What i have found so far is to use a software sound Card simulator. But I haven't been able to find a suitable one.
Just as there are printer drivers that do not connect to a printer at all but rather write to a PDF file, analogously there are virtual audio drivers available that do not connect to a physical microphone at all but can pipe input from other sources such as files or other programs.
I hope I'm not breaking any rules by recommending free/donation software, but VB-Audio Virtual Cable should let you create a pair of virtual input and output audio devices. Then you could play an MP3 into the virtual output device and then set the virtual input device as your "microphone". In theory I think that should work.
If all else fails, you could always roll your own virtual audio driver. Microsoft provides some sample code but unfortunately it is not applicable to the older Windows XP audio model. There is probably sample code available for XP too.

Resources