You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! Thank you for the great library! I was looking for a typescript audio feature analysis for a while and.. 馃殌鈿★笍馃挜
Sorry this is my first question and it might be dumb and born out of lack of examples.
I'm in typescript, and I'd like to understand how to retrive one single feature without casting.
typeState={energy: null|number}conststate: State={energy: null}// ... down into retrieve audio featuresstate.energy=meydaAnalyzer.get('energy')// ERROR HERE
I get the error:
Type 'Partial<MeydaFeaturesObject>' is not assignable to type 'number'.
I'm solving it with brutal casting:
state.energy=meydaAnalyzer.get('energy')asnumber
I don't have any specific settings and this error seems to be quite general and linked to a too miuch flexible .get typings, but I'm sure you have a better solution.
Enviroment:
For completeness this is my setup (I don't think it is important but, you know...):
I've actually been working on a PR for this - it's not ready at the moment and the complexity make me think maybe it's not the right thing to merge for maintainability reasons. I would love feedback on the design described here though!
For now, I would suggest writing a user defined type guard function.
Question:
Hi!
Thank you for the great library! I was looking for a typescript audio feature analysis for a while and.. 馃殌鈿★笍馃挜
Sorry this is my first question and it might be dumb and born out of lack of examples.
I'm in typescript, and I'd like to understand how to retrive one single feature without casting.
I get the error:
I'm solving it with brutal casting:
I don't have any specific settings and this error seems to be quite general and linked to a too miuch flexible
.gettypings, but I'm sure you have a better solution.Enviroment:
For completeness this is my setup (I don't think it is important but, you know...):
versions:
and my tsconfig.json:
The text was updated successfully, but these errors were encountered: