getting speech volume ?

Home Forums OpenEars getting speech volume ?

Viewing 8 posts - 1 through 8 (of 8 total)

  • Author
    Posts
  • #1015734
    developer82
    Participant

    Hi,

    I was wondering if there’s a way to get the speech volume. What I mean is a measurement of how loud the user spoke (was he speaking, speaking louder, or shouting?).

    Is this possible?

    Thanks

    #1015735
    Halle Winkler
    Politepix

    Hello,

    You can get the incoming speech power using the result of the method pocketsphinxInputLevel (you have to listen to this value on a background thread since it will block the main thread if you don’t — there is an example of doing this in the sample app). Knowing what this power level means in terms of speaking/loud speaking/shouting is a subjective interpretation, so deciding what different power levels mean in those terms is an implementation detail for your app.

    #1015736
    developer82
    Participant

    Thanks :-)
    Will definitely check it out.
    is there a mix-max values to this parameter?

    #1015737
    Halle Winkler
    Politepix

    Not as such — it attempts to approximate the negative decibel offset range that an AudioQueue can return, but it doesn’t guarantee it. The range should be a float that goes from some negative value (something like -74) up to zero, where zero is the maximum.

    #1027098
    evilliam
    Participant

    @Halle – in the example it’s running from an NSTimer – doesn’t this mean it’s running on the main runloop?
    If not – does running this check on a background thread mean I might not have a very accurate impression of how loudly a particular word is being said?

    I was hoping to be able to use a high-pass filter to figure out if someone was speaking loudly on a certain word.

    Thanks for making this library, I’m really enjoying playing with it.
    Cheers
    Liam

    #1027099
    Halle Winkler
    Politepix

    Welcome Liam,

    The example shown should give an accurate impression of the current volume within the normal latency offset.

    #1027100
    Halle Winkler
    Politepix

    IMO the example as well as the volume API internals are both overdue for an update, but that aspect of the library is pretty road-tested at this point so I think that you can use it. But keep in mind that it isn’t an objective volume reading, it is relative to the constant used and not intended to give an exact decibel reading since it was designed for UI design.

    #1027101
    evilliam
    Participant

    Understood, thanks Halle.

    I think that if I check for volume each time a word is detected (regardless of a match), and use a high-pass filter I can detect for fluctuations in volume on a per-word basis. (I think)

    Thanks again

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.