Is it possible to disable all audio processing with the API provided by libjingle?
I'm trying to set media constraints for an audio stream using the libjingle_peerconnection CocoaPod on OS X. These are constraints that would normally be passed to getUserMedia() in JavaScript. My goal is to set several parameters to false to essentially disable all audio processing.
let audioPairs = [
RTCPair(key: "echoCancellation", value: "false"),
RTCPair(key: "googEchoCancellation", value: "false"),
RTCPair(key: "googEchoCancellation2", value: "false"),
RTCPair(key: "googAutoGainControl", value: "false"),
RTCPair(key: "googAutoGainControl2", value: "false"),
RTCPair(key: "googNoiseSuppression", value: "false"),
RTCPair(key: "googHighpassFilter", value: "false"),
RTCPair(key: "googTypingNoiseDetection", value: "false"),
RTCPair(key: "googAudioMirroring", value: "false")
]
let audioConstraints = RTCMediaConstraints(mandatoryConstraints: [RTCPair](), optionalConstraints: audioPairs)
I tried:
Passing the constraints into RTCPeerConnectionFactory.peerConnectionWithICEServers(_, constraints, delegate)
Passing the constraints into RTCPeerConnection.createAnswerWithDelegate(_, constraints)
However, none of the constraints are being honored. Audio processing still occurs. Making the constraints mandatory causes failures during the answer/offer handshake (since they are not allowed as mandatory parameters).
I feel like I should be passing these constraints into something like RTCPeerConnectionFactory.mediaStreamWithLabel(_) or RTCPeerConnectionFactory.audioTrackWithID(_), but there is no API for passing in constraints at this point. There was once a method called RTCPeerConnection.addStream(_, constraints), but the constraints arguments has been removed.
Related
I'd like to represent the following json by Pydantic model:
{
"sip" {
"param1": 1
}
"param2": 2
...
}
Means json may contain sip field and some other field, any number any names, so I'd like to have model which have sip:Optional[dict] field and some kind of "rest", which will be correctly parsed from/serialized to json. Is it possible?
Maybe you are looking for the extra model config:
extra
whether to ignore, allow, or forbid extra attributes during model initialization. Accepts the string values of 'ignore', 'allow', or 'forbid', or values of the Extra enum (default: Extra.ignore). 'forbid' will cause validation to fail if extra attributes are included, 'ignore' will silently ignore any extra attributes, and 'allow' will assign the attributes to the model.
Example:
from typing import Any, Dict, Optional
import pydantic
class Foo(pydantic.BaseModel):
sip: Optional[Dict[Any, Any]]
class Config:
extra = pydantic.Extra.allow
foo = Foo.parse_raw(
"""
{
"sip": {
"param1": 1
},
"param2": 2
}
"""
)
print(repr(foo))
print(foo.json())
Output:
Foo(sip={'param1': 1}, param2=2)
{"sip": {"param1": 1}, "param2": 2}
I have a collection of documents that follow this schema {label: String, status: Number}.
I want to introduce a new field, deleted_at: Date that will hold information if a document has already been deleted. Seems like a perfect use case for an index, to be able to search for all undeleted tasks.
CreateIndex({
name: "activeTasks",
source: Collection("tasks"),
terms: [
{ field: ["data", "deleted_at"] }
]
})
And then filter by undefined / null value in shell:
Paginate(Match(Index("activeTasks"), null))
Paginate(Match(Index("activeTasks"), undefined))
It returns nothing, even for documents where I explicitly set deleted_at to null.
That's not my point, though. I want to get documents that do not have the deleted_at defined at all, so that I do not have to update the whole collection.
PS. When I add document where deleted: "test" and query for it, the shell does return the expected result.
What do I don't get?
The reason is because FaunaDB doesn't support reading empty/null value the way you think it does. You need to use a special Bindings to do that.
Make sure to check out https://docs.fauna.com/fauna/current/tutorials/indexes/bindings.html#empty for a more thorough explanation and examples.
My understanding of how bindings work would yield the following code. I haven't tested it though and I'm not sure it works.
You need a special binding index:
CreateIndex({
name: "activeTasks",
source: [{
collection: Collection("tasks"),
fields: {
null_deleted_at: Query(
Lambda(
"doc",
Equals(Select(["data", "deleted_at"], Var("doc"), null), null)
)
)
}
}],
terms: [ {binding: "null_deleted_at"} ],
})
Usage:
Map(
Paginate(Match(Index("activeTasks"), true)),
Lambda("X", Get(Var("X")))
)
How do I do a query filtered by attributes in a child object in Realm React Native
Here's my (simplified) schema.
Habit.schema = {
name: 'Habit',
primaryKey: 'id',
properties: {
id: 'int',
name: 'string',
intervals: {type:'list', objectType: 'Interval'}
}
}
Interval.schema = {
name: 'Interval',
primaryKey: 'id',
properties: {
id: 'int',
intervalStart: 'date',
intervalEnd: 'date',
allComplete: 'bool',
}
}
I tried doing:
let filteredHabits = realm.objects('Habit').filtered('intervals.intervalStart < $0 AND intervals.intervalEnd > $0 AND intervals.allComplete == false', new Date());
But what this seems to be doing is going through all of the of the intervals with all of the habits, and as long as one of the intervals start before the current time and another interval ends before the current time, it will miss the filter.
What I'd like to do is a query based on the very LAST interval in the list. If I can't do that, is there a way to make sure that it's comparing the attributes of just a single interval, and not all of them?
The predicate language used by Realm for React Native does not yet directly support the type of query you're after. I'd encourage you to file a feature request asking for it. In the mean time, you can work around this limitation by performing the filtering in JavaScript.
I'm using a FilteringSelect that use an FilteringSelect as store.
I want to ignore the accented characters that users can enter, and to return all the elements with or without accents. But i don't know what event i have to catch.
Here's my code :
var ccppMemory = new dojo.store.FilteringSelect({
data: centrosPoblado,
idProperty: "id"
});
sboMunicipio = new dijit.form.FilteringSelect({
id: "soMunicipioSelect",
hasDownArrow: false,
placeholder: i18n.tools.searches.ordinary.departmentTown,
store: ccppMemory,
searchAttr: "unitario",
intermediateChanges : true,
queryExpr: "*${0}*",
autoComplete: false,
highlightMatch: "all",
style:"margin-right:5px;width:170px;"
}, "soMunicipioSelect");
sboMunicipio.startup();
To explain better, centrosPoblado is an array that i populate as :
centrosPoblado.push({
id: value.attributes.CODIGO_DANE,
label: value.attributes.NOMBRE_CENTRO_POBLADO,
unitario: value.attributes.DEPTO + " / " + value.attributes.NOMBRE_CENTRO_POBLADO
});
In 'unitario' i have store strings like 'Medellín', ' Bogotá', ....
What i want is that when a user enter medellín, the filterselect ignore and returns 'Medellín' . So what i think i have to do it's to substitute medellin for something like m[eé]d[eé]ll[íi]n, but i don't know where.
Thanks
if anyone is interested, here is the answer :
http://dojo-toolkit.33424.n3.nabble.com/FilteringSelect-avoid-Accented-characters-td4004099.html
You have to overwrite the 'queryEngine' of the Memory that its linked to the FilteringSelect
I'm trying to query for user stories whose release start date is greater than a particular date. Is it possible to do this using the "filters" config rather than querying all stories and then checking manually?
Is this valid? :
Ext.create('Rally.data.WsapiDataStore', {
model: 'UserStory',
context: {
project: '/project/xxxx'
},
autoLoad: true,
fetch: ['Rank', 'FormattedID', 'Release'],
filters: [
{
property: 'Release.ReleaseStartDate',
operator: '>',
value: '2012-10-10'
}
]
});
It doesn't work, just fetches all records.
The code posted above does work. I was actually using a comboBox value in the "value" property. Turns out I didn't convert it to a proper DateTime format and hence the comparison was failing and returning all records.
In my case I had to use Rally.util.DateTime.toIsoString in order to compare the value in the combobox.