How can I specify a custom wakeword name (eg "stack overflow" or "party time") in the spokestack-android configuration? I'm looking for something like:
SpeechPipeline pipeline = new SpeechPipeline.Builder()
.setProperty("wakeword", "stack overflow")
//...
.build();
Update: You can train your own wakeword (without writing code, just providing audio samples) with a Maker subscription. When they're finished training, you can download and configure the custom wake word the same way you set up the default wake word.
Currently, Spokestack Android only supports wakeword detection via a binary classifier, so we only recognize "Spokestack". In theory, this could be done via Android's platform ASR, with the caveat that the user would constantly be interrupted by Google Assistant-style audible dings as the ASR request times out and gets restarted, so it'd only be useful for informal demos, not real apps.
That said, it's theoretically possible, so feel free to open an issue, and it might show up in a future version if we get enough demand for it.
Related
I'm creating an app and its mainly depends on the battery notification which we receive when our battery level is low like 15%. However I know how to get the battery level, but I thought what if there is a way to use the existing notification based on which we can add features.
Please help.
There is a battery low broadcast that you can use, check out the documentation (scroll to "Monitor Significant Changes in Battery Level")
There is no "existing notification", insofar as the thousands of Android device models can do whatever they want when the battery is low. Not all will raise a Notification.
For those that do raise a Notification, there is nothing for you to "use":
A Notification is a Java object; your app cannot access Java objects from other processes
A Notification is configured by a variety of pieces of data; you have no idea what an individual device will use
You are certainly welcome to putter around the AOSP and see exactly what is used for low-battery indications in "stock" Android. Just bear in mind that what you find there is not going to be used on all Android devices and none of it will be part of the Android SDK (other than the generic Notification API).
I wrote a DMR for android with the open source project CyberLink4Java. Test it with tools that DLNA group released (Golden DMC & Gloden DMS). I create a Device with proper description file. Now it can push play.
But it don't support control by the DMC.
On the DMC UI, the control buttons(play, pause and stop) are grey.
There must be some data exchange to tell the DMC that it support these controls during the DMR service start. But I can't find in the spec. Any idea on what's wrong?
The way to expose transport-controlling actions that are valid at a given time is the CurrentTransportActions state variable and the corresponding method GetCurrentTransportActions. These features are optional but conditionally required so if you implement one you need to implement both. CurrentTransportActions is like most variables in AVTransport: it's not evented on its own but value changes will be included in LastChange events. This is all documented in AVTransport service definition.
That said, mostly a DMC can figure out the valid actions based on DMR state even if the above features aren't supported: e.g. if AVTransportURI is empty, showing playback controls doesn't make sense.
in an android application :
Is there an interface defined in android to support this query ?
I've searched a lot on this, but was unable to find more info.
This seems like a fairly reasonable query(provided user permission is granted)
Not possible do to many restrictions - if you were to write an application that managed the user channel changes then you could access the Channel Lineup on the GTV and then it would be possible to know what channel they are on. If however you want to just arbitrarily know what the user has currently tuned to this is not possible - mainly because the user could have used their cable box remote to change the channel and as such the data is not available to the GTV unit.
CONTEXT: My application is sending sentences to whatever TTS engine the user has. Sentences are user-generated and may contain punctuation.
PROBLEM: Some users report that the punctuation is read aloud (TTS says "comma" etc) on SVOX, Loquendo and possibly others.
QUESTION:
Should I strip all punctuation?
Should I transform the punctuation using this kind of API?
Should I let the TTS engine deal with the punctuation?
The same user that sees the problem with Loquendo, does not have this problem with another Android application called FBReader. So I guess the 3rd option is not the right thing to do.
I had the same problem with one of my apps.
The input string was:
Next alarm in 10 minutes,it will be 2:45 pm
and the TTS engine would say:
Next alarm in 10 minutes comma it will be 2:45 pm.
The problem was fixed just by adding a space after the comma like this:
Next alarm in 10 minutes, it will be 2:45 pm
This is a stupid mistake, and maybe your problem is more complicated than that, but it worked for me. :)
So, you're worried about what back-alley-acquired text-to-speech engine the user might happen to have selected as their default... presumably because you don't want your app to look bad due to this engine's unknown/bad behavior. Understandable.
The (good) fact is, though, that the TTS's behavior is not actually your responsibility unless you decide to embed an engine in the app itself (Difficulty: Hard, Recommended? No).
Engines can and should be presumed to adhere to Android rules and behaviors dictated here... and presumed to supply their own sufficient set of configuration options in the Android system settings (home\settings\language&locale\TTS) which may or may not include pronunciation options. The user should also be presumed intelligent enough to install an engine that they are satisfied with.
It is a slippery slope to take on the job of anticipating and "correcting" for unknown and unwanted engine behaviors (at least in engines that you haven't tested yourself).
A SIMPLE AND GOOD OPTION (Difficulty: Easy):
Make a setting in your app: "ignore punctuation."
A BETTER OPTION (Difficulty: Medium):
Do the above, but only show the "ignore punctuation" setting-option if the engine you have detected on the user's device is prone to this issue.
Also, one thing to note is that there are many, many differences between engines (whether they use embedded voices vs online, response time, initialization time, reliability/adherence to Android specs, behavior across Android API levels, behavior across their own version history, the quality of voices, not to mention language capability)... differences that may be even more important to users than whether or not punctuation is pronounced.
You say "My application is sending sentences to whatever TTS engine the user has." Well... "That's yer problem right there." Why not give the user a choice on what engine to use?
And leads us to...
AN EVEN BETTER OPTION (Difficulty: Hard and Good! [in my humble opinion]):
Decide on some "known-good" engines your app will "support," starting with Google and Samsung. I would guess that there are less than 5% of devices out there these days that don't have either of those engines on them.
Study and test these engines as much as possible across all Android API levels that you plan to support... at least in as far as whether they pronounce punctuation or not.
Over time, test more engines if you like, and add them to your supported engines in subsequent app updates.
Run an algorithm when your app starts that detects which engines are installed, then use that info against your own list of supported engines:
private ArrayList<String> whatEnginesAreInstalled(Context context) {
final Intent ttsIntent = new Intent();
ttsIntent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);
final PackageManager pm = context.getPackageManager();
final List<ResolveInfo> list = pm.queryIntentActivities(ttsIntent, PackageManager.GET_META_DATA);
ArrayList<String> installedEngineNames = new ArrayList<>();
for (ResolveInfo r : list) {
String engineName = r.activityInfo.applicationInfo.packageName;
installedEngineNames.add(engineName);
// just logging the version number out of interest
String version = "null";
try {
version = pm.getPackageInfo(engineName,
PackageManager.GET_META_DATA).versionName;
} catch (Exception e) {
Log.i("XXX", "try catch error");
}
Log.i("XXX", "we found an engine: " + engineName);
Log.i("XXX", "version: " + version);
}
return installedEngineNames;
}
In your app's settings, present all engines that you've decided to support as options (even if not currently installed). This could be a simple group of RadioButtons with titles corresponding to the different engine names. If the user selects one that isn't installed, notify them of that and give them the option of installing it with an intent.
Save the user's selected engine name (String) in SharedPreferences, and use their selection as the last argument of the TextToSpeech constructor any time you need a TTS in your app.
If the user has some weird engine installed, present it as a choice also, even if it is unrecognized/unsupported, but inform them that they have selected an unknown/untested engine.
If the user selects an engine that is supported but is known to pronounce punctuation (bad), then upon selection of that engine, have an alert dialog pop up warning the user about that, explaining that they can turn this bad behavior off with the "ignore punctuation" setting referred to already.
SIDE-NOTES:
Don't let the SVOX/PICO (emulator) engine get you too worried -- it has many flaws and is not even designed or guaranteed to run on Android above API ~20, but is still included on emulators images up to API ~24, resulting in "unpredictable results" that don't actually reflect reality. I have yet to see this engine on any real hardware device made within the last seven years or so.
Since you say that "sentences are user generated," I would be more worried about solving the problem of what language they are going to be typing in! I'll look out for a question on that! :)
I'd like to create an app that allow you to filter incoming call to various answering message with :
"this number is not available" for black listed phone numbers
A formal message for strangers
A informative message about what your doing for friends
I don't know how you can get automatically a call, play a recorded message then wait for the answer and record it. Or maybe there is just a way to interact with the actual answering system so I just have to plugin.
Any clue strongly appreciated. A human sacrifice for any code snippet :-)
Access to the internal telephony is not possible or planned for future releases of Android:
http://groups.google.com/group/android-developers/browse_thread/thread/e8904c82a2c4a333
This would present a security risk as app developers could intercept and hijack sensitive calls (eg. telephone banking)
This is not possible on the tmobile G1 at this time. There is no way for an android SDK application to access the call input or output on this hardware/firmware combination.
http://groups.google.com/group/android-developers/browse_thread/thread/d04c307973345fef/a628e578900b3dce?lnk=gst&q=dave+sparks+play+audio#a628e578900b3dce
and
http://groups.google.com/group/android-developers/browse_thread/thread/185e33a3f420d1ac/e14e1dc84bb6dd24?lnk=gst&q=play+sound+call#e14e1dc84bb6dd24
I'm not sure this answers the question, but it is somewhat related I think.
You can install Ultimate Voice Recorder which can record your conversations (very useful when calling customer 'service'). Since it can record it, it must have some way to access the conversation.
Also, the capabilities you have to give the app are quite scary (translated from dutch: full internet access, intercept outgoing calls, change preferences, call phone numbers directly, record audio/take pictures, update contacts, auto startup). It seems to me there must be something in there that can help you?
However, I don't think it can inject audio into the stream. The symbian version had an option to insert beeps into the conversation, but I don't think the android version has it.
http://www.fingertip-access.com/
I have found out att for this use of your Phone Android or ISO, so far they ar decades behinde symbian and an inferior alternativ sadly, if you don't install a custom kernel/jailbreak it's not possible to record incoming calls and screen them. "Ultimate Voice Record ned you to use the phone in speaker mode."
it is possible to record voice calls with automatic answer. An update on this issue would be very helpful...
It is possible to have a resource that answers the calls. Enter a message and record the call. And together don't activate the microphone...
In short, an answering machine...