#### Howdy, Stranger!

We are about to switch to a new forum software. Until then we have removed the registration on this forum.

# Minim: how does this library measure volume? What's the range, and what are the measuring units?

edited November 2013

Hi there!

I've searched high and low, but can't figure this out. My friend and I are trying to build a program that reads input from a microphone, and tweets at certain intervals. The problem? Most ambient noises register between a 0 and 1 volume reading--you have to be extremely loud to get it above there. The highest number we've gotten is 21, so we're thinking that the range could be 0 to 25.

This leaves us with some questions:

1. How does minim measure volume--what are the measuring units and range?

2. Further: how would I map these units from their limited 0 to 25 range to a wider range, 0 to 100, so we can capture more detail?

3. If we do successfully map it, how do we then plug that float into our averaging equation for volume?

Here's our code:

``````volume = abs(int(in.right.get(1)*mult));
float volumeConverted = map(volume,0,25,0,100); <--this isn't working, because the averaging equation that we have won't read it

// volumeConverted = volumeC <--tried this conversion as a workaround for the float issue, but it didn't seem to work at all

readings[index] = volumeConverted; <-- this isn't working, can't plug in float
``````

Thank you so much!

Tagged:

`readings[index] = (int)volumeConverted;`