Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Interpretation of recorded sound  (Read 2857 times)

0 Members and 1 Guest are viewing this topic.

lafoniz

  • Newbie
  • *
  • Posts: 19
    • View Profile
Interpretation of recorded sound
« on: February 13, 2015, 10:58:35 am »
I have been tinkering with SFML example program which main purpose is to record sound. I did notice a very interesting thing. It is possible to get some kind of nice data from SoundBufferRecorderinstance using getBuffer() member function. This data called samples is then saved in sf::Int16 array.
I was wondering if I can in someway visualize this data and I did:

After that I realized that I have no clue about this data interpretation. I know that sound is converted from analog to digital by sampling process and it isn't continuous. However I have no idea of this data meaning. Sample number is equal to what? Amplitude, frequency or?
« Last Edit: February 13, 2015, 11:02:27 am by lafoniz »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Interpretation of recorded sound
« Reply #1 on: February 13, 2015, 11:01:04 am »
If you just want to show what you did, please open a thread in the Projects forum, or post in the Screenshot thread if it doesn't deserve a dedicated discussion.
Laurent Gomila - SFML developer

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Interpretation of recorded sound
« Reply #2 on: February 13, 2015, 01:42:52 pm »
He asked a question, so I don't see it as just a presentation. ;)

Something we've more than once experienced on IRC is that the documentation on the audio module, more specifically the sound buffer data, is lacking information. In many cases one doesn't have to care about it, but since one can access that data, it would be nice to document what the audio data represents. Also question like, "How are multiple channels encoded in the data?", can't be answered without trying and figuring it out on your own.

As for the topic at hand: We don't know what it represents as long as we don't know how you processed the data. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Interpretation of recorded sound
« Reply #3 on: February 13, 2015, 02:01:33 pm »
Quote
He asked a question, so I don't see it as just a presentation.
That's not fair, he added it one minute after I posted.

And despite the bad documentation, the answer to his question is in the tutorial:
Quote
A sample is the amplitude of the sound signal at a given point in time

Sampled audio data (amplitude in function of time) is very common, you should not limit yourself to SFML, but rather find more generic documentation about digital audio processing. SFML just follows the common conventions for representing data.
Laurent Gomila - SFML developer

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
AW: Interpretation of recorded sound
« Reply #4 on: February 13, 2015, 08:25:03 pm »
I still think the documentation can be improved, be it only to point people to other sources and saying that it follows "standard" X. :)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

lafoniz

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Interpretation of recorded sound
« Reply #5 on: February 14, 2015, 02:53:42 am »
Thanks for answer, didn't see that information in the tutorial, it's good to know that is it amplitude, now I can research further and find useful information about it.