This discussion is archived
1 2 Previous Next 28 Replies Latest reply: Mar 10, 2011 10:46 PM by 845125 RSS

can JSAPI work to get count the decibel from voices?

845125 Newbie
Currently Being Moderated
Hi all, I am new here and also to Java..

I am currently working on a program to count the decibel value of a human voice.

I have the idea to get the waveform then count the decibel. But I am now confused in how to get the waveform.
what I want to know now is, can JSAPI do it and how? If not, then any suggestion of how to get it?

Thank you very much.

Good day.

Edited by: 842122 on Mar 6, 2011 2:33 PM
  • 1. Re: can JSAPI work to get count the decibel from voices? - urgent-
    796440 Guru
    Currently Being Moderated
    Don't mark your question as urgent. It is 100% guaranteed not to get you help any faster. If it has any effect at all, it will be to delay help as a result of irritating those whose help you seek.
  • 2. Re: can JSAPI work to get count the decibel from voices? - urgent-
    793415 Pro
    Currently Being Moderated
    I was going to offer some tips, but (checks watch) it is 20 minutes 'too late'.

    OP: Never mind.
  • 3. Re: can JSAPI work to get count the decibel from voices? - urgent-
    EJP Guru
    Currently Being Moderated
    You're on the wrong track. You don't need JSAPI to acquire or measure the amplitude of a waveform.
  • 4. Re: can JSAPI work to get count the decibel from voices?
    845125 Newbie
    Currently Being Moderated
    am I on the wrong track? so how to get the waveform then? by how?

    thank you very much

    PS: I have changed the title. I am sorry for put the word urgent in it. Thanks for the suggestion.

    Good Day

    Edited by: 842122 on Mar 6, 2011 2:39 PM
  • 5. Re: can JSAPI work to get count the decibel from voices?
    793415 Pro
    Currently Being Moderated
    842122 wrote:
    ..I have the idea to get the waveform then count the decibel. But I am now confused in how to get the waveform.
    Decibels are meaningless except to an observer. The number of dB coming from my PC at this instant, to my ear, depends on.
    <ul>
    <li>How close I am to the speakers.
    <li>The inherent power/quality of the amp. & speakers.
    <li>The volume of the:
    <ul>
    <li>Creative sound system
    <li>PC
    <li>Sound playback software
    </ul>
    <li>The inherent power of the sound signal at that instant.
    </ul>

    There are other measures of power though. One that is typically used for harmonic signals is the RMS (Google it). It is based purely on the size of the samples and the format of the sound so can be calculated for a sound wave inside a machine.
    what I want to know now is, can JSAPI do it and how?
    As EJP mentioned, the JSAPI is not needed for this task.
    If not, then any suggestion of how to get it?
    The JavaSound API provides classes and methods to get access to to information coming through the PC's sound lines. See the Sampled Sound API of Java Sound for details.
    am I on the wrong track? so how to get the waveform then? by how?

    thank you very much

    PS: I have changed the title. I am sorry for put the word urgent in it. Thanks for the suggestion.
    Good call on changing that title. Another tip is to add a single upper case letter to the start of every sentence. This helps the reader, and you would not want to make it harder for the reader, would you?
  • 6. Re: can JSAPI work to get count the decibel from voices?
    EJP Guru
    Currently Being Moderated
    With respect, (a) decibels are not dependent on the observer: they are a measured ratio ref. some baseline, of which there are several internationally accepted standards for volume measurement; (b) RMS is a way of measuring voltage, not power; (c) power only has a meaning ref. some load impedance. You are talking about SPL which is another kettle of fish entirely, depending on distance, transducer efficiency, etc. I don't see the relevance of any of this. The OP wants to measure probably dBm of a .wav file. Nothing to do with ears, distance, etc whatsoever.
  • 7. Re: can JSAPI work to get count the decibel from voices?
    845125 Newbie
    Currently Being Moderated
    EJP wrote:
    With respect, (a) decibels are not dependent on the observer: they are a measured ratio ref. some baseline, of which there are several internationally accepted standards for volume measurement; (b) RMS is a way of measuring voltage, not power; (c) power only has a meaning ref. some load impedance. You are talking about SPL which is another kettle of fish entirely, depending on distance, transducer efficiency, etc. I don't see the relevance of any of this. The OP wants to measure probably dBm of a .wav file. Nothing to do with ears, distance, etc whatsoever.
    Hi EJP..
    From my idea, is yes, the OP want to know the dB of a .wav file. Because, the voice that recorded is saved as a .wav file. Now, I am sort kind of confused in how to measure the dB.

    I think I have to get the waveform first then count it. The problem is, how can I get the waveform then count the dB?
    Andrew Thompson wrote:
    The JavaSound API provides classes and methods to get access to to information coming through the PC's sound lines. See the Sampled Sound API of Java Sound for details.
    Maybe I learned wrong. But, so far, the sampled method are to convert, mix, write, and read. I don't understand which method we use to get the dB.
    Good call on changing that title. Another tip is to add a single upper case letter to the start of every sentence. This helps the reader, and you would not want to make it harder for the reader, would you?
    I am so sorry and thank you for the suggestion. I am trying to write my reply more organize. So sorry for my English.


    Thank you..

    Good day

    Edited by: 842122 on Mar 7, 2011 8:44 AM
  • 8. Re: can JSAPI work to get count the decibel from voices?
    793415 Pro
    Currently Being Moderated
    842122 wrote:
    EJP wrote:
    With respect, (a) decibels are not dependent on the observer: they are a measured ratio ref. some baseline, of which there are several internationally accepted standards for volume measurement; (b) RMS is a way of measuring voltage, not power; (c) power only has a meaning ref. some load impedance. You are talking about SPL which is another kettle of fish entirely, depending on distance, transducer efficiency, etc. I don't see the relevance of any of this. The OP wants to measure probably dBm of a .wav file. Nothing to do with ears, distance, etc whatsoever.
    The great thing about saying things on public forums, is that if I dribble some sh*t, it does not take long for someone to point that out and correct me. Thanks for the heads up.
    Hi EJP..
    From my idea, is yes, the OP want to know the dB of a .wav file. Because, the voice that recorded is saved as a .wav file. Now, I am sort kind of confused in how to measure the dB.

    I think I have to get the waveform first then count it. The problem is, how can I get the waveform then count the dB?
    While I obviously have misunderstandings about measuring sound loudness, I am confident in assuring you that the J2SE had no inbuilt method for dB. You need to access (e.g. read) the signal, convert it to whatever unit system allows the calculation, and do that calculation yourself.
    Andrew Thompson wrote:
    The JavaSound API provides classes and methods to get access to to information coming through the PC's sound lines. See the Sampled Sound API of Java Sound for details.
    Maybe I learned wrong. But, so far, the sampled method are to convert, mix, write, and read. I don't understand which method we use to get the dB.
    Start with reading the sound signal.
    Good call on changing that title. Another tip is to add a single upper case letter to the start of every sentence. This helps the reader, and you would not want to make it harder for the reader, would you?
    I am so sorry and thank you for the suggestion. I am trying to write my reply more organize. So sorry for my English.
    Color me stunned. That you are taking more effort to write correctly pleases me, apologies mean little, but the 'sorry for my English' is slightly irritating. Why? Because no-one around here gives a hoot about English so long as a question is clear. Your question was clear. In fact, not only was it clear, but your first post was so well written that the only thing that might have given away that English was not your native tongue was that the sentences were too precise, native English speakers tend to be more sloppy with use of English.

    It was on your *2nd post* to this thread that suddenly all the sentences had no initial upper case letter.

    <question type='rhetorical'>Which is more likely, that you suddenly forgot sentence structure in English between the first & second post, or that in the 2nd post you became impatient/exasperated and did not bother typing the capital letters?</question type='rhetorical'>
  • 9. Re: can JSAPI work to get count the decibel from voices?
    EJP Guru
    Currently Being Moderated
    I think he needs to go a level lower than the Java Sound API. That seems to be just about playing sounds and playing with them, and adjusting entire characteristics such as gain. He needs to go down to a level where he can see individual samples, aggregate them, average them, and relate that to whatever dB reference he wants to use. Or find an API that does that. I don't see it in Java Sound, unless some combination of the bytes read by AudioInputStream and the current frame size gives you that, along with a good knowledge of the .WAV frame format? It's beyond my level of competence, I'm an analogue-type guy in sound.

    OTOH I don't know what he's doing all this for but maybe he should just normalize the .WAV files so they all have the same db?
  • 10. Re: can JSAPI work to get count the decibel from voices?
    845125 Newbie
    Currently Being Moderated
    Andrew Thompson wrote:
    While I obviously have misunderstandings about measuring sound loudness, I am confident in assuring you that the J2SE had no inbuilt method for dB. You need to access (e.g. read) the signal, convert it to whatever unit system allows the calculation, and do that calculation yourself.
    Hi Andrew..
    You said that I need to read the signal and convert it and then do the calculation. I am trying to find a way to read the signal right now, that is why I asked if JSAPI can do this. But since, JSAPI cannot do this, I am kind of confused now.

    Now I know that once I get the waveform, then I need to do calculation in order to get the dB. Thank you for pointing that out. It raised another question though. So the only way to get the waveform is by calculating? Or maybe not? Confused.
    Color me stunned. That you are taking more effort to write correctly pleases me, apologies mean little, but the 'sorry for my English' is slightly irritating. Why? Because no-one around here gives a hoot about English so long as a question is clear. Your question was clear. In fact, not only was it clear, but your first post was so well written that the only thing that might have given away that English was not your native tongue was that the sentences were too precise, native English speakers tend to be more sloppy with use of English.

    It was on your *2nd post* to this thread that suddenly all the sentences had no initial upper case letter.

    <question type='rhetorical'>Which is more likely, that you suddenly forgot sentence structure in English between the first & second post, or that in the 2nd post you became impatient/exasperated and did not bother typing the capital letters?</question type='rhetorical'>
    Maybe its because I am too curious and too nervous since I had post this question in so many forums, but none of them reply my question. I am too happy since finally I had a reply. Hahaha.
    EJP wrote:
    OTOH I don't know what he's doing all this for but maybe he should just normalize the .WAV files so they all have the same db?
    I want to make an application that work like a recognizer of tone. In this case is voice.
    This application should work if I said "Do" with the tone of "Re", then this application will tell user that his/her voice was false or his/her voice was perfect.

    In order to have that, I got the idea to count the dB value from each tone. What is the dB value for "Do", "Re", "Mi" and so on. When I get the dB value then I will put that into a database. So, this application will recognize the tone of it, is it "Do", "Re", and so on.

    Its for my final application project though.

    Thank you..

    Good day..

    Edited by: 842122 on Mar 7, 2011 10:51 AM
  • 11. Re: can JSAPI work to get count the decibel from voices?
    EJP Guru
    Currently Being Moderated
    The only way to get the waveform is by reading the file. The only way to get the average dB level is by calculating it. Surely this is obvious?
    In order to have that, I got the idea to count the dB value from each tone. What is the dB value for "Do", "Re", "Mi" and so on. When I get the dB value then I will put that into a database. So, this application will recognize the tone of it, is it "Do", "Re", and so on.
    You are completely and utterly mistaken about all this. The dB level is only the energy level. The speaker can utter 'Do' and 'Re' at exactly the same level. This technique cannot possibly achieve your objective.

    So you don't need to do any of this at all, it is futile. What you need to have a look at is voice recognition, probably based on some kind of FFT recognition.
  • 12. Re: can JSAPI work to get count the decibel from voices?
    845125 Newbie
    Currently Being Moderated
    EJP wrote:
    You are completely and utterly mistaken about all this. The dB level is only the energy level. The speaker can utter 'Do' and 'Re' at exactly the same level. This technique cannot possibly achieve your objective.

    So you don't need to do any of this at all, it is futile. What you need to have a look at is voice recognition, probably based on some kind of FFT recognition.
    Oh my..
    Umm.. Is voice recognition also an JSAPI? Or it has another API with it?

    Thank you..

    Good day..
  • 13. Re: can JSAPI work to get count the decibel from voices?
    793415 Pro
    Currently Being Moderated
    EJP wrote:
    The only way to get the waveform is by reading the file. The only way to get the average dB level is by calculating it. Surely this is obvious?
    In order to have that, I got the idea to count the dB value from each tone. What is the dB value for "Do", "Re", "Mi" and so on. When I get the dB value then I will put that into a database. So, this application will recognize the tone of it, is it "Do", "Re", and so on.
    You are completely and utterly mistaken about all this. The dB level is only the energy level. The speaker can utter 'Do' and 'Re' at exactly the same level. This technique cannot possibly achieve your objective.

    So you don't need to do any of this at all, it is futile. What you need to have a look at is voice recognition, probably based on some kind of FFT recognition.
    If the OP actually wants to map 'Do' to the correct tone, then I agree that speech recognition and FFT is the way to go.

    I looked over the Java Speech pages and noted that it was simply an 'interface' to allow others to plug-in to, and gave a page of implementers. Most of the implementations were purely for TTS - generating speech. Of the others, the links were either broken, or in the one instance where the link worked (to some company that supposedly makes a voice controlled browser) there was no mention of the voice recognition API for love nor money.

    In summary, I doubt that pure Java will be the best choice for this project unless the OP can come write a viable voice recognition plug-in for Java Speech. I'd estimate the chances of the OP bringing that to fruition, are slightly less than a snowball's change in Hades.
  • 14. Re: can JSAPI work to get count the decibel from voices?
    845125 Newbie
    Currently Being Moderated
    Andrew Thompson wrote:
    If the OP actually wants to map 'Do' to the correct tone, then I agree that speech recognition and FFT is the way to go.

    I looked over the Java Speech pages and noted that it was simply an 'interface' to allow others to plug-in to, and gave a page of implementers. Most of the implementations were purely for TTS - generating speech. Of the others, the links were either broken, or in the one instance where the link worked (to some company that supposedly makes a voice controlled browser) there was no mention of the voice recognition API for love nor money.
    Yes you right. I also search for tutorial and project done by JSAPI, and I only came up with tutorial in how to call the application, then it will run by itself, and text to speech or otherwise.
    In summary, I doubt that pure Java will be the best choice for this project unless the OP can come write a viable voice recognition plug-in for Java Speech. I'd estimate the chances of the OP bringing that to fruition, are slightly less than a snowball's change in Hades.
    Umm..
    What if I changed the idea? I try to not get the waveform but calculate it (the .wav file) using logarithm mathematics (log)?
    Is it possible?

    Thank your for your guidance..

    Good day..
1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points